DebyeHuckel.cpp Source File#
DebyeHuckel.cpp
Go to the documentation of this file.
Headers for the DebyeHuckel ThermoPhase object, which models dilute electrolyte solutions (see Thermo...
Declarations for the class PDSS_ConstVol (pressure dependent standard state) which handles calculatio...
Implementation of a pressure dependent standard state virtual function for a Pure Water Phase (see Sp...
Declaration for class Cantera::Species.
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:427
bool hasKey(const string &key) const
Returns true if the map contains an item named key.
Definition AnyMap.cpp:1423
double convert(const string &key, const string &units) const
Convert the item stored by the given key to the units specified in units.
Definition AnyMap.cpp:1535
double & value(size_t i, size_t j)
Returns a changeable reference to position in the matrix.
Definition Array.h:160
virtual void resize(size_t n, size_t m, double v=0.0)
Resize the array, and fill the new entries with 'v'.
Definition Array.cpp:47
Base class for exceptions thrown by Cantera classes.
Definition ctexceptions.h:66
Array2D m_Beta_ij
Array of 2D data used in the DHFORM_BETAIJ formulation Beta_ij.value(i,j) is the coefficient of the j...
Definition DebyeHuckel.h:937
unique_ptr< WaterProps > m_waterProps
Pointer to the water property calculator.
Definition DebyeHuckel.h:912
int m_formDH
form of the Debye-Huckel parameterization used in the model.
Definition DebyeHuckel.h:794
DebyeHuckel(const string &inputFile="", const string &id="")
Full constructor for creating the phase.
Definition DebyeHuckel.cpp:33
virtual double d2A_DebyedT2_TP(double temperature=-1.0, double pressure=-1.0) const
Value of the 2nd derivative of the Debye Huckel constant with respect to temperature as a function of...
Definition DebyeHuckel.cpp:586
void getPartialMolarEnthalpies(double *hbar) const override
Returns an array of partial molar enthalpies for the species in the mixture.
Definition DebyeHuckel.cpp:150
void getChemPotentials(double *mu) const override
Get the species chemical potentials. Units: J/kmol.
Definition DebyeHuckel.cpp:130
double m_IionicMolality
Current value of the ionic strength on the molality scale.
Definition DebyeHuckel.h:816
double _osmoticCoeffHelgesonFixedForm() const
Formula for the osmotic coefficient that occurs in the GWB.
Definition DebyeHuckel.cpp:704
void s_update_d2lnMolalityActCoeff_dT2() const
Calculate the temperature 2nd derivative of the activity coefficient.
Definition DebyeHuckel.cpp:1071
void getSpeciesParameters(const string &name, AnyMap &speciesNode) const override
Get phase-specific parameters of a Species object such that an identical one could be reconstructed a...
Definition DebyeHuckel.cpp:479
int m_form_A_Debye
Form of the constant outside the Debye-Huckel term called A.
Definition DebyeHuckel.h:849
bool m_useHelgesonFixedForm
If true, then the fixed for of Helgeson's activity for water is used instead of the rigorous form obt...
Definition DebyeHuckel.h:827
static double _nonpolarActCoeff(double IionicMolality)
Static function that implements the non-polar species salt-out modifications.
Definition DebyeHuckel.cpp:690
vector< int > m_electrolyteSpeciesType
Vector containing the electrolyte species type.
Definition DebyeHuckel.h:807
double m_B_Debye
Current value of the constant that appears in the denominator.
Definition DebyeHuckel.h:889
void getParameters(AnyMap &phaseNode) const override
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
Definition DebyeHuckel.cpp:414
double AionicRadius(int k=0) const
Reports the ionic radius of the kth species.
Definition DebyeHuckel.cpp:636
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
Definition DebyeHuckel.cpp:356
vector< double > m_tmpV
vector of size m_kk, used as a temporary holding area.
Definition DebyeHuckel.h:915
void getActivityConcentrations(double *c) const override
This method returns an array of generalized concentrations.
Definition DebyeHuckel.cpp:88
void s_update_dlnMolalityActCoeff_dT() const
Calculation of temperature derivative of activity coefficient.
Definition DebyeHuckel.cpp:961
void s_update_lnMolalityActCoeff() const
Calculate the log activity coefficients.
Definition DebyeHuckel.cpp:738
vector< double > m_Aionic
a_k = Size of the ionic species in the DH formulation. units = meters
Definition DebyeHuckel.h:810
void getPartialMolarVolumes(double *vbar) const override
Return an array of partial molar volumes for the species in the mixture.
Definition DebyeHuckel.cpp:213
void calcDensity() override
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
Definition DebyeHuckel.cpp:74
double m_Aionic_default
Default ionic radius for species where it is not specified.
Definition DebyeHuckel.h:813
void setDebyeHuckelModel(const string &form)
Set the DebyeHuckel parameterization form.
Definition DebyeHuckel.cpp:281
vector< double > m_speciesCharge_Stoich
Stoichiometric species charge -> This is for calculations of the ionic strength which ignore ion-ion ...
Definition DebyeHuckel.h:929
double m_maxIionicStrength
Maximum value of the ionic strength allowed in the calculation of the activity coefficients.
Definition DebyeHuckel.h:820
double _lnactivityWaterHelgesonFixedForm() const
Formula for the log of the water activity that occurs in the GWB.
Definition DebyeHuckel.cpp:723
void setBeta(const string &sp1, const string &sp2, double value)
Set the value for the beta interaction between species sp1 and sp2.
Definition DebyeHuckel.cpp:342
double cp_mole() const override
Molar heat capacity at constant pressure. Units: J/kmol/K.
Definition DebyeHuckel.cpp:66
void getActivities(double *ac) const override
Get the array of non-dimensional activities at the current solution temperature, pressure,...
Definition DebyeHuckel.cpp:103
virtual double dA_DebyedT_TP(double temperature=-1.0, double pressure=-1.0) const
Value of the derivative of the Debye Huckel constant with respect to temperature.
Definition DebyeHuckel.cpp:562
void getPartialMolarCp(double *cpbar) const override
Return an array of partial molar heat capacities for the species in the mixture.
Definition DebyeHuckel.cpp:225
void setDefaultIonicRadius(double value)
Set the default ionic radius [m] for each species.
Definition DebyeHuckel.cpp:332
vector< double > m_d2lnActCoeffMolaldT2
2nd Derivative of log act coeff wrt T
Definition DebyeHuckel.h:950
double standardConcentration(size_t k=0) const override
Return the standard concentration for the kth species.
Definition DebyeHuckel.cpp:97
void s_update_dlnMolalityActCoeff_dP() const
Calculate the pressure derivative of the activity coefficient.
Definition DebyeHuckel.cpp:1177
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
Definition DebyeHuckel.cpp:643
double m_IionicMolalityStoich
Stoichiometric ionic strength on the molality scale.
Definition DebyeHuckel.h:830
vector< double > m_lnActCoeffMolal
Logarithm of the activity coefficients on the molality scale.
Definition DebyeHuckel.h:944
void getMolalityActivityCoefficients(double *acMolality) const override
Get the array of non-dimensional molality-based activity coefficients at the current solution tempera...
Definition DebyeHuckel.cpp:117
void getPartialMolarEntropies(double *sbar) const override
Returns an array of partial molar entropies of the species in the solution.
Definition DebyeHuckel.cpp:175
virtual double A_Debye_TP(double temperature=-1.0, double pressure=-1.0) const
Return the Debye Huckel constant as a function of temperature and pressure (Units = sqrt(kg/gmol))
Definition DebyeHuckel.cpp:536
virtual double dA_DebyedP_TP(double temperature=-1.0, double pressure=-1.0) const
Value of the derivative of the Debye Huckel constant with respect to pressure, as a function of tempe...
Definition DebyeHuckel.cpp:610
double m_Mnaught
This is the multiplication factor that goes inside log expressions involving the molalities of specie...
Definition MolalityVPSSTP.h:612
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
Definition MolalityVPSSTP.cpp:269
vector< double > m_molalities
Current value of the molalities of the species in the phase.
Definition MolalityVPSSTP.h:616
void calcMolalities() const
Calculates the molality of all species and stores the result internally.
Definition MolalityVPSSTP.cpp:60
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
Definition MolalityVPSSTP.cpp:343
Class for pressure dependent standard states that use a constant volume model.
Definition PDSS_ConstVol.h:23
Class for the liquid water pressure dependent standard state.
Definition PDSS_Water.h:50
double density() const override
Return the standard state density at standard state.
Definition PDSS_Water.cpp:207
void assignDensity(const double density_)
Set the internally stored constant density (kg/m^3) of the phase.
Definition Phase.cpp:597
void checkSpeciesIndex(size_t k) const
Check that the specified species index is in range.
Definition Phase.cpp:153
size_t speciesIndex(const string &name) const
Returns the index of a species named 'name' within the Phase object.
Definition Phase.cpp:129
double moleFraction(size_t k) const
Return the mole fraction of a single species.
Definition Phase.cpp:439
double mean_X(const double *const Q) const
Evaluate the mole-fraction-weighted mean of an array Q.
Definition Phase.cpp:616
shared_ptr< Species > species(const string &name) const
Return the Species object for the named species.
Definition Phase.cpp:856
double charge(size_t k) const
Dimensionless electrical charge of a single molecule of species k The charge is normalized by the the...
Definition Phase.h:538
virtual void getParameters(AnyMap &phaseNode) const
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
Definition ThermoPhase.cpp:1099
double RT() const
Return the Gas Constant multiplied by the current temperature.
Definition ThermoPhase.h:1062
void initThermoFile(const string &inputFile, const string &id)
Initialize a ThermoPhase object using an input file.
Definition ThermoPhase.cpp:995
virtual void getSpeciesParameters(const string &name, AnyMap &speciesNode) const
Get phase-specific parameters of a Species object such that an identical one could be reconstructed a...
Definition ThermoPhase.h:1831
double pressure() const override
Returns the current pressure of the phase.
Definition VPStandardStateTP.h:118
void getEntropy_R(double *sr) const override
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
Definition VPStandardStateTP.cpp:52
virtual void _updateStandardStateThermo() const
Updates the standard state thermodynamic functions at the current T and P of the solution.
Definition VPStandardStateTP.cpp:259
void getStandardChemPotentials(double *mu) const override
Get the array of chemical potentials at unit activity for the species at their standard states at the...
Definition VPStandardStateTP.cpp:38
void getCp_R(double *cpr) const override
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
Definition VPStandardStateTP.cpp:80
void getEnthalpy_RT(double *hrt) const override
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
Definition VPStandardStateTP.cpp:46
void getStandardVolumes(double *vol) const override
Get the molar volumes of the species standard states at the current T and P of the solution.
Definition VPStandardStateTP.cpp:86
Header file for a common definitions used in electrolytes thermodynamics.
bool caseInsensitiveEquals(const string &input, const string &test)
Case insensitive equality predicate.
Definition stringUtils.cpp:223
static int interp_est(const string &estString)
Utility function to assign an integer value from a string for the ElectrolyteSpeciesType field.
Definition DebyeHuckel.cpp:256
Contains declarations for string manipulation functions within Cantera.
Generated by