Cantera
3.1.0a1
|
Class for pressure dependent standard states corresponding to ionic solutes in electrolyte water. More...
#include <PDSS_HKFT.h>
Class for pressure dependent standard states corresponding to ionic solutes in electrolyte water.
Definition at line 27 of file PDSS_HKFT.h.
Public Member Functions | |
PDSS_HKFT () | |
Default Constructor. More... | |
Molar Thermodynamic Properties of the Solution | |
double | enthalpy_mole () const override |
Return the molar enthalpy in units of J kmol-1. More... | |
double | intEnergy_mole () const override |
Return the molar internal Energy in units of J kmol-1. More... | |
double | entropy_mole () const override |
Return the molar entropy in units of J kmol-1 K-1. More... | |
double | gibbs_mole () const override |
Return the molar Gibbs free energy in units of J kmol-1. More... | |
double | cp_mole () const override |
Return the molar const pressure heat capacity in units of J kmol-1 K-1. More... | |
double | molarVolume () const override |
Return the molar volume at standard state. More... | |
double | density () const override |
Return the standard state density at standard state. More... | |
Properties of the Reference State of the Species in the Solution | |
double | refPressure () const |
double | gibbs_RT_ref () const override |
Return the molar Gibbs free energy divided by RT at reference pressure. More... | |
double | enthalpy_RT_ref () const override |
Return the molar enthalpy divided by RT at reference pressure. More... | |
double | entropy_R_ref () const override |
Return the molar entropy divided by R at reference pressure. More... | |
double | cp_R_ref () const override |
Return the molar heat capacity divided by R at reference pressure. More... | |
double | molarVolume_ref () const override |
Return the molar volume at reference pressure. More... | |
Mechanical Equation of State Properties | |
void | setState_TP (double temp, double pres) override |
Set the internal temperature and pressure. More... | |
Initialization of the Object | |
void | setParent (VPStandardStateTP *phase, size_t k) override |
Set the parent VPStandardStateTP object of this PDSS object. More... | |
void | initThermo () override |
Initialization routine. More... | |
void | setDeltaH0 (double dh0) |
Set enthalpy of formation at Pr, Tr [J/kmol]. More... | |
void | setDeltaG0 (double dg0) |
Set Gibbs free energy of formation at Pr, Tr [J/kmol]. More... | |
void | setS0 (double s0) |
Set entropy of formation at Pr, Tr [J/kmol/K]. More... | |
void | set_a (double *a) |
Set "a" coefficients (array of 4 elements). More... | |
void | set_c (double *c) |
Set "c" coefficients (array of 2 elements). More... | |
void | setOmega (double omega) |
Set omega [J/kmol]. More... | |
void | getParameters (AnyMap &eosNode) const override |
Store the parameters needed to reconstruct a copy of this PDSS object. More... | |
Public Member Functions inherited from PDSS_Molar | |
double | enthalpy_RT () const override |
Return the standard state molar enthalpy divided by RT. More... | |
double | entropy_R () const override |
Return the standard state entropy divided by RT. More... | |
double | gibbs_RT () const override |
Return the molar Gibbs free energy divided by RT. More... | |
double | cp_R () const override |
Return the molar const pressure heat capacity divided by RT. More... | |
Public Member Functions inherited from PDSS | |
virtual void | setTemperature (double temp) |
Set the internal temperature. More... | |
virtual double | temperature () const |
Return the current stored temperature. More... | |
virtual double | critTemperature () const |
critical temperature More... | |
virtual double | critPressure () const |
critical pressure More... | |
virtual double | critDensity () const |
critical density More... | |
virtual double | satPressure (double T) |
saturation pressure More... | |
double | molecularWeight () const |
Return the molecular weight of the species in units of kg kmol-1. More... | |
void | setMolecularWeight (double mw) |
Set the molecular weight of the species. More... | |
PDSS ()=default | |
Default Constructor. More... | |
PDSS (const PDSS &b)=delete | |
PDSS & | operator= (const PDSS &b)=delete |
virtual | ~PDSS ()=default |
virtual double | cv_mole () const |
Return the molar const volume heat capacity in units of J kmol-1 K-1. More... | |
double | refPressure () const |
Return the reference pressure for this phase. More... | |
double | minTemp () const |
return the minimum temperature More... | |
double | maxTemp () const |
return the minimum temperature More... | |
virtual double | pressure () const |
Returns the pressure (Pa) More... | |
virtual void | setPressure (double pres) |
Sets the pressure in the object. More... | |
virtual double | thermalExpansionCoeff () const |
Return the volumetric thermal expansion coefficient. Units: 1/K. More... | |
void | setReferenceThermo (shared_ptr< SpeciesThermoInterpType > stit) |
Set the SpeciesThermoInterpType object used to calculate reference state properties. More... | |
void | setParameters (const AnyMap &node) |
Set model parameters from an AnyMap phase description, for example from the equation-of-state field of a species definition. More... | |
Private Member Functions | |
double | deltaG () const |
Main routine that actually calculates the Gibbs free energy difference between the reference state at Tr, Pr and T,P. More... | |
double | deltaS () const |
Main routine that actually calculates the entropy difference between the reference state at Tr, Pr and T,P. More... | |
double | ag (const double temp, const int ifunc=0) const |
Internal formula for the calculation of a_g() More... | |
double | bg (const double temp, const int ifunc=0) const |
Internal formula for the calculation of b_g() More... | |
double | g (const double temp, const double pres, const int ifunc=0) const |
function g appearing in the formulation More... | |
double | f (const double temp, const double pres, const int ifunc=0) const |
Difference function f appearing in the formulation. More... | |
double | gstar (const double temp, const double pres, const int ifunc=0) const |
Evaluate the Gstar value appearing in the HKFT formulation. More... | |
double | LookupGe (const string &elemName) |
Function to look up Element Free Energies. More... | |
void | convertDGFormation () |
Translate a Gibbs free energy of formation value to a NIST-based Chemical potential. More... | |
Private Attributes | |
VPStandardStateTP * | m_tp |
Parent VPStandardStateTP (ThermoPhase) object. More... | |
size_t | m_spindex |
Index of this species within the parent phase. More... | |
PDSS_Water * | m_waterSS = nullptr |
Water standard state calculator. More... | |
UnitSystem | m_units |
double | m_densWaterSS = -1.0 |
density of standard-state water. internal temporary variable More... | |
unique_ptr< WaterProps > | m_waterProps |
Pointer to the water property calculator. More... | |
double | m_deltaG_formation_tr_pr = NAN |
Input value of deltaG of Formation at Tr and Pr (cal gmol-1) More... | |
double | m_deltaH_formation_tr_pr = NAN |
Input value of deltaH of Formation at Tr and Pr (cal gmol-1) More... | |
double | m_Mu0_tr_pr = 0.0 |
Value of the Absolute Gibbs Free Energy NIST scale at T_r and P_r. More... | |
double | m_Entrop_tr_pr = NAN |
Input value of S_j at Tr and Pr (cal gmol-1 K-1) More... | |
double | m_a1 = 0.0 |
Input a1 coefficient (cal gmol-1 bar-1) More... | |
double | m_a2 = 0.0 |
Input a2 coefficient (cal gmol-1) More... | |
double | m_a3 = 0.0 |
Input a3 coefficient (cal K gmol-1 bar-1) More... | |
double | m_a4 = 0.0 |
Input a4 coefficient (cal K gmol-1) More... | |
double | m_c1 = 0.0 |
Input c1 coefficient (cal gmol-1 K-1) More... | |
double | m_c2 = 0.0 |
Input c2 coefficient (cal K gmol-1) More... | |
double | m_omega_pr_tr = 0.0 |
Input omega_pr_tr coefficient(cal gmol-1) More... | |
double | m_Y_pr_tr = 0.0 |
y = dZdT = 1/(esp*esp) desp/dT at 298.15 and 1 bar More... | |
double | m_Z_pr_tr = 0.0 |
Z = -1 / relEpsilon at 298.15 and 1 bar. More... | |
double | m_presR_bar = OneAtm * 1.0E-5 |
Reference pressure is 1 atm in units of bar= 1.0132. More... | |
double | m_domega_jdT_prtr = 0.0 |
small value that is not quite zero More... | |
double | m_charge_j = 0.0 |
Charge of the ion. More... | |
Static Private Attributes | |
static int | s_InputInconsistencyErrorExit = 1 |
Static variable determining error exiting. More... | |
Additional Inherited Members | |
Protected Attributes inherited from PDSS | |
double | m_temp = -1.0 |
Current temperature used by the PDSS object. More... | |
double | m_pres = -1.0 |
State of the system - pressure. More... | |
double | m_p0 = -1.0 |
Reference state pressure of the species. More... | |
double | m_minTemp = -1.0 |
Minimum temperature. More... | |
double | m_maxTemp = 10000.0 |
Maximum temperature. More... | |
double | m_mw = 0.0 |
Molecular Weight of the species. More... | |
AnyMap | m_input |
Input data supplied via setParameters. More... | |
shared_ptr< SpeciesThermoInterpType > | m_spthermo |
Pointer to the species thermodynamic property manager. More... | |
PDSS_HKFT | ( | ) |
Default Constructor.
Definition at line 23 of file PDSS_HKFT.cpp.
|
overridevirtual |
Return the molar enthalpy in units of J kmol-1.
Reimplemented from PDSS.
Definition at line 29 of file PDSS_HKFT.cpp.
|
overridevirtual |
Return the molar internal Energy in units of J kmol-1.
Reimplemented from PDSS.
Definition at line 36 of file PDSS_HKFT.cpp.
|
overridevirtual |
Return the molar entropy in units of J kmol-1 K-1.
Reimplemented from PDSS.
Definition at line 41 of file PDSS_HKFT.cpp.
|
overridevirtual |
Return the molar Gibbs free energy in units of J kmol-1.
Reimplemented from PDSS.
Definition at line 46 of file PDSS_HKFT.cpp.
|
overridevirtual |
Return the molar const pressure heat capacity in units of J kmol-1 K-1.
Reimplemented from PDSS.
Definition at line 51 of file PDSS_HKFT.cpp.
|
overridevirtual |
Return the molar volume at standard state.
Reimplemented from PDSS.
Definition at line 107 of file PDSS_HKFT.cpp.
|
overridevirtual |
Return the standard state density at standard state.
Reimplemented from PDSS.
Definition at line 150 of file PDSS_HKFT.cpp.
|
overridevirtual |
Return the molar Gibbs free energy divided by RT at reference pressure.
Reimplemented from PDSS.
Definition at line 155 of file PDSS_HKFT.cpp.
|
overridevirtual |
Return the molar enthalpy divided by RT at reference pressure.
Reimplemented from PDSS.
Definition at line 164 of file PDSS_HKFT.cpp.
|
overridevirtual |
Return the molar entropy divided by R at reference pressure.
Reimplemented from PDSS.
Definition at line 173 of file PDSS_HKFT.cpp.
|
overridevirtual |
Return the molar heat capacity divided by R at reference pressure.
Reimplemented from PDSS.
Definition at line 182 of file PDSS_HKFT.cpp.
|
overridevirtual |
Return the molar volume at reference pressure.
Reimplemented from PDSS.
Definition at line 191 of file PDSS_HKFT.cpp.
|
overridevirtual |
Set the internal temperature and pressure.
temp | Temperature (Kelvin) |
pres | pressure (Pascals) |
Reimplemented from PDSS.
Definition at line 200 of file PDSS_HKFT.cpp.
|
inlineoverridevirtual |
Set the parent VPStandardStateTP object of this PDSS object.
This information is only used by certain PDSS subclasses
phase | Pointer to the parent phase |
k | Index of this species in the phase |
Reimplemented from PDSS.
Definition at line 71 of file PDSS_HKFT.h.
|
overridevirtual |
Initialization routine.
This is a cascading call, where each level should call the the parent level.
Reimplemented from PDSS.
Definition at line 206 of file PDSS_HKFT.cpp.
void setDeltaH0 | ( | double | dh0 | ) |
Set enthalpy of formation at Pr, Tr [J/kmol].
Definition at line 315 of file PDSS_HKFT.cpp.
void setDeltaG0 | ( | double | dg0 | ) |
Set Gibbs free energy of formation at Pr, Tr [J/kmol].
Definition at line 319 of file PDSS_HKFT.cpp.
void setS0 | ( | double | s0 | ) |
Set entropy of formation at Pr, Tr [J/kmol/K].
Definition at line 323 of file PDSS_HKFT.cpp.
void set_a | ( | double * | a | ) |
Set "a" coefficients (array of 4 elements).
Units of each coefficient are [J/kmol/Pa, J/kmol, J*K/kmol/Pa, J*K/kmol]
Definition at line 327 of file PDSS_HKFT.cpp.
void set_c | ( | double * | c | ) |
Set "c" coefficients (array of 2 elements).
Units of each coefficient are [J/kmol/K, J*K/kmol]
Definition at line 334 of file PDSS_HKFT.cpp.
void setOmega | ( | double | omega | ) |
Set omega [J/kmol].
Definition at line 339 of file PDSS_HKFT.cpp.
|
overridevirtual |
Store the parameters needed to reconstruct a copy of this PDSS object.
Reimplemented from PDSS.
Definition at line 343 of file PDSS_HKFT.cpp.
|
private |
Main routine that actually calculates the Gibbs free energy difference between the reference state at Tr, Pr and T,P.
This is Eqn. 59 in Johnson et al. [13].
Definition at line 365 of file PDSS_HKFT.cpp.
|
private |
Main routine that actually calculates the entropy difference between the reference state at Tr, Pr and T,P.
This is Eqn. 61 in Johnson et al. [13]. Actually, there appears to be an error in the latter. This is a correction.
Definition at line 398 of file PDSS_HKFT.cpp.
|
private |
Internal formula for the calculation of a_g()
The output of this is in units of Angstroms
temp | Temperature (K) |
ifunc | parameters specifying the desired information
|
Definition at line 438 of file PDSS_HKFT.cpp.
|
private |
Internal formula for the calculation of b_g()
the output of this is unitless
temp | Temperature (K) |
ifunc | parameters specifying the desired information
|
Definition at line 452 of file PDSS_HKFT.cpp.
|
private |
function g appearing in the formulation
Function \( g \) (Eqn. 49) appearing in the Johnson et al. [13] formulation.
temp | Temperature kelvin |
pres | Pressure (pascal) |
ifunc | parameters specifying the desired information
|
Definition at line 500 of file PDSS_HKFT.cpp.
|
private |
Difference function f appearing in the formulation.
Function \( f \) (Eqn. 52) appearing in the Johnson et al. [13] formulation of \( \omega_j \) (Eqn. 46).
temp | Temperature kelvin |
pres | Pressure (pascal) |
ifunc | parameters specifying the desired information
|
Definition at line 466 of file PDSS_HKFT.cpp.
|
private |
Evaluate the Gstar value appearing in the HKFT formulation.
temp | Temperature kelvin |
pres | Pressure (pascal) |
ifunc | parameters specifying the desired information
|
Definition at line 553 of file PDSS_HKFT.cpp.
|
private |
Function to look up Element Free Energies.
This function looks up the argument string in the element database and returns the associated 298 K Gibbs Free energy of the element in its stable state.
elemName | String. Only the first 3 characters are significant |
CanteraError | If a match is not found, a CanteraError is thrown as well |
Definition at line 561 of file PDSS_HKFT.cpp.
|
private |
Translate a Gibbs free energy of formation value to a NIST-based Chemical potential.
Internally, this function is used to translate the input value, m_deltaG_formation_tr_pr, to the internally stored value, m_Mu0_tr_pr.
Definition at line 575 of file PDSS_HKFT.cpp.
|
private |
Parent VPStandardStateTP (ThermoPhase) object.
Definition at line 100 of file PDSS_HKFT.h.
|
private |
Index of this species within the parent phase.
Definition at line 101 of file PDSS_HKFT.h.
|
private |
Water standard state calculator.
derived from the equation of state for water. This object doesn't own the object. Just a shallow pointer.
Definition at line 213 of file PDSS_HKFT.h.
|
mutableprivate |
density of standard-state water. internal temporary variable
Definition at line 218 of file PDSS_HKFT.h.
|
private |
Pointer to the water property calculator.
Definition at line 221 of file PDSS_HKFT.h.
|
private |
Input value of deltaG of Formation at Tr and Pr (cal gmol-1)
Tr = 298.15 Pr = 1 atm
This is the delta G for the formation reaction of the ion from elements in their stable state at Tr, Pr.
Definition at line 230 of file PDSS_HKFT.h.
|
private |
Input value of deltaH of Formation at Tr and Pr (cal gmol-1)
Tr = 298.15 Pr = 1 atm
This is the delta H for the formation reaction of the ion from elements in their stable state at Tr, Pr.
Definition at line 239 of file PDSS_HKFT.h.
|
private |
Value of the Absolute Gibbs Free Energy NIST scale at T_r and P_r.
This is the NIST scale value of Gibbs free energy at T_r = 298.15 and P_r = 1 atm.
J kmol-1
Definition at line 248 of file PDSS_HKFT.h.
|
private |
Input value of S_j at Tr and Pr (cal gmol-1 K-1)
Tr = 298.15 Pr = 1 atm
Definition at line 254 of file PDSS_HKFT.h.
|
private |
Input a1 coefficient (cal gmol-1 bar-1)
Definition at line 257 of file PDSS_HKFT.h.
|
private |
Input a2 coefficient (cal gmol-1)
Definition at line 260 of file PDSS_HKFT.h.
|
private |
Input a3 coefficient (cal K gmol-1 bar-1)
Definition at line 263 of file PDSS_HKFT.h.
|
private |
Input a4 coefficient (cal K gmol-1)
Definition at line 266 of file PDSS_HKFT.h.
|
private |
Input c1 coefficient (cal gmol-1 K-1)
Definition at line 269 of file PDSS_HKFT.h.
|
private |
Input c2 coefficient (cal K gmol-1)
Definition at line 272 of file PDSS_HKFT.h.
|
private |
Input omega_pr_tr coefficient(cal gmol-1)
Definition at line 275 of file PDSS_HKFT.h.
|
private |
y = dZdT = 1/(esp*esp) desp/dT at 298.15 and 1 bar
Definition at line 278 of file PDSS_HKFT.h.
|
private |
Z = -1 / relEpsilon at 298.15 and 1 bar.
Definition at line 281 of file PDSS_HKFT.h.
|
private |
Reference pressure is 1 atm in units of bar= 1.0132.
Definition at line 284 of file PDSS_HKFT.h.
|
private |
small value that is not quite zero
Definition at line 287 of file PDSS_HKFT.h.
|
private |
Charge of the ion.
Definition at line 290 of file PDSS_HKFT.h.
|
staticprivate |
Static variable determining error exiting.
If true, then will error exit if there is an inconsistency in DG0, DH0, and DS0. If not, then will rewrite DH0 to be consistent with the other two.
Definition at line 297 of file PDSS_HKFT.h.