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()
64 for (
size_t k = 0; k <
m_kk; k++) {
72 return 1.0 / mvSolvent;
83 for (
size_t k = 1; k <
m_kk; k++) {
93 acMolality.size(),
m_kk);
98 for (
size_t k = 0; k <
m_kk; k++) {
99 acMolality[k] = exp(acMolality[k]);
117 for (
size_t k = 1; k <
m_kk; k++) {
131 for (
size_t k = 0; k <
m_kk; k++) {
144 for (
size_t k = 0; k <
m_kk; k++) {
157 for (
size_t k = 0; k <
m_kk; k++) {
168 for (
size_t k = 1; k <
m_kk; k++) {
182 for (
size_t k = 0; k <
m_kk; k++) {
195 for (
size_t k = 0; k <
m_kk; k++) {
203 for (
size_t k = 0; k <
m_kk; k++) {
217 for (
size_t k = 0; k <
m_kk; k++) {
235 }
else if (estString ==
"charged-species"
237 return cEST_chargedSpecies;
238 }
else if (estString ==
"weak-acid-associated"
240 return cEST_weakAcidAssociated;
241 }
else if (estString ==
"strong-acid-associated"
243 return cEST_strongAcidAssociated;
244 }
else if (estString ==
"polar-neutral"
246 return cEST_polarNeutral;
247 }
else if (estString ==
"nonpolar-neutral"
249 return cEST_nonpolarNeutral;
252 "Invalid electrolyte species type '{}'", estString);
258 || model ==
"dilute-limit"
261 }
else if (model ==
"B-dot-with-variable-a"
264 }
else if (model ==
"B-dot-with-common-a"
270 }
else if (model ==
"Pitzer-with-beta_ij"
276 "Unknown model '{}'", model);
290void DebyeHuckel::setB_dot(
double bdot)
295 "B_dot entry in the wrong DH form");
298 for (
size_t k = 0; k <
nSpecies(); k++) {
299 if (fabs(
charge(k)) > 0.0001) {
310 for (
size_t k = 0; k <
m_kk; k++) {
331 if (node.hasKey(
"A_Debye")) {
332 if (node[
"A_Debye"] ==
"variable") {
335 setA_Debye(node.convert(
"A_Debye",
"kg^0.5/gmol^0.5"));
338 if (node.hasKey(
"B_Debye")) {
339 setB_Debye(node.convert(
"B_Debye",
"kg^0.5/gmol^0.5/m"));
341 if (node.hasKey(
"max-ionic-strength")) {
342 setMaxIonicStrength(node[
"max-ionic-strength"].asDouble());
344 if (node.hasKey(
"use-Helgeson-fixed-form")) {
345 useHelgesonFixedForm(node[
"use-Helgeson-fixed-form"].asBool());
347 if (node.hasKey(
"default-ionic-radius")) {
350 if (node.hasKey(
"B-dot")) {
351 setB_dot(node[
"B-dot"].asDouble());
353 if (node.hasKey(
"beta")) {
354 for (
auto& item : node[
"beta"].asVector<
AnyMap>()) {
355 auto&
species = item[
"species"].asVector<
string>(2);
369 }
else if (
dynamic_cast<PDSS_ConstVol*
>(providePDSS(0)) == 0) {
370 throw CanteraError(
"DebyeHuckel::initThermo",
"Solvent standard state"
371 " model must be WaterIAPWS or constant_incompressible.");
375 for (
size_t k = 1; k <
nSpecies(); k++) {
377 throw CanteraError(
"DebyeHuckel::initThermo",
"Solute standard"
378 " state model must be constant_incompressible.");
389 case DHFORM_DILUTE_LIMIT:
390 activityNode[
"model"] =
"dilute-limit";
393 activityNode[
"model"] =
"B-dot-with-variable-a";
395 case DHFORM_BDOT_ACOMMON:
396 activityNode[
"model"] =
"B-dot-with-common-a";
399 activityNode[
"model"] =
"beta_ij";
401 case DHFORM_PITZER_BETAIJ:
402 activityNode[
"model"] =
"Pitzer-with-beta_ij";
407 activityNode[
"A_Debye"] =
"variable";
408 }
else if (
m_A_Debye != A_Debye_default) {
409 activityNode[
"A_Debye"].setQuantity(
m_A_Debye,
"kg^0.5/gmol^0.5");
413 activityNode[
"B_Debye"].setQuantity(
m_B_Debye,
"kg^0.5/gmol^0.5/m");
419 activityNode[
"use-Helgeson-fixed-form"] =
true;
426 activityNode[
"B-dot"] = B_dot;
432 for (
size_t i = 0; i <
m_kk; i++) {
433 for (
size_t j = i; j <
m_kk; j++) {
436 entry[
"species"] = vector<string>{
439 beta.push_back(std::move(entry));
443 activityNode[
"beta"] = std::move(beta);
445 phaseNode[
"activity-data"] = std::move(activityNode);
454 dhNode[
"ionic-radius"].setQuantity(
m_Aionic[k],
"m");
457 int estDefault = cEST_nonpolarNeutral;
464 estDefault = cEST_weakAcidAssociated;
465 }
else if (fabs(
charge(k)) > 0.0001) {
466 estDefault = cEST_chargedSpecies;
475 case cEST_chargedSpecies:
476 estType =
"charged-species";
478 case cEST_weakAcidAssociated:
479 estType =
"weak-acid-associated";
481 case cEST_strongAcidAssociated:
482 estType =
"strong-acid-associated";
484 case cEST_polarNeutral:
485 estType =
"polar-neutral";
487 case cEST_nonpolarNeutral:
488 estType =
"nonpolar-neutral";
492 "Unknown electrolyte species type ({}) for species '{}'",
495 dhNode[
"electrolyte-species-type"] = estType;
499 speciesNode[
"Debye-Huckel"] = std::move(dhNode);
508 if (tempArg != -1.0) {
512 if (presArg != -1.0) {
525 throw CanteraError(
"DebyeHuckel::A_Debye_TP",
"shouldn't be here");
533 if (tempArg != -1.0) {
537 if (presArg != -1.0) {
549 throw CanteraError(
"DebyeHuckel::dA_DebyedT_TP",
"shouldn't be here");
557 if (tempArg != -1.0) {
561 if (presArg != -1.0) {
573 throw CanteraError(
"DebyeHuckel::d2A_DebyedT2_TP",
"shouldn't be here");
581 if (tempArg != -1.0) {
585 if (presArg != -1.0) {
597 throw CanteraError(
"DebyeHuckel::dA_DebyedP_TP",
"shouldn't be here");
625 int est = cEST_nonpolarNeutral;
626 double stoichCharge = spec->charge;
627 if (fabs(spec->charge) > 0.0001) {
628 est = cEST_chargedSpecies;
631 if (spec->input.hasKey(
"Debye-Huckel")) {
632 auto& dhNode = spec->input[
"Debye-Huckel"].as<
AnyMap>();
633 Aionic = dhNode.
convert(
"ionic-radius",
"m", NAN);
634 if (dhNode.hasKey(
"weak-acid-charge")) {
635 stoichCharge = dhNode[
"weak-acid-charge"].asDouble();
636 if (fabs(stoichCharge - spec->charge) > 0.0001) {
637 est = cEST_weakAcidAssociated;
641 if (dhNode.hasKey(
"electrolyte-species-type")) {
642 est =
interp_est(dhNode[
"electrolyte-species-type"].asString());
662 const static double npActCoeff[] = {0.1127, -0.01049, 1.545E-3};
663 double I2 = IionicMolality * IionicMolality;
665 npActCoeff[0] * IionicMolality +
667 npActCoeff[2] * I2 * IionicMolality;
668 return pow(10.0 , l10actCoeff);
673 const double a0 = 1.454;
674 const double b0 = 0.02236;
675 const double c0 = 9.380E-3;
676 const double d0 = -5.362E-4;
681 double Is2 = Is * Is;
682 double bhat = 1.0 + a0 * sqrt(Is);
683 double func = bhat - 2.0 * log(bhat) - 1.0/bhat;
684 double v1 =
m_A_Debye / (a0 * a0 * a0 * Is) * func;
685 double oc = 1.0 - v1 + b0 * Is / 2.0 + 2.0 * c0 * Is2 / 3.0
686 + 3.0 * d0 * Is2 * Is / 4.0;
696 for (
size_t k = 1; k <
m_kk; k++) {
707 double z_k, zs_k1, zs_k2;
718 for (
size_t k = 0; k <
m_kk; k++) {
727 for (
size_t k = 0; k <
m_kk; k++) {
749 xmolSolvent = std::max(8.689E-3, xmolSolvent);
752 double ac_nonPolar = 1.0;
756 double lnActivitySolvent = 0.0;
759 double y, yp1, sigma;
761 case DHFORM_DILUTE_LIMIT:
762 for (
size_t k = 0; k <
m_kk; k++) {
767 (xmolSolvent - 1.0)/xmolSolvent +
774 for (
size_t k = 0; k <
m_kk; k++) {
776 if (est == cEST_nonpolarNeutral) {
781 - z_k * z_k * numTmp / (1.0 + denomTmp *
m_Aionic[k])
786 lnActivitySolvent = (xmolSolvent - 1.0)/xmolSolvent;
790 if (denomTmp > 0.0) {
791 for (
size_t k = 0; k <
m_kk; k++) {
795 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
801 lnActivitySolvent += coeff * tmp;
803 for (
size_t k = 1; k <
m_kk; k++) {
819 case DHFORM_BDOT_ACOMMON:
821 for (
size_t k = 0; k <
m_kk; k++) {
824 - z_k * z_k * numTmp / (1.0 + denomTmp)
827 if (denomTmp > 0.0) {
830 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
835 (xmolSolvent - 1.0)/xmolSolvent +
839 for (
size_t k = 1; k <
m_kk; k++) {
853 (xmolSolvent - 1.0)/xmolSolvent;
855 for (
size_t k = 1; k <
m_kk; k++) {
858 - z_k * z_k * numTmp / (1.0 + denomTmp);
859 for (
size_t j = 0; j <
m_kk; j++) {
864 if (denomTmp > 0.0) {
867 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 -2.0*log(yp1));
872 (xmolSolvent - 1.0)/xmolSolvent +
876 for (
size_t k = 0; k <
m_kk; k++) {
877 for (
size_t j = 0; j <
m_kk; j++) {
885 case DHFORM_PITZER_BETAIJ:
889 tmpLn = log(1.0 + denomTmp);
890 for (
size_t k = 1; k <
m_kk; k++) {
893 - z_k * z_k * numTmp / 3.0 / (1.0 + denomTmp);
897 for (
size_t j = 0; j <
m_kk; j++) {
902 sigma = 1.0 / (1.0 + denomTmp);
904 (xmolSolvent - 1.0)/xmolSolvent +
908 for (
size_t k = 0; k <
m_kk; k++) {
909 for (
size_t j = 0; j <
m_kk; j++) {
918 throw CanteraError(
"DebyeHuckel::s_update_lnMolalityActCoeff",
"ERROR");
930 double z_k, coeff, tmp, y, yp1, sigma, tmpLn;
934 for (
size_t k = 0; k <
m_kk; k++) {
942 xmolSolvent = std::max(8.689E-3, xmolSolvent);
944 double numdAdTTmp = dAdT * sqrtI;
946 double d_lnActivitySolvent_dT = 0;
949 case DHFORM_DILUTE_LIMIT:
950 for (
size_t k = 1; k <
m_kk; k++) {
954 d_lnActivitySolvent_dT = 2.0 / 3.0 * dAdT *
m_Mnaught *
960 for (
size_t k = 0; k <
m_kk; k++) {
963 - z_k * z_k * numdAdTTmp / (1.0 + denomTmp *
m_Aionic[k]);
967 coeff = 2.0 / 3.0 * dAdT *
m_Mnaught * sqrtI;
969 if (denomTmp > 0.0) {
970 for (
size_t k = 0; k <
m_kk; k++) {
973 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
981 case DHFORM_BDOT_ACOMMON:
983 for (
size_t k = 0; k <
m_kk; k++) {
986 - z_k * z_k * numdAdTTmp / (1.0 + denomTmp);
988 if (denomTmp > 0.0) {
991 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1001 for (
size_t k = 1; k <
m_kk; k++) {
1005 if (denomTmp > 0.0) {
1008 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1016 case DHFORM_PITZER_BETAIJ:
1018 tmpLn = log(1.0 + denomTmp);
1019 for (
size_t k = 1; k <
m_kk; k++) {
1022 - z_k * z_k * numdAdTTmp / (1.0 + denomTmp)
1027 sigma = 1.0 / (1.0 + denomTmp);
1033 throw CanteraError(
"DebyeHuckel::s_update_dlnMolalityActCoeff_dT",
1040 double z_k, coeff, tmp, y, yp1, sigma, tmpLn;
1043 if (d2AdT2 == 0.0 && dAdT == 0.0) {
1044 for (
size_t k = 0; k <
m_kk; k++) {
1052 xmolSolvent = std::max(8.689E-3, xmolSolvent);
1054 double numd2AdT2Tmp = d2AdT2 * sqrtI;
1058 case DHFORM_DILUTE_LIMIT:
1059 for (
size_t k = 0; k <
m_kk; k++) {
1065 case DHFORM_BDOT_AK:
1066 for (
size_t k = 0; k <
m_kk; k++) {
1069 - z_k * z_k * numd2AdT2Tmp / (1.0 + denomTmp *
m_Aionic[k]);
1073 coeff = 2.0 / 3.0 * d2AdT2 *
m_Mnaught * sqrtI;
1075 if (denomTmp > 0.0) {
1076 for (
size_t k = 0; k <
m_kk; k++) {
1079 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1087 case DHFORM_BDOT_ACOMMON:
1089 for (
size_t k = 0; k <
m_kk; k++) {
1092 - z_k * z_k * numd2AdT2Tmp / (1.0 + denomTmp);
1094 if (denomTmp > 0.0) {
1097 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1107 for (
size_t k = 1; k <
m_kk; k++) {
1111 if (denomTmp > 0.0) {
1114 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 -2.0*log(yp1));
1122 case DHFORM_PITZER_BETAIJ:
1124 tmpLn = log(1.0 + denomTmp);
1125 for (
size_t k = 1; k <
m_kk; k++) {
1128 - z_k * z_k * numd2AdT2Tmp / (1.0 + denomTmp)
1133 sigma = 1.0 / (1.0 + denomTmp);
1139 throw CanteraError(
"DebyeHuckel::s_update_d2lnMolalityActCoeff_dT2",
1146 double z_k, coeff, tmp, y, yp1, sigma, tmpLn;
1150 for (
size_t k = 0; k <
m_kk; k++) {
1158 xmolSolvent = std::max(8.689E-3, xmolSolvent);
1160 double numdAdPTmp = dAdP * sqrtI;
1164 case DHFORM_DILUTE_LIMIT:
1165 for (
size_t k = 0; k <
m_kk; k++) {
1171 case DHFORM_BDOT_AK:
1172 for (
size_t k = 0; k <
m_kk; k++) {
1174 if (est == cEST_nonpolarNeutral) {
1179 - z_k * z_k * numdAdPTmp / (1.0 + denomTmp *
m_Aionic[k]);
1184 coeff = 2.0 / 3.0 * dAdP *
m_Mnaught * sqrtI;
1186 if (denomTmp > 0.0) {
1187 for (
size_t k = 0; k <
m_kk; k++) {
1190 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1198 case DHFORM_BDOT_ACOMMON:
1200 for (
size_t k = 0; k <
m_kk; k++) {
1203 - z_k * z_k * numdAdPTmp / (1.0 + denomTmp);
1205 if (denomTmp > 0.0) {
1208 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1219 for (
size_t k = 1; k <
m_kk; k++) {
1223 if (denomTmp > 0.0) {
1226 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1234 case DHFORM_PITZER_BETAIJ:
1236 tmpLn = log(1.0 + denomTmp);
1237 for (
size_t k = 1; k <
m_kk; k++) {
1240 - z_k * z_k * numdAdPTmp / (1.0 + denomTmp)
1241 - 2.0 * z_k * z_k * dAdP * tmpLn
1246 sigma = 1.0 / (1.0 + denomTmp);
1252 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.
void getMolalityActivityCoefficients(span< double > acMolality) const override
Get the array of non-dimensional molality-based activity coefficients at the current solution tempera...
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...
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...
vector< double > m_B_Dot
Array of B_Dot values.
double m_IionicMolality
Current value of the ionic strength on the molality scale.
void getPartialMolarEnthalpies(span< double > hbar) const override
Returns an array of partial molar enthalpies for the species in the mixture.
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.
void getPartialMolarCp(span< double > cpbar) const override
Return an array of partial molar heat capacities for the species in the mixture.
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.
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 getActivities(span< double > ac) const override
Get the array of non-dimensional activities at the current solution temperature, pressure,...
void setA_Debye(double A)
Set the A_Debye parameter.
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.
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 getPartialMolarVolumes(span< double > vbar) const override
Return an array of partial molar volumes 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
void getPartialMolarEntropies(span< double > sbar) const override
Returns an array of partial molar entropies of the species in the solution.
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.
void getChemPotentials(span< double > mu) const override
Get the species chemical potentials. Units: J/kmol.
double m_IionicMolalityStoich
Stoichiometric ionic strength on the molality scale.
void getActivityConcentrations(span< double > c) const override
This method returns an array of generalized concentrations.
vector< double > m_lnActCoeffMolal
Logarithm of the activity coefficients on the molality scale.
vector< double > m_dlnActCoeffMolaldP
Derivative of log act coeff wrt P.
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.
size_t nSpecies() const
Returns the number of species in the phase.
size_t m_kk
Number of species in the phase.
size_t speciesIndex(const string &name, bool raise=true) const
Returns the index of a species named 'name' within the Phase object.
double temperature() const
Temperature (K).
string speciesName(size_t k) const
Name of the species with index k.
double moleFraction(size_t k) const
Return the mole fraction of a single species.
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.
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.
void getCp_R(span< double > cpr) const override
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
double pressure() const override
Returns the current pressure of the phase.
virtual void _updateStandardStateThermo() const
Updates the standard state thermodynamic functions at the current T and P of the solution.
void getStandardChemPotentials(span< double > mu) const override
Get the array of chemical potentials at unit activity for the species at their standard states at the...
void getEnthalpy_RT(span< double > hrt) const override
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
void getEntropy_R(span< double > sr) const override
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
void getStandardVolumes(span< double > vol) const override
Get the molar volumes of the species standard states at the current T and P of the solution.
virtual void calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
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.
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.
void checkArraySize(const char *procedure, size_t available, size_t required)
Wrapper for throwing ArraySizeError.
Contains declarations for string manipulation functions within Cantera.