29 DebyeHuckel::DebyeHuckel() :
30 m_formDH(DHFORM_DILUTE_LIMIT),
31 m_IionicMolality(0.0),
32 m_maxIionicStrength(30.0),
33 m_useHelgesonFixedForm(false),
34 m_IionicMolalityStoich(0.0),
35 m_form_A_Debye(A_DEBYE_CONST),
44 const std::string& id_) :
45 m_formDH(DHFORM_DILUTE_LIMIT),
46 m_IionicMolality(0.0),
47 m_maxIionicStrength(30.0),
48 m_useHelgesonFixedForm(false),
49 m_IionicMolalityStoich(0.0),
50 m_form_A_Debye(A_DEBYE_CONST),
60 m_formDH(DHFORM_DILUTE_LIMIT),
61 m_IionicMolality(0.0),
62 m_maxIionicStrength(3.0),
63 m_useHelgesonFixedForm(false),
64 m_IionicMolalityStoich(0.0),
65 m_form_A_Debye(A_DEBYE_CONST),
74 DebyeHuckel::~DebyeHuckel()
123 "Density is not an independent variable");
132 "molarDensity/density is not an independent variable");
142 for (
size_t k = 0; k <
m_kk; k++) {
150 return 1.0 / mvSolvent;
160 for (
size_t k = 1; k <
m_kk; k++) {
173 for (
size_t k = 0; k <
m_kk; k++) {
174 acMolality[k] = exp(acMolality[k]);
192 for (
size_t k = 1; k <
m_kk; k++) {
206 for (
size_t k = 0; k <
m_kk; k++) {
219 for (
size_t k = 0; k <
m_kk; k++) {
232 for (
size_t k = 0; k <
m_kk; k++) {
243 for (
size_t k = 1; k <
m_kk; k++) {
257 for (
size_t k = 0; k <
m_kk; k++) {
270 for (
size_t k = 0; k <
m_kk; k++) {
278 for (
size_t k = 0; k <
m_kk; k++) {
292 for (
size_t k = 0; k <
m_kk; k++) {
311 return cEST_chargedSpecies;
313 return cEST_weakAcidAssociated;
315 return cEST_strongAcidAssociated;
317 return cEST_polarNeutral;
319 return cEST_nonpolarNeutral;
322 "Invalid electrolyte species type '{}'", estString);
341 "Unknown model '{}'", model);
355 void DebyeHuckel::setB_dot(
double bdot)
360 "B_dot entry in the wrong DH form");
363 for (
size_t k = 0; k <
nSpecies(); k++) {
364 if (fabs(
charge(k)) > 0.0001) {
374 for (
size_t k = 0; k <
m_kk; k++) {
386 throw CanteraError(
"DebyeHuckel::setBeta",
"Species '{}' not found", sp1);
390 throw CanteraError(
"DebyeHuckel::setBeta",
"Species '{}' not found", sp2);
398 if (id_.size() > 0) {
399 std::string idp = phaseNode.
id();
402 "phasenode and Id are incompatible");
407 if (!phaseNode.
hasChild(
"thermo")) {
409 "no thermo XML node");
417 if (thermoNode.
hasChild(
"activityCoefficients")) {
426 if (thermoNode.
hasChild(
"activityCoefficients")) {
433 string modelString = ss->
attrib(
"model");
434 if (modelString !=
"") {
439 "A_Debye Model \"" + modelString +
449 setB_Debye(
getFloat(acNode,
"B_Debye"));
454 setB_dot(
getFloat(acNode,
"B_dot"));
458 if (acNode.
hasChild(
"maxIonicStrength")) {
459 setMaxIonicStrength(
getFloat(acNode,
"maxIonicStrength"));
463 useHelgesonFixedForm(acNode.
hasChild(
"UseHelgesonFixedForm"));
466 if (acNode.
hasChild(
"ionicRadius")) {
469 double Afactor = 1.0;
471 std::string Aunits = irNode.
attrib(
"units");
472 Afactor =
toSI(Aunits);
491 map<string, string> m;
498 for (
const auto& b : m) {
510 if (acNode.
hasChild(
"DHBetaMatrix")) {
518 "DHBetaMatrix found for wrong type");
523 if (acNodePtr && acNodePtr->
hasChild(
"stoichIsMods")) {
525 map<std::string, std::string> msIs;
527 for (
const auto& b : msIs) {
529 double val =
fpValue(b.second);
536 if (acNodePtr && acNodePtr->
hasChild(
"electrolyteSpeciesType")) {
537 XML_Node& ESTNode = acNodePtr->
child(
"electrolyteSpeciesType");
538 map<std::string, std::string> msEST;
540 for (
const auto& b : msEST) {
542 std::string est = b.second;
545 "Bad electrolyte type: " + est);
568 }
else if (dynamic_cast<PDSS_ConstVol*>(providePDSS(0)) == 0) {
569 throw CanteraError(
"DebyeHuckel::initThermo",
"Solvent standard state" 570 " model must be WaterIAPWS or constant_incompressible.");
574 for (
size_t k = 1; k <
nSpecies(); k++) {
575 if (dynamic_cast<PDSS_ConstVol*>(providePDSS(k)) == 0) {
576 throw CanteraError(
"DebyeHuckel::initThermo",
"Solute standard" 577 " state model must be constant_incompressible.");
586 if (tempArg != -1.0) {
590 if (presArg != -1.0) {
603 throw CanteraError(
"DebyeHuckel::A_Debye_TP",
"shouldn't be here");
611 if (tempArg != -1.0) {
615 if (presArg != -1.0) {
627 throw CanteraError(
"DebyeHuckel::dA_DebyedT_TP",
"shouldn't be here");
635 if (tempArg != -1.0) {
639 if (presArg != -1.0) {
651 throw CanteraError(
"DebyeHuckel::d2A_DebyedT2_TP",
"shouldn't be here");
659 if (tempArg != -1.0) {
663 if (presArg != -1.0) {
675 throw CanteraError(
"DebyeHuckel::dA_DebyedP_TP",
"shouldn't be here");
700 if (spec->extra.hasKey(
"ionic_radius")) {
701 m_Aionic.push_back(spec->extra[
"ionic_radius"].asDouble());
707 int est = cEST_nonpolarNeutral;
708 double stoichCharge = spec->charge;
709 if (fabs(spec->charge) > 0.0001) {
710 est = cEST_chargedSpecies;
712 if (spec->extra.hasKey(
"weak_acid_charge")) {
713 stoichCharge = spec->extra[
"weak_acid_charge"].asDouble();
714 if (fabs(stoichCharge - spec->charge) > 0.0001) {
715 est = cEST_weakAcidAssociated;
725 if (spec->extra.hasKey(
"electrolyte_species_type")) {
726 est =
interp_est(spec->extra[
"electrolyte_species_type"].asString());
738 const static double npActCoeff[] = {0.1127, -0.01049, 1.545E-3};
739 double I2 = IionicMolality * IionicMolality;
741 npActCoeff[0] * IionicMolality +
743 npActCoeff[2] * I2 * IionicMolality;
744 return pow(10.0 , l10actCoeff);
749 const double a0 = 1.454;
750 const double b0 = 0.02236;
751 const double c0 = 9.380E-3;
752 const double d0 = -5.362E-4;
757 double Is2 = Is * Is;
758 double bhat = 1.0 + a0 * sqrt(Is);
759 double func = bhat - 2.0 * log(bhat) - 1.0/bhat;
760 double v1 =
m_A_Debye / (a0 * a0 * a0 * Is) * func;
761 double oc = 1.0 - v1 + b0 * Is / 2.0 + 2.0 * c0 * Is2 / 3.0
762 + 3.0 * d0 * Is2 * Is / 4.0;
772 for (
size_t k = 1; k <
m_kk; k++) {
783 double z_k, zs_k1, zs_k2;
794 for (
size_t k = 0; k <
m_kk; k++) {
803 for (
size_t k = 0; k <
m_kk; k++) {
825 xmolSolvent = std::max(8.689E-3, xmolSolvent);
828 double ac_nonPolar = 1.0;
832 double lnActivitySolvent = 0.0;
835 double y, yp1, sigma;
837 case DHFORM_DILUTE_LIMIT:
838 for (
size_t k = 0; k <
m_kk; k++) {
843 (xmolSolvent - 1.0)/xmolSolvent +
850 for (
size_t k = 0; k <
m_kk; k++) {
852 if (est == cEST_nonpolarNeutral) {
857 - z_k * z_k * numTmp / (1.0 + denomTmp *
m_Aionic[k])
862 lnActivitySolvent = (xmolSolvent - 1.0)/xmolSolvent;
866 if (denomTmp > 0.0) {
867 for (
size_t k = 0; k <
m_kk; k++) {
871 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
877 lnActivitySolvent += coeff * tmp;
879 for (
size_t k = 1; k <
m_kk; k++) {
895 case DHFORM_BDOT_ACOMMON:
897 for (
size_t k = 0; k <
m_kk; k++) {
900 - z_k * z_k * numTmp / (1.0 + denomTmp)
903 if (denomTmp > 0.0) {
906 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
911 (xmolSolvent - 1.0)/xmolSolvent +
915 for (
size_t k = 1; k <
m_kk; k++) {
929 (xmolSolvent - 1.0)/xmolSolvent;
931 for (
size_t k = 1; k <
m_kk; k++) {
934 - z_k * z_k * numTmp / (1.0 + denomTmp);
935 for (
size_t j = 0; j <
m_kk; j++) {
940 if (denomTmp > 0.0) {
943 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 -2.0*log(yp1));
948 (xmolSolvent - 1.0)/xmolSolvent +
952 for (
size_t k = 0; k <
m_kk; k++) {
953 for (
size_t j = 0; j <
m_kk; j++) {
961 case DHFORM_PITZER_BETAIJ:
965 tmpLn = log(1.0 + denomTmp);
966 for (
size_t k = 1; k <
m_kk; k++) {
969 - z_k * z_k * numTmp / 3.0 / (1.0 + denomTmp);
973 for (
size_t j = 0; j <
m_kk; j++) {
978 sigma = 1.0 / (1.0 + denomTmp);
980 (xmolSolvent - 1.0)/xmolSolvent +
984 for (
size_t k = 0; k <
m_kk; k++) {
985 for (
size_t j = 0; j <
m_kk; j++) {
994 throw CanteraError(
"DebyeHuckel::s_update_lnMolalityActCoeff",
"ERROR");
1006 double z_k, coeff, tmp, y, yp1, sigma, tmpLn;
1010 for (
size_t k = 0; k <
m_kk; k++) {
1018 xmolSolvent = std::max(8.689E-3, xmolSolvent);
1020 double numdAdTTmp = dAdT * sqrtI;
1022 double d_lnActivitySolvent_dT = 0;
1025 case DHFORM_DILUTE_LIMIT:
1026 for (
size_t k = 1; k <
m_kk; k++) {
1030 d_lnActivitySolvent_dT = 2.0 / 3.0 * dAdT *
m_Mnaught *
1035 case DHFORM_BDOT_AK:
1036 for (
size_t k = 0; k <
m_kk; k++) {
1039 - z_k * z_k * numdAdTTmp / (1.0 + denomTmp *
m_Aionic[k]);
1043 coeff = 2.0 / 3.0 * dAdT *
m_Mnaught * sqrtI;
1045 if (denomTmp > 0.0) {
1046 for (
size_t k = 0; k <
m_kk; k++) {
1049 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1057 case DHFORM_BDOT_ACOMMON:
1059 for (
size_t k = 0; k <
m_kk; k++) {
1062 - z_k * z_k * numdAdTTmp / (1.0 + denomTmp);
1064 if (denomTmp > 0.0) {
1067 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1077 for (
size_t k = 1; k <
m_kk; k++) {
1081 if (denomTmp > 0.0) {
1084 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1092 case DHFORM_PITZER_BETAIJ:
1094 tmpLn = log(1.0 + denomTmp);
1095 for (
size_t k = 1; k <
m_kk; k++) {
1098 - z_k * z_k * numdAdTTmp / (1.0 + denomTmp)
1103 sigma = 1.0 / (1.0 + denomTmp);
1109 throw CanteraError(
"DebyeHuckel::s_update_dlnMolalityActCoeff_dT",
1116 double z_k, coeff, tmp, y, yp1, sigma, tmpLn;
1119 if (d2AdT2 == 0.0 && dAdT == 0.0) {
1120 for (
size_t k = 0; k <
m_kk; k++) {
1128 xmolSolvent = std::max(8.689E-3, xmolSolvent);
1130 double numd2AdT2Tmp = d2AdT2 * sqrtI;
1134 case DHFORM_DILUTE_LIMIT:
1135 for (
size_t k = 0; k <
m_kk; k++) {
1141 case DHFORM_BDOT_AK:
1142 for (
size_t k = 0; k <
m_kk; k++) {
1145 - z_k * z_k * numd2AdT2Tmp / (1.0 + denomTmp *
m_Aionic[k]);
1149 coeff = 2.0 / 3.0 * d2AdT2 *
m_Mnaught * sqrtI;
1151 if (denomTmp > 0.0) {
1152 for (
size_t k = 0; k <
m_kk; k++) {
1155 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1163 case DHFORM_BDOT_ACOMMON:
1165 for (
size_t k = 0; k <
m_kk; k++) {
1168 - z_k * z_k * numd2AdT2Tmp / (1.0 + denomTmp);
1170 if (denomTmp > 0.0) {
1173 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1183 for (
size_t k = 1; k <
m_kk; k++) {
1187 if (denomTmp > 0.0) {
1190 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 -2.0*log(yp1));
1198 case DHFORM_PITZER_BETAIJ:
1200 tmpLn = log(1.0 + denomTmp);
1201 for (
size_t k = 1; k <
m_kk; k++) {
1204 - z_k * z_k * numd2AdT2Tmp / (1.0 + denomTmp)
1209 sigma = 1.0 / (1.0 + denomTmp);
1215 throw CanteraError(
"DebyeHuckel::s_update_d2lnMolalityActCoeff_dT2",
1222 double z_k, coeff, tmp, y, yp1, sigma, tmpLn;
1226 for (
size_t k = 0; k <
m_kk; k++) {
1234 xmolSolvent = std::max(8.689E-3, xmolSolvent);
1236 double numdAdPTmp = dAdP * sqrtI;
1240 case DHFORM_DILUTE_LIMIT:
1241 for (
size_t k = 0; k <
m_kk; k++) {
1247 case DHFORM_BDOT_AK:
1248 for (
size_t k = 0; k <
m_kk; k++) {
1250 if (est == cEST_nonpolarNeutral) {
1255 - z_k * z_k * numdAdPTmp / (1.0 + denomTmp *
m_Aionic[k]);
1260 coeff = 2.0 / 3.0 * dAdP *
m_Mnaught * sqrtI;
1262 if (denomTmp > 0.0) {
1263 for (
size_t k = 0; k <
m_kk; k++) {
1266 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1274 case DHFORM_BDOT_ACOMMON:
1276 for (
size_t k = 0; k <
m_kk; k++) {
1279 - z_k * z_k * numdAdPTmp / (1.0 + denomTmp);
1281 if (denomTmp > 0.0) {
1284 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1295 for (
size_t k = 1; k <
m_kk; k++) {
1299 if (denomTmp > 0.0) {
1302 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1310 case DHFORM_PITZER_BETAIJ:
1312 tmpLn = log(1.0 + denomTmp);
1313 for (
size_t k = 1; k <
m_kk; k++) {
1316 - z_k * z_k * numdAdPTmp / (1.0 + denomTmp)
1317 - 2.0 * z_k * z_k * dAdP * tmpLn
1322 sigma = 1.0 / (1.0 + denomTmp);
1328 throw CanteraError(
"DebyeHuckel::s_update_dlnMolalityActCoeff_dP",
void getMap(const XML_Node &node, std::map< std::string, std::string > &m)
This routine is used to interpret the value portions of XML elements that contain colon separated pai...
const int cEST_solvent
Electrolyte species type.
double m_IionicMolalityStoich
Stoichiometric ionic strength on the molality scale.
doublereal fpValue(const std::string &val)
Translate a string into one doublereal value.
int m_form_A_Debye
Form of the constant outside the Debye-Huckel term called A.
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data...
static double _nonpolarActCoeff(double IionicMolality)
Static function that implements the non-polar species salt-out modifications.
static int interp_est(const std::string &estString)
Utility function to assign an integer value from a string for the ElectrolyteSpeciesType field...
const XML_Node * findByName(const std::string &nm, int depth=100000) const
This routine carries out a recursive search for an XML node based on the name of the node...
doublereal temperature() const
Temperature (K).
vector_fp m_dlnActCoeffMolaldT
Derivative of log act coeff wrt T.
void resize(size_t n, size_t m, doublereal v=0.0)
Resize the array, and fill the new entries with 'v'.
size_t speciesIndex(const std::string &name) const
Returns the index of a species named 'name' within the Phase object.
doublereal m_Mnaught
This is the multiplication factor that goes inside log expressions involving the molalities of specie...
void setDefaultIonicRadius(double value)
Set the default ionic radius [m] for each species.
doublereal toSI(const std::string &unit)
Return the conversion factor to convert unit std::string 'unit' to SI units.
doublereal moleFraction(size_t k) const
Return the mole fraction of a single species.
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
std::unique_ptr< WaterProps > m_waterProps
Pointer to the water property calculator.
const size_t npos
index returned by functions to indicate "no position"
vector_fp m_speciesCharge
Vector of species charges. length m_kk.
Header file for a common definitions used in electrolytes thermodynamics.
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
virtual doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
Class XML_Node is a tree-based representation of the contents of an XML file.
Implementation of a pressure dependent standard state virtual function for a Pure Water Phase (see Sp...
virtual void initThermo()
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
size_t nSpecies() const
Returns the number of species in the phase.
virtual doublereal density() const
Density (kg/m^3).
bool m_useHelgesonFixedForm
If true, then the fixed for of Helgeson's activity for water is used instead of the rigorous form obt...
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...
void s_update_lnMolalityActCoeff() const
Calculate the log activity coefficients.
void setDebyeHuckelModel(const std::string &form)
Set the DebyeHuckel parameterization form.
virtual bool addSpecies(shared_ptr< Species > spec)
void setBeta(const std::string &sp1, const std::string &sp2, double value)
Set the value for the beta interaction between species sp1 and sp2.
double _osmoticCoeffHelgesonFixedForm() const
Formula for the osmotic coefficient that occurs in the GWB.
bool hasAttrib(const std::string &a) const
Tests whether the current node has an attribute with a particular name.
virtual void setDensity(const doublereal rho)
Set the internally stored density (gm/m^3) of the phase.
Headers for the DebyeHuckel ThermoPhase object, which models dilute electrolyte solutions (see Thermo...
const std::vector< std::string > & speciesNames() const
Return a const reference to the vector of species names.
doublereal mean_X(const doublereal *const Q) const
Evaluate the mole-fraction-weighted mean of an array Q.
doublereal RT() const
Return the Gas Constant multiplied by the current temperature.
DebyeHuckel()
Default Constructor.
virtual doublereal molarVolume() const
Return the molar volume at standard state.
virtual doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
doublereal molarDensity() const
Molar density (kmol/m^3).
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. ...
The WaterProps class is used to house several approximation routines for properties of water...
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...
vector_fp m_Aionic
a_k = Size of the ionic species in the DH formulation. units = meters
Class for the liquid water pressure dependent standard state.
double m_maxIionicStrength
Maximum value of the ionic strength allowed in the calculation of the activity coefficients.
int m_formDH
form of the Debye-Huckel parameterization used in the model.
virtual void _updateStandardStateThermo() const
Updates the standard state thermodynamic functions at the current T and P of the solution.
double m_A_Debye
Current value of the Debye Constant, A_Debye.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
double AionicRadius(int k=0) const
Reports the ionic radius of the kth species.
vector_fp m_lnActCoeffMolal
Logarithm of the activity coefficients on the molality scale.
void s_update_dlnMolalityActCoeff_dP() const
Calculate the pressure derivative of the activity coefficient.
bool caseInsensitiveEquals(const std::string &input, const std::string &test)
Case insensitive equality predicate.
virtual void getStandardChemPotentials(doublereal *mu) const
Get the array of chemical potentials at unit activity for the species at their standard states at the...
Base class for exceptions thrown by Cantera classes.
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
PDSS_Water * m_waterSS
Pointer to the Water standard state object.
vector_fp m_B_Dot
Array of B_Dot values.
virtual void getPartialMolarCp(doublereal *cpbar) const
Return an array of partial molar heat capacities for the species in the mixture.
void s_update_d2lnMolalityActCoeff_dT2() const
Calculate the temperature 2nd derivative of the activity coefficient.
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
virtual void setStateFromXML(const XML_Node &state)
Set equation of state parameter values from XML entries.
doublereal & value(size_t i, size_t j)
Returns a changeable reference to position in the matrix.
void importPhase(XML_Node &phase, ThermoPhase *th)
Import a phase information into an empty ThermoPhase object.
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)) ...
void s_update_dlnMolalityActCoeff_dT() const
Calculation of temperature derivative of activity coefficient.
virtual void getActivities(doublereal *ac) const
Get the array of non-dimensional activities at the current solution temperature, pressure, and solution concentration.
virtual doublereal pressure() const
Returns the current pressure of the phase.
virtual void calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input...
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
vector_int m_electrolyteSpeciesType
Vector containing the electrolyte species type.
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
XML_Node & child(const size_t n) const
Return a changeable reference to the n'th child of the current node.
void setA_Debye(double A)
Set the A_Debye parameter.
vector_fp m_speciesCharge_Stoich
Stoichiometric species charge -> This is for calculations of the ionic strength which ignore ion-ion ...
void getMatrixValues(const XML_Node &node, const std::vector< std::string > &keyStringRow, const std::vector< std::string > &keyStringCol, Array2D &retnValues, const bool convert, const bool matrixSymmetric)
This function interprets the value portion of an XML element as a series of "Matrix ids and entries" ...
double m_IionicMolality
Current value of the ionic strength on the molality scale.
virtual void getMolalityActivityCoefficients(doublereal *acMolality) const
Get the array of non-dimensional molality-based activity coefficients at the current solution tempera...
vector_fp m_molalities
Current value of the molalities of the species in the phase.
const doublereal SmallNumber
smallest number to compare to zero.
std::string attrib(const std::string &attr) const
Function returns the value of an attribute.
doublereal meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
vector_fp m_d2lnActCoeffMolaldT2
2nd Derivative of log act coeff wrt T
vector_fp m_tmpV
vector of size m_kk, used as a temporary holding area.
virtual void initThermo()
std::string id() const
Return the id attribute, if present.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
double m_B_Debye
Current value of the constant that appears in the denominator.
Contains declarations for string manipulation functions within Cantera.
doublereal getFloat(const XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
virtual doublereal gibbs_mole() const
Molar Gibbs function. Units: J/kmol.
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
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...
Declarations for the class PDSS_ConstVol (pressure dependent standard state) which handles calculatio...
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
size_t m_kk
Number of species in the phase.
vector_fp m_dlnActCoeffMolaldP
Derivative of log act coeff wrt P.
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
virtual doublereal density() const
Return the standard state density at standard state.
virtual void initThermoFile(const std::string &inputFile, const std::string &id)
void calcMolalities() const
Calculates the molality of all species and stores the result internally.
Namespace for the Cantera kernel.
double _lnactivityWaterHelgesonFixedForm() const
Formula for the log of the water activity that occurs in the GWB.
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
doublereal charge(size_t k) const
Dimensionless electrical charge of a single molecule of species k The charge is normalized by the the...
virtual bool addSpecies(shared_ptr< Species > spec)
virtual void getStandardVolumes(doublereal *vol) const
Get the molar volumes of the species standard states at the current T and P of the solution...
virtual void setDensity(const doublereal density_)
Set the internally stored density (kg/m^3) of the phase.
double m_densWaterSS
Storage for the density of water's standard state.
virtual void setMolarDensity(const doublereal conc)
Set the internally stored molar density (kmol/m^3) of the phase.