Go to the documentation of this file.
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()
121 "Overloaded function to be removed after Cantera 2.5. "
122 "Error will be thrown by Phase::setDensity instead");
126 "Density is not an independent variable");
133 "Overloaded function to be removed after Cantera 2.5. "
134 "Error will be thrown by Phase::setMolarDensity instead");
138 "molarDensity/density is not an independent variable");
148 for (
size_t k = 0; k <
m_kk; k++) {
156 return 1.0 / mvSolvent;
166 for (
size_t k = 1; k <
m_kk; k++) {
179 for (
size_t k = 0; k <
m_kk; k++) {
180 acMolality[k] = exp(acMolality[k]);
198 for (
size_t k = 1; k <
m_kk; k++) {
212 for (
size_t k = 0; k <
m_kk; k++) {
225 for (
size_t k = 0; k <
m_kk; k++) {
238 for (
size_t k = 0; k <
m_kk; k++) {
249 for (
size_t k = 1; k <
m_kk; k++) {
263 for (
size_t k = 0; k <
m_kk; k++) {
276 for (
size_t k = 0; k <
m_kk; k++) {
284 for (
size_t k = 0; k <
m_kk; k++) {
298 for (
size_t k = 0; k <
m_kk; k++) {
316 }
else if (estString ==
"charged-species"
318 return cEST_chargedSpecies;
319 }
else if (estString ==
"weak-acid-associated"
321 return cEST_weakAcidAssociated;
322 }
else if (estString ==
"strong-acid-associated"
324 return cEST_strongAcidAssociated;
325 }
else if (estString ==
"polar-neutral"
327 return cEST_polarNeutral;
328 }
else if (estString ==
"nonpolar-neutral"
330 return cEST_nonpolarNeutral;
333 "Invalid electrolyte species type '{}'", estString);
339 || model ==
"dilute-limit"
342 }
else if (model ==
"B-dot-with-variable-a"
345 }
else if (model ==
"B-dot-with-common-a"
351 }
else if (model ==
"Pitzer-with-beta_ij"
357 "Unknown model '{}'", model);
371 void DebyeHuckel::setB_dot(
double bdot)
376 "B_dot entry in the wrong DH form");
379 for (
size_t k = 0; k <
nSpecies(); k++) {
380 if (fabs(
charge(k)) > 0.0001) {
390 for (
size_t k = 0; k <
m_kk; k++) {
402 throw CanteraError(
"DebyeHuckel::setBeta",
"Species '{}' not found", sp1);
406 throw CanteraError(
"DebyeHuckel::setBeta",
"Species '{}' not found", sp2);
414 if (id_.size() > 0) {
415 std::string idp = phaseNode.
id();
418 "phasenode and Id are incompatible");
423 if (!phaseNode.
hasChild(
"thermo")) {
425 "no thermo XML node");
433 if (thermoNode.
hasChild(
"activityCoefficients")) {
442 if (thermoNode.
hasChild(
"activityCoefficients")) {
449 string modelString = ss->
attrib(
"model");
450 if (modelString !=
"") {
455 "A_Debye Model \"" + modelString +
465 setB_Debye(
getFloat(acNode,
"B_Debye"));
470 setB_dot(
getFloat(acNode,
"B_dot"));
474 if (acNode.
hasChild(
"maxIonicStrength")) {
475 setMaxIonicStrength(
getFloat(acNode,
"maxIonicStrength"));
479 useHelgesonFixedForm(acNode.
hasChild(
"UseHelgesonFixedForm"));
482 if (acNode.
hasChild(
"ionicRadius")) {
485 double Afactor = 1.0;
487 std::string Aunits = irNode.
attrib(
"units");
488 Afactor =
toSI(Aunits);
507 map<string, string> m;
514 for (
const auto& b : m) {
526 if (acNode.
hasChild(
"DHBetaMatrix")) {
534 "DHBetaMatrix found for wrong type");
539 if (acNodePtr && acNodePtr->
hasChild(
"stoichIsMods")) {
541 map<std::string, std::string> msIs;
543 for (
const auto& b : msIs) {
545 double val =
fpValue(b.second);
552 if (acNodePtr && acNodePtr->
hasChild(
"electrolyteSpeciesType")) {
553 XML_Node& ESTNode = acNodePtr->
child(
"electrolyteSpeciesType");
554 map<std::string, std::string> msEST;
556 for (
const auto& b : msEST) {
558 std::string est = b.second;
561 "Bad electrolyte type: " + est);
579 if (node.hasKey(
"A_Debye")) {
580 if (node[
"A_Debye"] ==
"variable") {
583 setA_Debye(node.convert(
"A_Debye",
"kg^0.5/gmol^0.5"));
586 if (node.hasKey(
"B_Debye")) {
587 setB_Debye(node.convert(
"B_Debye",
"kg^0.5/gmol^0.5/m"));
589 if (node.hasKey(
"max-ionic-strength")) {
590 setMaxIonicStrength(node[
"max-ionic-strength"].asDouble());
592 if (node.hasKey(
"use-Helgeson-fixed-form")) {
593 useHelgesonFixedForm(node[
"use-Helgeson-fixed-form"].asBool());
595 if (node.hasKey(
"default-ionic-radius")) {
598 if (node.hasKey(
"B-dot")) {
599 setB_dot(node[
"B-dot"].asDouble());
601 if (node.hasKey(
"beta")) {
602 for (
auto& item : node[
"beta"].asVector<AnyMap>()) {
603 auto&
species = item[
"species"].asVector<
string>(2);
617 }
else if (
dynamic_cast<PDSS_ConstVol*
>(providePDSS(0)) == 0) {
618 throw CanteraError(
"DebyeHuckel::initThermo",
"Solvent standard state"
619 " model must be WaterIAPWS or constant_incompressible.");
623 for (
size_t k = 1; k <
nSpecies(); k++) {
625 throw CanteraError(
"DebyeHuckel::initThermo",
"Solute standard"
626 " state model must be constant_incompressible.");
635 if (tempArg != -1.0) {
639 if (presArg != -1.0) {
652 throw CanteraError(
"DebyeHuckel::A_Debye_TP",
"shouldn't be here");
660 if (tempArg != -1.0) {
664 if (presArg != -1.0) {
676 throw CanteraError(
"DebyeHuckel::dA_DebyedT_TP",
"shouldn't be here");
684 if (tempArg != -1.0) {
688 if (presArg != -1.0) {
700 throw CanteraError(
"DebyeHuckel::d2A_DebyedT2_TP",
"shouldn't be here");
708 if (tempArg != -1.0) {
712 if (presArg != -1.0) {
724 throw CanteraError(
"DebyeHuckel::dA_DebyedP_TP",
"shouldn't be here");
753 int est = cEST_nonpolarNeutral;
754 double stoichCharge = spec->charge;
755 if (fabs(spec->charge) > 0.0001) {
756 est = cEST_chargedSpecies;
759 if (spec->input.hasKey(
"Debye-Huckel")) {
760 auto& dhNode = spec->input[
"Debye-Huckel"].as<
AnyMap>();
761 Aionic = dhNode.
convert(
"ionic-radius",
"m", NAN);
762 if (dhNode.hasKey(
"weak-acid-charge")) {
763 stoichCharge = dhNode[
"weak-acid-charge"].asDouble();
764 if (fabs(stoichCharge - spec->charge) > 0.0001) {
765 est = cEST_weakAcidAssociated;
769 if (dhNode.hasKey(
"electrolyte-species-type")) {
770 est =
interp_est(dhNode[
"electrolyte-species-type"].asString());
790 const static double npActCoeff[] = {0.1127, -0.01049, 1.545E-3};
791 double I2 = IionicMolality * IionicMolality;
793 npActCoeff[0] * IionicMolality +
795 npActCoeff[2] * I2 * IionicMolality;
796 return pow(10.0 , l10actCoeff);
801 const double a0 = 1.454;
802 const double b0 = 0.02236;
803 const double c0 = 9.380E-3;
804 const double d0 = -5.362E-4;
809 double Is2 = Is * Is;
810 double bhat = 1.0 + a0 * sqrt(Is);
811 double func = bhat - 2.0 * log(bhat) - 1.0/bhat;
812 double v1 =
m_A_Debye / (a0 * a0 * a0 * Is) * func;
813 double oc = 1.0 - v1 + b0 * Is / 2.0 + 2.0 * c0 * Is2 / 3.0
814 + 3.0 * d0 * Is2 * Is / 4.0;
824 for (
size_t k = 1; k <
m_kk; k++) {
835 double z_k, zs_k1, zs_k2;
846 for (
size_t k = 0; k <
m_kk; k++) {
855 for (
size_t k = 0; k <
m_kk; k++) {
877 xmolSolvent = std::max(8.689E-3, xmolSolvent);
880 double ac_nonPolar = 1.0;
884 double lnActivitySolvent = 0.0;
887 double y, yp1, sigma;
889 case DHFORM_DILUTE_LIMIT:
890 for (
size_t k = 0; k <
m_kk; k++) {
895 (xmolSolvent - 1.0)/xmolSolvent +
902 for (
size_t k = 0; k <
m_kk; k++) {
904 if (est == cEST_nonpolarNeutral) {
909 - z_k * z_k * numTmp / (1.0 + denomTmp *
m_Aionic[k])
914 lnActivitySolvent = (xmolSolvent - 1.0)/xmolSolvent;
918 if (denomTmp > 0.0) {
919 for (
size_t k = 0; k <
m_kk; k++) {
923 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
929 lnActivitySolvent += coeff * tmp;
931 for (
size_t k = 1; k <
m_kk; k++) {
947 case DHFORM_BDOT_ACOMMON:
949 for (
size_t k = 0; k <
m_kk; k++) {
952 - z_k * z_k * numTmp / (1.0 + denomTmp)
955 if (denomTmp > 0.0) {
958 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
963 (xmolSolvent - 1.0)/xmolSolvent +
967 for (
size_t k = 1; k <
m_kk; k++) {
981 (xmolSolvent - 1.0)/xmolSolvent;
983 for (
size_t k = 1; k <
m_kk; k++) {
986 - z_k * z_k * numTmp / (1.0 + denomTmp);
987 for (
size_t j = 0; j <
m_kk; j++) {
992 if (denomTmp > 0.0) {
995 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 -2.0*log(yp1));
1000 (xmolSolvent - 1.0)/xmolSolvent +
1004 for (
size_t k = 0; k <
m_kk; k++) {
1005 for (
size_t j = 0; j <
m_kk; j++) {
1013 case DHFORM_PITZER_BETAIJ:
1017 tmpLn = log(1.0 + denomTmp);
1018 for (
size_t k = 1; k <
m_kk; k++) {
1021 - z_k * z_k * numTmp / 3.0 / (1.0 + denomTmp);
1025 for (
size_t j = 0; j <
m_kk; j++) {
1030 sigma = 1.0 / (1.0 + denomTmp);
1032 (xmolSolvent - 1.0)/xmolSolvent +
1036 for (
size_t k = 0; k <
m_kk; k++) {
1037 for (
size_t j = 0; j <
m_kk; j++) {
1046 throw CanteraError(
"DebyeHuckel::s_update_lnMolalityActCoeff",
"ERROR");
1058 double z_k, coeff, tmp, y, yp1, sigma, tmpLn;
1062 for (
size_t k = 0; k <
m_kk; k++) {
1070 xmolSolvent = std::max(8.689E-3, xmolSolvent);
1072 double numdAdTTmp = dAdT * sqrtI;
1074 double d_lnActivitySolvent_dT = 0;
1077 case DHFORM_DILUTE_LIMIT:
1078 for (
size_t k = 1; k <
m_kk; k++) {
1082 d_lnActivitySolvent_dT = 2.0 / 3.0 * dAdT *
m_Mnaught *
1087 case DHFORM_BDOT_AK:
1088 for (
size_t k = 0; k <
m_kk; k++) {
1091 - z_k * z_k * numdAdTTmp / (1.0 + denomTmp *
m_Aionic[k]);
1095 coeff = 2.0 / 3.0 * dAdT *
m_Mnaught * sqrtI;
1097 if (denomTmp > 0.0) {
1098 for (
size_t k = 0; k <
m_kk; k++) {
1101 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1109 case DHFORM_BDOT_ACOMMON:
1111 for (
size_t k = 0; k <
m_kk; k++) {
1114 - z_k * z_k * numdAdTTmp / (1.0 + denomTmp);
1116 if (denomTmp > 0.0) {
1119 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1129 for (
size_t k = 1; k <
m_kk; k++) {
1133 if (denomTmp > 0.0) {
1136 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1144 case DHFORM_PITZER_BETAIJ:
1146 tmpLn = log(1.0 + denomTmp);
1147 for (
size_t k = 1; k <
m_kk; k++) {
1150 - z_k * z_k * numdAdTTmp / (1.0 + denomTmp)
1155 sigma = 1.0 / (1.0 + denomTmp);
1161 throw CanteraError(
"DebyeHuckel::s_update_dlnMolalityActCoeff_dT",
1168 double z_k, coeff, tmp, y, yp1, sigma, tmpLn;
1171 if (d2AdT2 == 0.0 && dAdT == 0.0) {
1172 for (
size_t k = 0; k <
m_kk; k++) {
1180 xmolSolvent = std::max(8.689E-3, xmolSolvent);
1182 double numd2AdT2Tmp = d2AdT2 * sqrtI;
1186 case DHFORM_DILUTE_LIMIT:
1187 for (
size_t k = 0; k <
m_kk; k++) {
1193 case DHFORM_BDOT_AK:
1194 for (
size_t k = 0; k <
m_kk; k++) {
1197 - z_k * z_k * numd2AdT2Tmp / (1.0 + denomTmp *
m_Aionic[k]);
1201 coeff = 2.0 / 3.0 * d2AdT2 *
m_Mnaught * sqrtI;
1203 if (denomTmp > 0.0) {
1204 for (
size_t k = 0; k <
m_kk; k++) {
1207 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1215 case DHFORM_BDOT_ACOMMON:
1217 for (
size_t k = 0; k <
m_kk; k++) {
1220 - z_k * z_k * numd2AdT2Tmp / (1.0 + denomTmp);
1222 if (denomTmp > 0.0) {
1225 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1235 for (
size_t k = 1; k <
m_kk; k++) {
1239 if (denomTmp > 0.0) {
1242 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 -2.0*log(yp1));
1250 case DHFORM_PITZER_BETAIJ:
1252 tmpLn = log(1.0 + denomTmp);
1253 for (
size_t k = 1; k <
m_kk; k++) {
1256 - z_k * z_k * numd2AdT2Tmp / (1.0 + denomTmp)
1261 sigma = 1.0 / (1.0 + denomTmp);
1267 throw CanteraError(
"DebyeHuckel::s_update_d2lnMolalityActCoeff_dT2",
1274 double z_k, coeff, tmp, y, yp1, sigma, tmpLn;
1278 for (
size_t k = 0; k <
m_kk; k++) {
1286 xmolSolvent = std::max(8.689E-3, xmolSolvent);
1288 double numdAdPTmp = dAdP * sqrtI;
1292 case DHFORM_DILUTE_LIMIT:
1293 for (
size_t k = 0; k <
m_kk; k++) {
1299 case DHFORM_BDOT_AK:
1300 for (
size_t k = 0; k <
m_kk; k++) {
1302 if (est == cEST_nonpolarNeutral) {
1307 - z_k * z_k * numdAdPTmp / (1.0 + denomTmp *
m_Aionic[k]);
1312 coeff = 2.0 / 3.0 * dAdP *
m_Mnaught * sqrtI;
1314 if (denomTmp > 0.0) {
1315 for (
size_t k = 0; k <
m_kk; k++) {
1318 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1326 case DHFORM_BDOT_ACOMMON:
1328 for (
size_t k = 0; k <
m_kk; k++) {
1331 - z_k * z_k * numdAdPTmp / (1.0 + denomTmp);
1333 if (denomTmp > 0.0) {
1336 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1347 for (
size_t k = 1; k <
m_kk; k++) {
1351 if (denomTmp > 0.0) {
1354 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1362 case DHFORM_PITZER_BETAIJ:
1364 tmpLn = log(1.0 + denomTmp);
1365 for (
size_t k = 1; k <
m_kk; k++) {
1368 - z_k * z_k * numdAdPTmp / (1.0 + denomTmp)
1369 - 2.0 * z_k * z_k * dAdP * tmpLn
1374 sigma = 1.0 / (1.0 + denomTmp);
1380 throw CanteraError(
"DebyeHuckel::s_update_dlnMolalityActCoeff_dP",
vector_fp m_lnActCoeffMolal
Logarithm of the activity coefficients on the molality scale.
void s_update_dlnMolalityActCoeff_dT() const
Calculation of temperature derivative of activity coefficient.
bool hasAttrib(const std::string &a) const
Tests whether the current node has an attribute with a particular name.
virtual doublereal pressure() const
Returns the current pressure of the phase.
PDSS_Water * m_waterSS
Pointer to the Water standard state object.
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
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...
void s_update_d2lnMolalityActCoeff_dT2() const
Calculate the temperature 2nd derivative of the activity coefficient.
virtual bool addSpecies(shared_ptr< Species > spec)
virtual doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
double AionicRadius(int k=0) const
Reports the ionic radius of the kth species.
const double SmallNumber
smallest number to compare to zero.
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...
static int interp_est(const std::string &estString)
Utility function to assign an integer value from a string for the ElectrolyteSpeciesType field.
double convert(const std::string &key, const std::string &units) const
Convert the item stored by the given key to the units specified in units.
virtual void calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
virtual void getPartialMolarCp(doublereal *cpbar) const
Return an array of partial molar heat capacities for the species in the mixture.
std::string id() const
Return the id attribute, if present.
doublereal meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
bool hasKey(const std::string &key) const
Returns true if the map contains an item named key.
void setA_Debye(double A)
Set the A_Debye parameter.
double m_IionicMolality
Current value of the ionic strength on the molality scale.
void assignDensity(const double density_)
Set the internally stored constant density (kg/m^3) of the phase.
virtual void getMolalityActivityCoefficients(doublereal *acMolality) const
Get the array of non-dimensional molality-based activity coefficients at the current solution tempera...
vector_fp m_speciesCharge_Stoich
Stoichiometric species charge -> This is for calculations of the ionic strength which ignore ion-ion ...
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
std::string attrib(const std::string &attr) const
Function returns the value of an attribute.
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))
virtual void getActivities(doublereal *ac) const
Get the array of non-dimensional activities at the current solution temperature, pressure,...
vector_fp m_dlnActCoeffMolaldP
Derivative of log act coeff wrt P.
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
vector_int m_electrolyteSpeciesType
Vector containing the electrolyte species type.
double m_B_Debye
Current value of the constant that appears in the denominator.
double moleFraction(size_t k) const
Return the mole fraction of a single species.
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
virtual void setMolarDensity(const doublereal conc)
Set the internally stored molar density (kmol/m^3) of the phase.
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...
virtual void initThermo()
void calcMolalities() const
Calculates the molality of all species and stores the result internally.
double _lnactivityWaterHelgesonFixedForm() const
Formula for the log of the water activity that occurs in the GWB.
void resize(size_t n, size_t m, doublereal v=0.0)
Resize the array, and fill the new entries with 'v'.
virtual void setStateFromXML(const XML_Node &state)
Set equation of state parameter values from XML entries.
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
vector_fp m_d2lnActCoeffMolaldT2
2nd Derivative of log act coeff wrt T
size_t m_kk
Number of species in the phase.
doublereal charge(size_t k) const
Dimensionless electrical charge of a single molecule of species k The charge is normalized by the the...
vector_fp m_tmpV
vector of size m_kk, used as a temporary holding area.
AnyMap m_input
Data supplied via setParameters.
virtual double density() const
Density (kg/m^3).
virtual doublereal density() const
Return the standard state density at standard state.
doublereal & value(size_t i, size_t j)
Returns a changeable reference to position in the matrix.
double m_densWaterSS
Storage for the density of water's standard state.
virtual doublereal gibbs_mole() const
Molar Gibbs function. Units: J/kmol.
int m_form_A_Debye
Form of the constant outside the Debye-Huckel term called A.
virtual bool addSpecies(shared_ptr< Species > spec)
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
virtual doublereal molarVolume() const
Return the molar volume at standard state.
vector_fp m_dlnActCoeffMolaldT
Derivative of log act coeff wrt T.
size_t speciesIndex(const std::string &name) const
Returns the index of a species named 'name' within the Phase object.
Class XML_Node is a tree-based representation of the contents of an XML file.
virtual void initThermo()
bool caseInsensitiveEquals(const std::string &input, const std::string &test)
Case insensitive equality predicate.
void setDefaultIonicRadius(double value)
Set the default ionic radius [m] for each species.
doublereal RT() const
Return the Gas Constant multiplied by the current temperature.
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
vector_fp m_speciesCharge
Vector of species charges. length m_kk.
virtual void initThermoFile(const std::string &inputFile, const std::string &id)
The WaterProps class is used to house several approximation routines for properties of water.
double _osmoticCoeffHelgesonFixedForm() const
Formula for the osmotic coefficient that occurs in the GWB.
void setDebyeHuckelModel(const std::string &form)
Set the DebyeHuckel parameterization form.
doublereal m_Mnaught
This is the multiplication factor that goes inside log expressions involving the molalities of specie...
static double _nonpolarActCoeff(double IionicMolality)
Static function that implements the non-polar species salt-out modifications.
double m_IionicMolalityStoich
Stoichiometric ionic strength on the molality scale.
void setBeta(const std::string &sp1, const std::string &sp2, double value)
Set the value for the beta interaction between species sp1 and sp2.
virtual doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
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" ...
vector_fp m_molalities
Current value of the molalities of the species in the phase.
doublereal temperature() const
Temperature (K).
bool m_useHelgesonFixedForm
If true, then the fixed for of Helgeson's activity for water is used instead of the rigorous form obt...
std::unique_ptr< WaterProps > m_waterProps
Pointer to the water property calculator.
size_t nSpecies() const
Returns the number of species in the phase.
doublereal getFloat(const XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
doublereal mean_X(const doublereal *const Q) const
Evaluate the mole-fraction-weighted mean of an array Q.
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
DebyeHuckel()
Default Constructor.
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...
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.
A map of string keys to values whose type can vary at runtime.
double molarDensity() const
Molar density (kmol/m^3).
const double GasConstant
Universal Gas Constant [J/kmol/K].
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 rho)
Set the internally stored density (gm/m^3) of the phase.
Base class for exceptions thrown by Cantera classes.
void importPhase(XML_Node &phase, ThermoPhase *th)
Import a phase information into an empty ThermoPhase object.
const std::vector< std::string > & speciesNames() const
Return a const reference to the vector of species names.
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.
const size_t npos
index returned by functions to indicate "no position"
void s_update_dlnMolalityActCoeff_dP() const
Calculate the pressure derivative of the activity coefficient.
void s_update_lnMolalityActCoeff() const
Calculate the log activity coefficients.
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.
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
shared_ptr< Species > species(const std::string &name) const
Return the Species object for the named species.
Namespace for the Cantera kernel.
virtual void getStandardChemPotentials(doublereal *mu) const
Get the array of chemical potentials at unit activity for the species at their standard states at the...
vector_fp m_Aionic
a_k = Size of the ionic species in the DH formulation. units = meters
vector_fp m_B_Dot
Array of B_Dot values.
doublereal fpValue(const std::string &val)
Translate a string into one doublereal value.
const int cEST_solvent
Electrolyte species type.
Class for pressure dependent standard states that use a constant volume model.
XML_Node & child(const size_t n) const
Return a changeable reference to the n'th child of the current node.
double m_maxIionicStrength
Maximum value of the ionic strength allowed in the calculation of the activity coefficients.
Class for the liquid water pressure dependent standard state.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
int m_formDH
form of the Debye-Huckel parameterization used in the model.