28double A_Debye_default = 1.172576;
29double B_Debye_default = 3.28640E9;
30double maxIionicStrength_default = 30.0;
34 : m_maxIionicStrength(maxIionicStrength_default)
35 , m_A_Debye(A_Debye_default)
36 , m_B_Debye(B_Debye_default)
41DebyeHuckel::~DebyeHuckel()
92 for (
size_t k = 0; k <
m_kk; k++) {
100 return 1.0 / mvSolvent;
110 for (
size_t k = 1; k <
m_kk; k++) {
123 for (
size_t k = 0; k <
m_kk; k++) {
124 acMolality[k] = exp(acMolality[k]);
142 for (
size_t k = 1; k <
m_kk; k++) {
156 for (
size_t k = 0; k <
m_kk; k++) {
169 for (
size_t k = 0; k <
m_kk; k++) {
182 for (
size_t k = 0; k <
m_kk; k++) {
193 for (
size_t k = 1; k <
m_kk; k++) {
207 for (
size_t k = 0; k <
m_kk; k++) {
220 for (
size_t k = 0; k <
m_kk; k++) {
228 for (
size_t k = 0; k <
m_kk; k++) {
242 for (
size_t k = 0; k <
m_kk; k++) {
260 }
else if (estString ==
"charged-species"
262 return cEST_chargedSpecies;
263 }
else if (estString ==
"weak-acid-associated"
265 return cEST_weakAcidAssociated;
266 }
else if (estString ==
"strong-acid-associated"
268 return cEST_strongAcidAssociated;
269 }
else if (estString ==
"polar-neutral"
271 return cEST_polarNeutral;
272 }
else if (estString ==
"nonpolar-neutral"
274 return cEST_nonpolarNeutral;
277 "Invalid electrolyte species type '{}'", estString);
283 || model ==
"dilute-limit"
286 }
else if (model ==
"B-dot-with-variable-a"
289 }
else if (model ==
"B-dot-with-common-a"
295 }
else if (model ==
"Pitzer-with-beta_ij"
301 "Unknown model '{}'", model);
315void DebyeHuckel::setB_dot(
double bdot)
320 "B_dot entry in the wrong DH form");
323 for (
size_t k = 0; k <
nSpecies(); k++) {
324 if (fabs(
charge(k)) > 0.0001) {
335 for (
size_t k = 0; k <
m_kk; k++) {
346 throw CanteraError(
"DebyeHuckel::setBeta",
"Species '{}' not found", sp1);
350 throw CanteraError(
"DebyeHuckel::setBeta",
"Species '{}' not found", sp2);
362 if (node.hasKey(
"A_Debye")) {
363 if (node[
"A_Debye"] ==
"variable") {
366 setA_Debye(node.convert(
"A_Debye",
"kg^0.5/gmol^0.5"));
369 if (node.hasKey(
"B_Debye")) {
370 setB_Debye(node.convert(
"B_Debye",
"kg^0.5/gmol^0.5/m"));
372 if (node.hasKey(
"max-ionic-strength")) {
373 setMaxIonicStrength(node[
"max-ionic-strength"].asDouble());
375 if (node.hasKey(
"use-Helgeson-fixed-form")) {
376 useHelgesonFixedForm(node[
"use-Helgeson-fixed-form"].asBool());
378 if (node.hasKey(
"default-ionic-radius")) {
381 if (node.hasKey(
"B-dot")) {
382 setB_dot(node[
"B-dot"].asDouble());
384 if (node.hasKey(
"beta")) {
385 for (
auto& item : node[
"beta"].asVector<
AnyMap>()) {
386 auto&
species = item[
"species"].asVector<
string>(2);
400 }
else if (
dynamic_cast<PDSS_ConstVol*
>(providePDSS(0)) == 0) {
401 throw CanteraError(
"DebyeHuckel::initThermo",
"Solvent standard state"
402 " model must be WaterIAPWS or constant_incompressible.");
406 for (
size_t k = 1; k <
nSpecies(); k++) {
408 throw CanteraError(
"DebyeHuckel::initThermo",
"Solute standard"
409 " state model must be constant_incompressible.");
420 case DHFORM_DILUTE_LIMIT:
421 activityNode[
"model"] =
"dilute-limit";
424 activityNode[
"model"] =
"B-dot-with-variable-a";
426 case DHFORM_BDOT_ACOMMON:
427 activityNode[
"model"] =
"B-dot-with-common-a";
430 activityNode[
"model"] =
"beta_ij";
432 case DHFORM_PITZER_BETAIJ:
433 activityNode[
"model"] =
"Pitzer-with-beta_ij";
438 activityNode[
"A_Debye"] =
"variable";
439 }
else if (
m_A_Debye != A_Debye_default) {
440 activityNode[
"A_Debye"].setQuantity(
m_A_Debye,
"kg^0.5/gmol^0.5");
444 activityNode[
"B_Debye"].setQuantity(
m_B_Debye,
"kg^0.5/gmol^0.5/m");
450 activityNode[
"use-Helgeson-fixed-form"] =
true;
457 activityNode[
"B-dot"] = B_dot;
463 for (
size_t i = 0; i <
m_kk; i++) {
464 for (
size_t j = i; j <
m_kk; j++) {
467 entry[
"species"] = vector<string>{
470 beta.push_back(std::move(entry));
474 activityNode[
"beta"] = std::move(beta);
476 phaseNode[
"activity-data"] = std::move(activityNode);
486 dhNode[
"ionic-radius"].setQuantity(
m_Aionic[k],
"m");
489 int estDefault = cEST_nonpolarNeutral;
496 estDefault = cEST_weakAcidAssociated;
497 }
else if (fabs(
charge(k)) > 0.0001) {
498 estDefault = cEST_chargedSpecies;
507 case cEST_chargedSpecies:
508 estType =
"charged-species";
510 case cEST_weakAcidAssociated:
511 estType =
"weak-acid-associated";
513 case cEST_strongAcidAssociated:
514 estType =
"strong-acid-associated";
516 case cEST_polarNeutral:
517 estType =
"polar-neutral";
519 case cEST_nonpolarNeutral:
520 estType =
"nonpolar-neutral";
524 "Unknown electrolyte species type ({}) for species '{}'",
527 dhNode[
"electrolyte-species-type"] = estType;
531 speciesNode[
"Debye-Huckel"] = std::move(dhNode);
540 if (tempArg != -1.0) {
544 if (presArg != -1.0) {
557 throw CanteraError(
"DebyeHuckel::A_Debye_TP",
"shouldn't be here");
565 if (tempArg != -1.0) {
569 if (presArg != -1.0) {
581 throw CanteraError(
"DebyeHuckel::dA_DebyedT_TP",
"shouldn't be here");
589 if (tempArg != -1.0) {
593 if (presArg != -1.0) {
605 throw CanteraError(
"DebyeHuckel::d2A_DebyedT2_TP",
"shouldn't be here");
613 if (tempArg != -1.0) {
617 if (presArg != -1.0) {
629 throw CanteraError(
"DebyeHuckel::dA_DebyedP_TP",
"shouldn't be here");
658 int est = cEST_nonpolarNeutral;
659 double stoichCharge = spec->charge;
660 if (fabs(spec->charge) > 0.0001) {
661 est = cEST_chargedSpecies;
664 if (spec->input.hasKey(
"Debye-Huckel")) {
665 auto& dhNode = spec->input[
"Debye-Huckel"].as<
AnyMap>();
666 Aionic = dhNode.
convert(
"ionic-radius",
"m", NAN);
667 if (dhNode.hasKey(
"weak-acid-charge")) {
668 stoichCharge = dhNode[
"weak-acid-charge"].asDouble();
669 if (fabs(stoichCharge - spec->charge) > 0.0001) {
670 est = cEST_weakAcidAssociated;
674 if (dhNode.hasKey(
"electrolyte-species-type")) {
675 est =
interp_est(dhNode[
"electrolyte-species-type"].asString());
695 const static double npActCoeff[] = {0.1127, -0.01049, 1.545E-3};
696 double I2 = IionicMolality * IionicMolality;
698 npActCoeff[0] * IionicMolality +
700 npActCoeff[2] * I2 * IionicMolality;
701 return pow(10.0 , l10actCoeff);
706 const double a0 = 1.454;
707 const double b0 = 0.02236;
708 const double c0 = 9.380E-3;
709 const double d0 = -5.362E-4;
714 double Is2 = Is * Is;
715 double bhat = 1.0 + a0 * sqrt(Is);
716 double func = bhat - 2.0 * log(bhat) - 1.0/bhat;
717 double v1 =
m_A_Debye / (a0 * a0 * a0 * Is) * func;
718 double oc = 1.0 - v1 + b0 * Is / 2.0 + 2.0 * c0 * Is2 / 3.0
719 + 3.0 * d0 * Is2 * Is / 4.0;
729 for (
size_t k = 1; k <
m_kk; k++) {
740 double z_k, zs_k1, zs_k2;
751 for (
size_t k = 0; k <
m_kk; k++) {
760 for (
size_t k = 0; k <
m_kk; k++) {
782 xmolSolvent = std::max(8.689E-3, xmolSolvent);
785 double ac_nonPolar = 1.0;
789 double lnActivitySolvent = 0.0;
792 double y, yp1, sigma;
794 case DHFORM_DILUTE_LIMIT:
795 for (
size_t k = 0; k <
m_kk; k++) {
800 (xmolSolvent - 1.0)/xmolSolvent +
807 for (
size_t k = 0; k <
m_kk; k++) {
809 if (est == cEST_nonpolarNeutral) {
814 - z_k * z_k * numTmp / (1.0 + denomTmp *
m_Aionic[k])
819 lnActivitySolvent = (xmolSolvent - 1.0)/xmolSolvent;
823 if (denomTmp > 0.0) {
824 for (
size_t k = 0; k <
m_kk; k++) {
828 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
834 lnActivitySolvent += coeff * tmp;
836 for (
size_t k = 1; k <
m_kk; k++) {
852 case DHFORM_BDOT_ACOMMON:
854 for (
size_t k = 0; k <
m_kk; k++) {
857 - z_k * z_k * numTmp / (1.0 + denomTmp)
860 if (denomTmp > 0.0) {
863 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
868 (xmolSolvent - 1.0)/xmolSolvent +
872 for (
size_t k = 1; k <
m_kk; k++) {
886 (xmolSolvent - 1.0)/xmolSolvent;
888 for (
size_t k = 1; k <
m_kk; k++) {
891 - z_k * z_k * numTmp / (1.0 + denomTmp);
892 for (
size_t j = 0; j <
m_kk; j++) {
897 if (denomTmp > 0.0) {
900 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 -2.0*log(yp1));
905 (xmolSolvent - 1.0)/xmolSolvent +
909 for (
size_t k = 0; k <
m_kk; k++) {
910 for (
size_t j = 0; j <
m_kk; j++) {
918 case DHFORM_PITZER_BETAIJ:
922 tmpLn = log(1.0 + denomTmp);
923 for (
size_t k = 1; k <
m_kk; k++) {
926 - z_k * z_k * numTmp / 3.0 / (1.0 + denomTmp);
930 for (
size_t j = 0; j <
m_kk; j++) {
935 sigma = 1.0 / (1.0 + denomTmp);
937 (xmolSolvent - 1.0)/xmolSolvent +
941 for (
size_t k = 0; k <
m_kk; k++) {
942 for (
size_t j = 0; j <
m_kk; j++) {
951 throw CanteraError(
"DebyeHuckel::s_update_lnMolalityActCoeff",
"ERROR");
963 double z_k, coeff, tmp, y, yp1, sigma, tmpLn;
967 for (
size_t k = 0; k <
m_kk; k++) {
975 xmolSolvent = std::max(8.689E-3, xmolSolvent);
977 double numdAdTTmp = dAdT * sqrtI;
979 double d_lnActivitySolvent_dT = 0;
982 case DHFORM_DILUTE_LIMIT:
983 for (
size_t k = 1; k <
m_kk; k++) {
987 d_lnActivitySolvent_dT = 2.0 / 3.0 * dAdT *
m_Mnaught *
993 for (
size_t k = 0; k <
m_kk; k++) {
996 - z_k * z_k * numdAdTTmp / (1.0 + denomTmp *
m_Aionic[k]);
1000 coeff = 2.0 / 3.0 * dAdT *
m_Mnaught * sqrtI;
1002 if (denomTmp > 0.0) {
1003 for (
size_t k = 0; k <
m_kk; k++) {
1006 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1014 case DHFORM_BDOT_ACOMMON:
1016 for (
size_t k = 0; k <
m_kk; k++) {
1019 - z_k * z_k * numdAdTTmp / (1.0 + denomTmp);
1021 if (denomTmp > 0.0) {
1024 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1034 for (
size_t k = 1; k <
m_kk; k++) {
1038 if (denomTmp > 0.0) {
1041 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1049 case DHFORM_PITZER_BETAIJ:
1051 tmpLn = log(1.0 + denomTmp);
1052 for (
size_t k = 1; k <
m_kk; k++) {
1055 - z_k * z_k * numdAdTTmp / (1.0 + denomTmp)
1060 sigma = 1.0 / (1.0 + denomTmp);
1066 throw CanteraError(
"DebyeHuckel::s_update_dlnMolalityActCoeff_dT",
1073 double z_k, coeff, tmp, y, yp1, sigma, tmpLn;
1076 if (d2AdT2 == 0.0 && dAdT == 0.0) {
1077 for (
size_t k = 0; k <
m_kk; k++) {
1085 xmolSolvent = std::max(8.689E-3, xmolSolvent);
1087 double numd2AdT2Tmp = d2AdT2 * sqrtI;
1091 case DHFORM_DILUTE_LIMIT:
1092 for (
size_t k = 0; k <
m_kk; k++) {
1098 case DHFORM_BDOT_AK:
1099 for (
size_t k = 0; k <
m_kk; k++) {
1102 - z_k * z_k * numd2AdT2Tmp / (1.0 + denomTmp *
m_Aionic[k]);
1106 coeff = 2.0 / 3.0 * d2AdT2 *
m_Mnaught * sqrtI;
1108 if (denomTmp > 0.0) {
1109 for (
size_t k = 0; k <
m_kk; k++) {
1112 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1120 case DHFORM_BDOT_ACOMMON:
1122 for (
size_t k = 0; k <
m_kk; k++) {
1125 - z_k * z_k * numd2AdT2Tmp / (1.0 + denomTmp);
1127 if (denomTmp > 0.0) {
1130 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1140 for (
size_t k = 1; k <
m_kk; k++) {
1144 if (denomTmp > 0.0) {
1147 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 -2.0*log(yp1));
1155 case DHFORM_PITZER_BETAIJ:
1157 tmpLn = log(1.0 + denomTmp);
1158 for (
size_t k = 1; k <
m_kk; k++) {
1161 - z_k * z_k * numd2AdT2Tmp / (1.0 + denomTmp)
1166 sigma = 1.0 / (1.0 + denomTmp);
1172 throw CanteraError(
"DebyeHuckel::s_update_d2lnMolalityActCoeff_dT2",
1179 double z_k, coeff, tmp, y, yp1, sigma, tmpLn;
1183 for (
size_t k = 0; k <
m_kk; k++) {
1191 xmolSolvent = std::max(8.689E-3, xmolSolvent);
1193 double numdAdPTmp = dAdP * sqrtI;
1197 case DHFORM_DILUTE_LIMIT:
1198 for (
size_t k = 0; k <
m_kk; k++) {
1204 case DHFORM_BDOT_AK:
1205 for (
size_t k = 0; k <
m_kk; k++) {
1207 if (est == cEST_nonpolarNeutral) {
1212 - z_k * z_k * numdAdPTmp / (1.0 + denomTmp *
m_Aionic[k]);
1217 coeff = 2.0 / 3.0 * dAdP *
m_Mnaught * sqrtI;
1219 if (denomTmp > 0.0) {
1220 for (
size_t k = 0; k <
m_kk; k++) {
1223 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1231 case DHFORM_BDOT_ACOMMON:
1233 for (
size_t k = 0; k <
m_kk; k++) {
1236 - z_k * z_k * numdAdPTmp / (1.0 + denomTmp);
1238 if (denomTmp > 0.0) {
1241 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1252 for (
size_t k = 1; k <
m_kk; k++) {
1256 if (denomTmp > 0.0) {
1259 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1267 case DHFORM_PITZER_BETAIJ:
1269 tmpLn = log(1.0 + denomTmp);
1270 for (
size_t k = 1; k <
m_kk; k++) {
1273 - z_k * z_k * numdAdPTmp / (1.0 + denomTmp)
1274 - 2.0 * z_k * z_k * dAdP * tmpLn
1279 sigma = 1.0 / (1.0 + denomTmp);
1285 throw CanteraError(
"DebyeHuckel::s_update_dlnMolalityActCoeff_dP",
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.
size_t size() const
Returns the number of elements in this map.
bool hasKey(const string &key) const
Returns true if the map contains an item named key.
double convert(const string &key, const string &units) const
Convert the item stored by the given key to the units specified in units.
size_t nRows() const
Number of rows.
size_t nColumns() const
Number of columns.
double & value(size_t i, size_t j)
Returns a changeable reference to position in the matrix.
virtual void resize(size_t n, size_t m, double v=0.0)
Resize the array, and fill the new entries with 'v'.
Base class for exceptions thrown by Cantera classes.
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...
double enthalpy_mole() const override
Molar enthalpy. Units: J/kmol.
unique_ptr< WaterProps > m_waterProps
Pointer to the water property calculator.
int m_formDH
form of the Debye-Huckel parameterization used in the model.
DebyeHuckel(const string &inputFile="", const string &id="")
Full constructor for creating the phase.
double m_A_Debye
Current value of the Debye Constant, A_Debye.
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...
void getPartialMolarEnthalpies(double *hbar) const override
Returns an array of partial molar enthalpies for the species in the mixture.
void getChemPotentials(double *mu) const override
Get the species chemical potentials. Units: J/kmol.
vector< double > m_B_Dot
Array of B_Dot values.
double m_IionicMolality
Current value of the ionic strength on the molality scale.
double _osmoticCoeffHelgesonFixedForm() const
Formula for the osmotic coefficient that occurs in the GWB.
double m_densWaterSS
Storage for the density of water's standard state.
void s_update_d2lnMolalityActCoeff_dT2() const
Calculate the temperature 2nd derivative of the activity coefficient.
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...
int m_form_A_Debye
Form of the constant outside the Debye-Huckel term called A.
bool m_useHelgesonFixedForm
If true, then the fixed for of Helgeson's activity for water is used instead of the rigorous form obt...
static double _nonpolarActCoeff(double IionicMolality)
Static function that implements the non-polar species salt-out modifications.
vector< int > m_electrolyteSpeciesType
Vector containing the electrolyte species type.
double m_B_Debye
Current value of the constant that appears in the denominator.
void getParameters(AnyMap &phaseNode) const override
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
double AionicRadius(int k=0) const
Reports the ionic radius of the kth species.
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
vector< double > m_tmpV
vector of size m_kk, used as a temporary holding area.
void getActivityConcentrations(double *c) const override
This method returns an array of generalized concentrations.
void s_update_dlnMolalityActCoeff_dT() const
Calculation of temperature derivative of activity coefficient.
void s_update_lnMolalityActCoeff() const
Calculate the log activity coefficients.
vector< double > m_Aionic
a_k = Size of the ionic species in the DH formulation. units = meters
void getPartialMolarVolumes(double *vbar) const override
Return an array of partial molar volumes for the species in the mixture.
void setA_Debye(double A)
Set the A_Debye parameter.
double entropy_mole() const override
Molar entropy. Units: J/kmol/K.
void calcDensity() override
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
vector< double > m_dlnActCoeffMolaldT
Derivative of log act coeff wrt T.
double m_Aionic_default
Default ionic radius for species where it is not specified.
void setDebyeHuckelModel(const string &form)
Set the DebyeHuckel parameterization form.
vector< double > m_speciesCharge_Stoich
Stoichiometric species charge -> This is for calculations of the ionic strength which ignore ion-ion ...
double m_maxIionicStrength
Maximum value of the ionic strength allowed in the calculation of the activity coefficients.
double _lnactivityWaterHelgesonFixedForm() const
Formula for the log of the water activity that occurs in the GWB.
void setBeta(const string &sp1, const string &sp2, double value)
Set the value for the beta interaction between species sp1 and sp2.
double cp_mole() const override
Molar heat capacity at constant pressure. Units: J/kmol/K.
void getActivities(double *ac) const override
Get the array of non-dimensional activities at the current solution temperature, pressure,...
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.
void getPartialMolarCp(double *cpbar) const override
Return an array of partial molar heat capacities for the species in the mixture.
void setDefaultIonicRadius(double value)
Set the default ionic radius [m] for each species.
vector< double > m_d2lnActCoeffMolaldT2
2nd Derivative of log act coeff wrt T
double gibbs_mole() const override
Molar Gibbs function. Units: J/kmol.
double standardConcentration(size_t k=0) const override
Return the standard concentration for the kth species.
void s_update_dlnMolalityActCoeff_dP() const
Calculate the pressure derivative of the activity coefficient.
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
PDSS_Water * m_waterSS
Pointer to the Water standard state object.
double m_IionicMolalityStoich
Stoichiometric ionic strength on the molality scale.
vector< double > m_lnActCoeffMolal
Logarithm of the activity coefficients on the molality scale.
vector< double > m_dlnActCoeffMolaldP
Derivative of log act coeff wrt P.
void getMolalityActivityCoefficients(double *acMolality) const override
Get the array of non-dimensional molality-based activity coefficients at the current solution tempera...
void getPartialMolarEntropies(double *sbar) const override
Returns an array of partial molar entropies of the species in the solution.
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 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...
double m_Mnaught
This is the multiplication factor that goes inside log expressions involving the molalities of specie...
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
vector< double > m_molalities
Current value of the molalities of the species in the phase.
void calcMolalities() const
Calculates the molality of all species and stores the result internally.
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
Class for pressure dependent standard states that use a constant volume model.
Class for the liquid water pressure dependent standard state.
double density() const override
Return the standard state density at standard state.
virtual double molarVolume() const
Return the molar volume at standard state.
void assignDensity(const double density_)
Set the internally stored constant density (kg/m^3) of the phase.
void checkSpeciesIndex(size_t k) const
Check that the specified species index is in range.
size_t nSpecies() const
Returns the number of species in the phase.
size_t m_kk
Number of species in the phase.
double temperature() const
Temperature (K).
double meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
string speciesName(size_t k) const
Name of the species with index k.
size_t speciesIndex(const string &name) const
Returns the index of a species named 'name' within the Phase object.
double moleFraction(size_t k) const
Return the mole fraction of a single species.
double mean_X(const double *const Q) const
Evaluate the mole-fraction-weighted mean of an array Q.
shared_ptr< Species > species(const string &name) const
Return the Species object for the named species.
double charge(size_t k) const
Dimensionless electrical charge of a single molecule of species k The charge is normalized by the the...
vector< double > m_speciesCharge
Vector of species charges. length m_kk.
string name() const
Return the name of the phase.
virtual void getParameters(AnyMap &phaseNode) const
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
double RT() const
Return the Gas Constant multiplied by the current temperature.
void initThermoFile(const string &inputFile, const string &id)
Initialize a ThermoPhase object using an input file.
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...
AnyMap m_input
Data supplied via setParameters.
double pressure() const override
Returns the current pressure of the phase.
void getEntropy_R(double *sr) const override
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
virtual void _updateStandardStateThermo() const
Updates the standard state thermodynamic functions at the current T and P of the solution.
void getStandardChemPotentials(double *mu) const override
Get the array of chemical potentials at unit activity for the species at their standard states at the...
void getCp_R(double *cpr) const override
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
void getEnthalpy_RT(double *hrt) const override
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
void getStandardVolumes(double *vol) const override
Get the molar volumes of the species standard states at the current T and P of the solution.
Header file for a common definitions used in electrolytes thermodynamics.
bool caseInsensitiveEquals(const string &input, const string &test)
Case insensitive equality predicate.
const double GasConstant
Universal Gas Constant [J/kmol/K].
Namespace for the Cantera kernel.
const size_t npos
index returned by functions to indicate "no position"
static int interp_est(const string &estString)
Utility function to assign an integer value from a string for the ElectrolyteSpeciesType field.
const double SmallNumber
smallest number to compare to zero.
const int cEST_solvent
Electrolyte species type.
Contains declarations for string manipulation functions within Cantera.