Cantera  3.1.0a1

Class for pressure dependent standard states corresponding to ionic solutes in electrolyte water. More...

#include <PDSS_HKFT.h>

Inheritance diagram for PDSS_HKFT:
[legend]

Detailed Description

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
 
PDSSoperator= (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

VPStandardStateTPm_tp
 Parent VPStandardStateTP (ThermoPhase) object. More...
 
size_t m_spindex
 Index of this species within the parent phase. More...
 
PDSS_Waterm_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< WaterPropsm_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< SpeciesThermoInterpTypem_spthermo
 Pointer to the species thermodynamic property manager. More...
 

Constructor & Destructor Documentation

◆ PDSS_HKFT()

PDSS_HKFT ( )

Default Constructor.

Definition at line 23 of file PDSS_HKFT.cpp.

Member Function Documentation

◆ enthalpy_mole()

double enthalpy_mole ( ) const
overridevirtual

Return the molar enthalpy in units of J kmol-1.

Returns
the species standard state enthalpy in J kmol-1 at the current temperature and pressure.

Reimplemented from PDSS.

Definition at line 29 of file PDSS_HKFT.cpp.

◆ intEnergy_mole()

double intEnergy_mole ( ) const
overridevirtual

Return the molar internal Energy in units of J kmol-1.

Returns
The species standard state internal Energy in J kmol-1 at the current temperature and pressure.

Reimplemented from PDSS.

Definition at line 36 of file PDSS_HKFT.cpp.

◆ entropy_mole()

double entropy_mole ( ) const
overridevirtual

Return the molar entropy in units of J kmol-1 K-1.

Returns
The species standard state entropy in J kmol-1 K-1 at the current temperature and pressure.

Reimplemented from PDSS.

Definition at line 41 of file PDSS_HKFT.cpp.

◆ gibbs_mole()

double gibbs_mole ( ) const
overridevirtual

Return the molar Gibbs free energy in units of J kmol-1.

Returns
The species standard state Gibbs free energy in J kmol-1 at the current temperature and pressure.

Reimplemented from PDSS.

Definition at line 46 of file PDSS_HKFT.cpp.

◆ cp_mole()

double cp_mole ( ) const
overridevirtual

Return the molar const pressure heat capacity in units of J kmol-1 K-1.

Returns
The species standard state Cp in J kmol-1 K-1 at the current temperature and pressure.

Reimplemented from PDSS.

Definition at line 51 of file PDSS_HKFT.cpp.

◆ molarVolume()

double molarVolume ( ) const
overridevirtual

Return the molar volume at standard state.

Returns
The standard state molar volume at the current temperature and pressure. Units are m**3 kmol-1.

Reimplemented from PDSS.

Definition at line 107 of file PDSS_HKFT.cpp.

◆ density()

double density ( ) const
overridevirtual

Return the standard state density at standard state.

Returns
The standard state density at the current temperature and pressure. units are kg m-3

Reimplemented from PDSS.

Definition at line 150 of file PDSS_HKFT.cpp.

◆ gibbs_RT_ref()

double gibbs_RT_ref ( ) const
overridevirtual

Return the molar Gibbs free energy divided by RT at reference pressure.

Returns
The reference state Gibbs free energy at the current temperature, divided by RT.

Reimplemented from PDSS.

Definition at line 155 of file PDSS_HKFT.cpp.

◆ enthalpy_RT_ref()

double enthalpy_RT_ref ( ) const
overridevirtual

Return the molar enthalpy divided by RT at reference pressure.

Returns
The species reference state enthalpy at the current temperature, divided by RT.

Reimplemented from PDSS.

Definition at line 164 of file PDSS_HKFT.cpp.

◆ entropy_R_ref()

double entropy_R_ref ( ) const
overridevirtual

Return the molar entropy divided by R at reference pressure.

Returns
The species reference state entropy at the current temperature, divided by R.

Reimplemented from PDSS.

Definition at line 173 of file PDSS_HKFT.cpp.

◆ cp_R_ref()

double cp_R_ref ( ) const
overridevirtual

Return the molar heat capacity divided by R at reference pressure.

Returns
The species reference state heat capacity divided by R at the current temperature.

Reimplemented from PDSS.

Definition at line 182 of file PDSS_HKFT.cpp.

◆ molarVolume_ref()

double molarVolume_ref ( ) const
overridevirtual

Return the molar volume at reference pressure.

Returns
The reference state molar volume. units are m**3 kmol-1.

Reimplemented from PDSS.

Definition at line 191 of file PDSS_HKFT.cpp.

◆ setState_TP()

void setState_TP ( double  temp,
double  pres 
)
overridevirtual

Set the internal temperature and pressure.

Parameters
tempTemperature (Kelvin)
prespressure (Pascals)

Reimplemented from PDSS.

Definition at line 200 of file PDSS_HKFT.cpp.

◆ setParent()

void setParent ( VPStandardStateTP phase,
size_t  k 
)
inlineoverridevirtual

Set the parent VPStandardStateTP object of this PDSS object.

This information is only used by certain PDSS subclasses

Parameters
phasePointer to the parent phase
kIndex of this species in the phase

Reimplemented from PDSS.

Definition at line 71 of file PDSS_HKFT.h.

◆ initThermo()

void initThermo ( )
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.

◆ setDeltaH0()

void setDeltaH0 ( double  dh0)

Set enthalpy of formation at Pr, Tr [J/kmol].

Definition at line 315 of file PDSS_HKFT.cpp.

◆ setDeltaG0()

void setDeltaG0 ( double  dg0)

Set Gibbs free energy of formation at Pr, Tr [J/kmol].

Definition at line 319 of file PDSS_HKFT.cpp.

◆ setS0()

void setS0 ( double  s0)

Set entropy of formation at Pr, Tr [J/kmol/K].

Definition at line 323 of file PDSS_HKFT.cpp.

◆ set_a()

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.

◆ set_c()

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.

◆ setOmega()

void setOmega ( double  omega)

Set omega [J/kmol].

Definition at line 339 of file PDSS_HKFT.cpp.

◆ getParameters()

void getParameters ( AnyMap eosNode) const
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.

◆ deltaG()

double deltaG ( ) const
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.

◆ deltaS()

double deltaS ( ) const
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.

◆ ag()

double ag ( const double  temp,
const int  ifunc = 0 
) const
private

Internal formula for the calculation of a_g()

The output of this is in units of Angstroms

Parameters
tempTemperature (K)
ifuncparameters specifying the desired information
  • 0 function value
  • 1 derivative wrt temperature
  • 2 2nd derivative wrt temperature
  • 3 derivative wrt pressure

Definition at line 438 of file PDSS_HKFT.cpp.

◆ bg()

double bg ( const double  temp,
const int  ifunc = 0 
) const
private

Internal formula for the calculation of b_g()

the output of this is unitless

Parameters
tempTemperature (K)
ifuncparameters specifying the desired information
  • 0 function value
  • 1 derivative wrt temperature
  • 2 2nd derivative wrt temperature
  • 3 derivative wrt pressure

Definition at line 452 of file PDSS_HKFT.cpp.

◆ g()

double g ( const double  temp,
const double  pres,
const int  ifunc = 0 
) const
private

function g appearing in the formulation

Function \( g \) (Eqn. 49) appearing in the Johnson et al. [13] formulation.

Parameters
tempTemperature kelvin
presPressure (pascal)
ifuncparameters specifying the desired information
  • 0 function value
  • 1 derivative wrt temperature
  • 2 2nd derivative wrt temperature
  • 3 derivative wrt pressure

Definition at line 500 of file PDSS_HKFT.cpp.

◆ f()

double f ( const double  temp,
const double  pres,
const int  ifunc = 0 
) const
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).

Parameters
tempTemperature kelvin
presPressure (pascal)
ifuncparameters specifying the desired information
  • 0 function value
  • 1 derivative wrt temperature
  • 2 2nd derivative wrt temperature
  • 3 derivative wrt pressure

Definition at line 466 of file PDSS_HKFT.cpp.

◆ gstar()

double gstar ( const double  temp,
const double  pres,
const int  ifunc = 0 
) const
private

Evaluate the Gstar value appearing in the HKFT formulation.

Parameters
tempTemperature kelvin
presPressure (pascal)
ifuncparameters specifying the desired information
  • 0 function value
  • 1 derivative wrt temperature
  • 2 2nd derivative wrt temperature
  • 3 derivative wrt pressure

Definition at line 553 of file PDSS_HKFT.cpp.

◆ LookupGe()

double LookupGe ( const string &  elemName)
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.

Parameters
elemNameString. Only the first 3 characters are significant
Returns
value contains the Gibbs free energy for that element
Exceptions
CanteraErrorIf a match is not found, a CanteraError is thrown as well

Definition at line 561 of file PDSS_HKFT.cpp.

◆ convertDGFormation()

void convertDGFormation ( )
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.

Member Data Documentation

◆ m_tp

VPStandardStateTP* m_tp
private

Parent VPStandardStateTP (ThermoPhase) object.

Definition at line 100 of file PDSS_HKFT.h.

◆ m_spindex

size_t m_spindex
private

Index of this species within the parent phase.

Definition at line 101 of file PDSS_HKFT.h.

◆ m_waterSS

PDSS_Water* m_waterSS = nullptr
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.

◆ m_densWaterSS

double m_densWaterSS = -1.0
mutableprivate

density of standard-state water. internal temporary variable

Definition at line 218 of file PDSS_HKFT.h.

◆ m_waterProps

unique_ptr<WaterProps> m_waterProps
private

Pointer to the water property calculator.

Definition at line 221 of file PDSS_HKFT.h.

◆ m_deltaG_formation_tr_pr

double m_deltaG_formation_tr_pr = NAN
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.

◆ m_deltaH_formation_tr_pr

double m_deltaH_formation_tr_pr = NAN
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.

◆ m_Mu0_tr_pr

double m_Mu0_tr_pr = 0.0
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.

◆ m_Entrop_tr_pr

double m_Entrop_tr_pr = NAN
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.

◆ m_a1

double m_a1 = 0.0
private

Input a1 coefficient (cal gmol-1 bar-1)

Definition at line 257 of file PDSS_HKFT.h.

◆ m_a2

double m_a2 = 0.0
private

Input a2 coefficient (cal gmol-1)

Definition at line 260 of file PDSS_HKFT.h.

◆ m_a3

double m_a3 = 0.0
private

Input a3 coefficient (cal K gmol-1 bar-1)

Definition at line 263 of file PDSS_HKFT.h.

◆ m_a4

double m_a4 = 0.0
private

Input a4 coefficient (cal K gmol-1)

Definition at line 266 of file PDSS_HKFT.h.

◆ m_c1

double m_c1 = 0.0
private

Input c1 coefficient (cal gmol-1 K-1)

Definition at line 269 of file PDSS_HKFT.h.

◆ m_c2

double m_c2 = 0.0
private

Input c2 coefficient (cal K gmol-1)

Definition at line 272 of file PDSS_HKFT.h.

◆ m_omega_pr_tr

double m_omega_pr_tr = 0.0
private

Input omega_pr_tr coefficient(cal gmol-1)

Definition at line 275 of file PDSS_HKFT.h.

◆ m_Y_pr_tr

double m_Y_pr_tr = 0.0
private

y = dZdT = 1/(esp*esp) desp/dT at 298.15 and 1 bar

Definition at line 278 of file PDSS_HKFT.h.

◆ m_Z_pr_tr

double m_Z_pr_tr = 0.0
private

Z = -1 / relEpsilon at 298.15 and 1 bar.

Definition at line 281 of file PDSS_HKFT.h.

◆ m_presR_bar

double m_presR_bar = OneAtm * 1.0E-5
private

Reference pressure is 1 atm in units of bar= 1.0132.

Definition at line 284 of file PDSS_HKFT.h.

◆ m_domega_jdT_prtr

double m_domega_jdT_prtr = 0.0
private

small value that is not quite zero

Definition at line 287 of file PDSS_HKFT.h.

◆ m_charge_j

double m_charge_j = 0.0
private

Charge of the ion.

Definition at line 290 of file PDSS_HKFT.h.

◆ s_InputInconsistencyErrorExit

int s_InputInconsistencyErrorExit = 1
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.


The documentation for this class was generated from the following files: