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;
82 for (
size_t k = 1; k <
m_kk; k++) {
95 for (
size_t k = 0; k <
m_kk; k++) {
96 acMolality[k] = exp(acMolality[k]);
114 for (
size_t k = 1; k <
m_kk; k++) {
128 for (
size_t k = 0; k <
m_kk; k++) {
141 for (
size_t k = 0; k <
m_kk; k++) {
154 for (
size_t k = 0; k <
m_kk; k++) {
165 for (
size_t k = 1; k <
m_kk; k++) {
179 for (
size_t k = 0; k <
m_kk; k++) {
192 for (
size_t k = 0; k <
m_kk; k++) {
200 for (
size_t k = 0; k <
m_kk; k++) {
214 for (
size_t k = 0; k <
m_kk; k++) {
232 }
else if (estString ==
"charged-species"
234 return cEST_chargedSpecies;
235 }
else if (estString ==
"weak-acid-associated"
237 return cEST_weakAcidAssociated;
238 }
else if (estString ==
"strong-acid-associated"
240 return cEST_strongAcidAssociated;
241 }
else if (estString ==
"polar-neutral"
243 return cEST_polarNeutral;
244 }
else if (estString ==
"nonpolar-neutral"
246 return cEST_nonpolarNeutral;
249 "Invalid electrolyte species type '{}'", estString);
255 || model ==
"dilute-limit"
258 }
else if (model ==
"B-dot-with-variable-a"
261 }
else if (model ==
"B-dot-with-common-a"
267 }
else if (model ==
"Pitzer-with-beta_ij"
273 "Unknown model '{}'", model);
287void DebyeHuckel::setB_dot(
double bdot)
292 "B_dot entry in the wrong DH form");
295 for (
size_t k = 0; k <
nSpecies(); k++) {
296 if (fabs(
charge(k)) > 0.0001) {
307 for (
size_t k = 0; k <
m_kk; k++) {
318 throw CanteraError(
"DebyeHuckel::setBeta",
"Species '{}' not found", sp1);
322 throw CanteraError(
"DebyeHuckel::setBeta",
"Species '{}' not found", sp2);
334 if (node.hasKey(
"A_Debye")) {
335 if (node[
"A_Debye"] ==
"variable") {
338 setA_Debye(node.convert(
"A_Debye",
"kg^0.5/gmol^0.5"));
341 if (node.hasKey(
"B_Debye")) {
342 setB_Debye(node.convert(
"B_Debye",
"kg^0.5/gmol^0.5/m"));
344 if (node.hasKey(
"max-ionic-strength")) {
345 setMaxIonicStrength(node[
"max-ionic-strength"].asDouble());
347 if (node.hasKey(
"use-Helgeson-fixed-form")) {
348 useHelgesonFixedForm(node[
"use-Helgeson-fixed-form"].asBool());
350 if (node.hasKey(
"default-ionic-radius")) {
353 if (node.hasKey(
"B-dot")) {
354 setB_dot(node[
"B-dot"].asDouble());
356 if (node.hasKey(
"beta")) {
357 for (
auto& item : node[
"beta"].asVector<
AnyMap>()) {
358 auto&
species = item[
"species"].asVector<
string>(2);
372 }
else if (
dynamic_cast<PDSS_ConstVol*
>(providePDSS(0)) == 0) {
373 throw CanteraError(
"DebyeHuckel::initThermo",
"Solvent standard state"
374 " model must be WaterIAPWS or constant_incompressible.");
378 for (
size_t k = 1; k <
nSpecies(); k++) {
380 throw CanteraError(
"DebyeHuckel::initThermo",
"Solute standard"
381 " state model must be constant_incompressible.");
392 case DHFORM_DILUTE_LIMIT:
393 activityNode[
"model"] =
"dilute-limit";
396 activityNode[
"model"] =
"B-dot-with-variable-a";
398 case DHFORM_BDOT_ACOMMON:
399 activityNode[
"model"] =
"B-dot-with-common-a";
402 activityNode[
"model"] =
"beta_ij";
404 case DHFORM_PITZER_BETAIJ:
405 activityNode[
"model"] =
"Pitzer-with-beta_ij";
410 activityNode[
"A_Debye"] =
"variable";
411 }
else if (
m_A_Debye != A_Debye_default) {
412 activityNode[
"A_Debye"].setQuantity(
m_A_Debye,
"kg^0.5/gmol^0.5");
416 activityNode[
"B_Debye"].setQuantity(
m_B_Debye,
"kg^0.5/gmol^0.5/m");
422 activityNode[
"use-Helgeson-fixed-form"] =
true;
429 activityNode[
"B-dot"] = B_dot;
435 for (
size_t i = 0; i <
m_kk; i++) {
436 for (
size_t j = i; j <
m_kk; j++) {
439 entry[
"species"] = vector<string>{
442 beta.push_back(std::move(entry));
446 activityNode[
"beta"] = std::move(beta);
448 phaseNode[
"activity-data"] = std::move(activityNode);
458 dhNode[
"ionic-radius"].setQuantity(
m_Aionic[k],
"m");
461 int estDefault = cEST_nonpolarNeutral;
468 estDefault = cEST_weakAcidAssociated;
469 }
else if (fabs(
charge(k)) > 0.0001) {
470 estDefault = cEST_chargedSpecies;
479 case cEST_chargedSpecies:
480 estType =
"charged-species";
482 case cEST_weakAcidAssociated:
483 estType =
"weak-acid-associated";
485 case cEST_strongAcidAssociated:
486 estType =
"strong-acid-associated";
488 case cEST_polarNeutral:
489 estType =
"polar-neutral";
491 case cEST_nonpolarNeutral:
492 estType =
"nonpolar-neutral";
496 "Unknown electrolyte species type ({}) for species '{}'",
499 dhNode[
"electrolyte-species-type"] = estType;
503 speciesNode[
"Debye-Huckel"] = std::move(dhNode);
512 if (tempArg != -1.0) {
516 if (presArg != -1.0) {
529 throw CanteraError(
"DebyeHuckel::A_Debye_TP",
"shouldn't be here");
537 if (tempArg != -1.0) {
541 if (presArg != -1.0) {
553 throw CanteraError(
"DebyeHuckel::dA_DebyedT_TP",
"shouldn't be here");
561 if (tempArg != -1.0) {
565 if (presArg != -1.0) {
577 throw CanteraError(
"DebyeHuckel::d2A_DebyedT2_TP",
"shouldn't be here");
585 if (tempArg != -1.0) {
589 if (presArg != -1.0) {
601 throw CanteraError(
"DebyeHuckel::dA_DebyedP_TP",
"shouldn't be here");
629 int est = cEST_nonpolarNeutral;
630 double stoichCharge = spec->charge;
631 if (fabs(spec->charge) > 0.0001) {
632 est = cEST_chargedSpecies;
635 if (spec->input.hasKey(
"Debye-Huckel")) {
636 auto& dhNode = spec->input[
"Debye-Huckel"].as<
AnyMap>();
637 Aionic = dhNode.
convert(
"ionic-radius",
"m", NAN);
638 if (dhNode.hasKey(
"weak-acid-charge")) {
639 stoichCharge = dhNode[
"weak-acid-charge"].asDouble();
640 if (fabs(stoichCharge - spec->charge) > 0.0001) {
641 est = cEST_weakAcidAssociated;
645 if (dhNode.hasKey(
"electrolyte-species-type")) {
646 est =
interp_est(dhNode[
"electrolyte-species-type"].asString());
666 const static double npActCoeff[] = {0.1127, -0.01049, 1.545E-3};
667 double I2 = IionicMolality * IionicMolality;
669 npActCoeff[0] * IionicMolality +
671 npActCoeff[2] * I2 * IionicMolality;
672 return pow(10.0 , l10actCoeff);
677 const double a0 = 1.454;
678 const double b0 = 0.02236;
679 const double c0 = 9.380E-3;
680 const double d0 = -5.362E-4;
685 double Is2 = Is * Is;
686 double bhat = 1.0 + a0 * sqrt(Is);
687 double func = bhat - 2.0 * log(bhat) - 1.0/bhat;
688 double v1 =
m_A_Debye / (a0 * a0 * a0 * Is) * func;
689 double oc = 1.0 - v1 + b0 * Is / 2.0 + 2.0 * c0 * Is2 / 3.0
690 + 3.0 * d0 * Is2 * Is / 4.0;
700 for (
size_t k = 1; k <
m_kk; k++) {
711 double z_k, zs_k1, zs_k2;
722 for (
size_t k = 0; k <
m_kk; k++) {
731 for (
size_t k = 0; k <
m_kk; k++) {
753 xmolSolvent = std::max(8.689E-3, xmolSolvent);
756 double ac_nonPolar = 1.0;
760 double lnActivitySolvent = 0.0;
763 double y, yp1, sigma;
765 case DHFORM_DILUTE_LIMIT:
766 for (
size_t k = 0; k <
m_kk; k++) {
771 (xmolSolvent - 1.0)/xmolSolvent +
778 for (
size_t k = 0; k <
m_kk; k++) {
780 if (est == cEST_nonpolarNeutral) {
785 - z_k * z_k * numTmp / (1.0 + denomTmp *
m_Aionic[k])
790 lnActivitySolvent = (xmolSolvent - 1.0)/xmolSolvent;
794 if (denomTmp > 0.0) {
795 for (
size_t k = 0; k <
m_kk; k++) {
799 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
805 lnActivitySolvent += coeff * tmp;
807 for (
size_t k = 1; k <
m_kk; k++) {
823 case DHFORM_BDOT_ACOMMON:
825 for (
size_t k = 0; k <
m_kk; k++) {
828 - z_k * z_k * numTmp / (1.0 + denomTmp)
831 if (denomTmp > 0.0) {
834 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
839 (xmolSolvent - 1.0)/xmolSolvent +
843 for (
size_t k = 1; k <
m_kk; k++) {
857 (xmolSolvent - 1.0)/xmolSolvent;
859 for (
size_t k = 1; k <
m_kk; k++) {
862 - z_k * z_k * numTmp / (1.0 + denomTmp);
863 for (
size_t j = 0; j <
m_kk; j++) {
868 if (denomTmp > 0.0) {
871 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 -2.0*log(yp1));
876 (xmolSolvent - 1.0)/xmolSolvent +
880 for (
size_t k = 0; k <
m_kk; k++) {
881 for (
size_t j = 0; j <
m_kk; j++) {
889 case DHFORM_PITZER_BETAIJ:
893 tmpLn = log(1.0 + denomTmp);
894 for (
size_t k = 1; k <
m_kk; k++) {
897 - z_k * z_k * numTmp / 3.0 / (1.0 + denomTmp);
901 for (
size_t j = 0; j <
m_kk; j++) {
906 sigma = 1.0 / (1.0 + denomTmp);
908 (xmolSolvent - 1.0)/xmolSolvent +
912 for (
size_t k = 0; k <
m_kk; k++) {
913 for (
size_t j = 0; j <
m_kk; j++) {
922 throw CanteraError(
"DebyeHuckel::s_update_lnMolalityActCoeff",
"ERROR");
934 double z_k, coeff, tmp, y, yp1, sigma, tmpLn;
938 for (
size_t k = 0; k <
m_kk; k++) {
946 xmolSolvent = std::max(8.689E-3, xmolSolvent);
948 double numdAdTTmp = dAdT * sqrtI;
950 double d_lnActivitySolvent_dT = 0;
953 case DHFORM_DILUTE_LIMIT:
954 for (
size_t k = 1; k <
m_kk; k++) {
958 d_lnActivitySolvent_dT = 2.0 / 3.0 * dAdT *
m_Mnaught *
964 for (
size_t k = 0; k <
m_kk; k++) {
967 - z_k * z_k * numdAdTTmp / (1.0 + denomTmp *
m_Aionic[k]);
971 coeff = 2.0 / 3.0 * dAdT *
m_Mnaught * sqrtI;
973 if (denomTmp > 0.0) {
974 for (
size_t k = 0; k <
m_kk; k++) {
977 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
985 case DHFORM_BDOT_ACOMMON:
987 for (
size_t k = 0; k <
m_kk; k++) {
990 - z_k * z_k * numdAdTTmp / (1.0 + denomTmp);
992 if (denomTmp > 0.0) {
995 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1005 for (
size_t k = 1; k <
m_kk; k++) {
1009 if (denomTmp > 0.0) {
1012 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1020 case DHFORM_PITZER_BETAIJ:
1022 tmpLn = log(1.0 + denomTmp);
1023 for (
size_t k = 1; k <
m_kk; k++) {
1026 - z_k * z_k * numdAdTTmp / (1.0 + denomTmp)
1031 sigma = 1.0 / (1.0 + denomTmp);
1037 throw CanteraError(
"DebyeHuckel::s_update_dlnMolalityActCoeff_dT",
1044 double z_k, coeff, tmp, y, yp1, sigma, tmpLn;
1047 if (d2AdT2 == 0.0 && dAdT == 0.0) {
1048 for (
size_t k = 0; k <
m_kk; k++) {
1056 xmolSolvent = std::max(8.689E-3, xmolSolvent);
1058 double numd2AdT2Tmp = d2AdT2 * sqrtI;
1062 case DHFORM_DILUTE_LIMIT:
1063 for (
size_t k = 0; k <
m_kk; k++) {
1069 case DHFORM_BDOT_AK:
1070 for (
size_t k = 0; k <
m_kk; k++) {
1073 - z_k * z_k * numd2AdT2Tmp / (1.0 + denomTmp *
m_Aionic[k]);
1077 coeff = 2.0 / 3.0 * d2AdT2 *
m_Mnaught * sqrtI;
1079 if (denomTmp > 0.0) {
1080 for (
size_t k = 0; k <
m_kk; k++) {
1083 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1091 case DHFORM_BDOT_ACOMMON:
1093 for (
size_t k = 0; k <
m_kk; k++) {
1096 - z_k * z_k * numd2AdT2Tmp / (1.0 + denomTmp);
1098 if (denomTmp > 0.0) {
1101 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1111 for (
size_t k = 1; k <
m_kk; k++) {
1115 if (denomTmp > 0.0) {
1118 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 -2.0*log(yp1));
1126 case DHFORM_PITZER_BETAIJ:
1128 tmpLn = log(1.0 + denomTmp);
1129 for (
size_t k = 1; k <
m_kk; k++) {
1132 - z_k * z_k * numd2AdT2Tmp / (1.0 + denomTmp)
1137 sigma = 1.0 / (1.0 + denomTmp);
1143 throw CanteraError(
"DebyeHuckel::s_update_d2lnMolalityActCoeff_dT2",
1150 double z_k, coeff, tmp, y, yp1, sigma, tmpLn;
1154 for (
size_t k = 0; k <
m_kk; k++) {
1162 xmolSolvent = std::max(8.689E-3, xmolSolvent);
1164 double numdAdPTmp = dAdP * sqrtI;
1168 case DHFORM_DILUTE_LIMIT:
1169 for (
size_t k = 0; k <
m_kk; k++) {
1175 case DHFORM_BDOT_AK:
1176 for (
size_t k = 0; k <
m_kk; k++) {
1178 if (est == cEST_nonpolarNeutral) {
1183 - z_k * z_k * numdAdPTmp / (1.0 + denomTmp *
m_Aionic[k]);
1188 coeff = 2.0 / 3.0 * dAdP *
m_Mnaught * sqrtI;
1190 if (denomTmp > 0.0) {
1191 for (
size_t k = 0; k <
m_kk; k++) {
1194 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1202 case DHFORM_BDOT_ACOMMON:
1204 for (
size_t k = 0; k <
m_kk; k++) {
1207 - z_k * z_k * numdAdPTmp / (1.0 + denomTmp);
1209 if (denomTmp > 0.0) {
1212 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1223 for (
size_t k = 1; k <
m_kk; k++) {
1227 if (denomTmp > 0.0) {
1230 sigma = 3.0 / (y * y * y) * (yp1 - 1.0/yp1 - 2.0*log(yp1));
1238 case DHFORM_PITZER_BETAIJ:
1240 tmpLn = log(1.0 + denomTmp);
1241 for (
size_t k = 1; k <
m_kk; k++) {
1244 - z_k * z_k * numdAdPTmp / (1.0 + denomTmp)
1245 - 2.0 * z_k * z_k * dAdP * tmpLn
1250 sigma = 1.0 / (1.0 + denomTmp);
1256 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...
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.
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.
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.
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 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 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).
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.
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.
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.
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.