Cantera
2.3.0
|
Class for pressure dependent standard states that uses a standard state volume model of some sort. More...
#include <PDSS_SSVol.h>
Public Member Functions | |
Constructors | |
PDSS_SSVol (VPStandardStateTP *tp, size_t spindex) | |
Constructor. More... | |
PDSS_SSVol (VPStandardStateTP *tp, size_t spindex, const std::string &inputFile, const std::string &id="") | |
Constructor that initializes the object by examining the input file of the ThermoPhase object. More... | |
PDSS_SSVol (VPStandardStateTP *vptp_ptr, size_t spindex, const XML_Node &speciesNode, const XML_Node &phaseRef, bool spInstalled) | |
Constructor that initializes the object by examining the input file of the ThermoPhase object. More... | |
PDSS_SSVol (const PDSS_SSVol &b) | |
PDSS_SSVol & | operator= (const PDSS_SSVol &b) |
virtual PDSS * | duplMyselfAsPDSS () const |
Duplication routine for objects which inherit from PDSS. More... | |
Molar Thermodynamic Properties of the Species Standard State in the Solution | |
virtual doublereal | enthalpy_RT () const |
Return the standard state molar enthalpy divided by RT. More... | |
virtual doublereal | intEnergy_mole () const |
Return the molar internal Energy in units of J kmol-1. More... | |
virtual doublereal | entropy_R () const |
Return the standard state entropy divided by RT. More... | |
virtual doublereal | gibbs_RT () const |
Return the molar Gibbs free energy divided by RT. More... | |
virtual doublereal | cp_R () const |
Return the molar const pressure heat capacity divided by RT. More... | |
virtual doublereal | cv_mole () const |
Return the molar const volume heat capacity in units of J kmol-1 K-1. More... | |
virtual doublereal | molarVolume () const |
Return the molar volume at standard state. More... | |
virtual doublereal | density () const |
Return the standard state density at standard state. More... | |
Properties of the Reference State of the Species in the Solution | |
virtual doublereal | gibbs_RT_ref () const |
Return the molar Gibbs free energy divided by RT at reference pressure. More... | |
virtual doublereal | enthalpy_RT_ref () const |
Return the molar enthalpy divided by RT at reference pressure. More... | |
virtual doublereal | entropy_R_ref () const |
Return the molar entropy divided by R at reference pressure. More... | |
virtual doublereal | cp_R_ref () const |
Return the molar heat capacity divided by R at reference pressure. More... | |
virtual doublereal | molarVolume_ref () const |
Return the molar volume at reference pressure. More... | |
Public Member Functions inherited from PDSS_Nondimensional | |
virtual doublereal | enthalpy_mole () const |
Return the molar enthalpy in units of J kmol-1. More... | |
virtual doublereal | entropy_mole () const |
Return the molar entropy in units of J kmol-1 K-1. More... | |
virtual doublereal | gibbs_mole () const |
Return the molar Gibbs free energy in units of J kmol-1. More... | |
virtual doublereal | cp_mole () const |
Return the molar const pressure heat capacity in units of J kmol-1 K-1. More... | |
Public Member Functions inherited from PDSS | |
PDSS () | |
Empty Constructor. More... | |
PDSS (VPStandardStateTP *tp, size_t spindex) | |
Constructor that initializes the object by examining the XML entries from the ThermoPhase object. More... | |
PDSS (const PDSS &b) | |
PDSS & | operator= (const PDSS &b) |
virtual | ~PDSS () |
PDSS_enumType | reportPDSSType () const |
Returns the type of the standard state parameterization. More... | |
virtual doublereal | enthalpyDelp_mole () const |
Get the difference in the standard state enthalpy between the current pressure and the reference pressure, p0. More... | |
virtual doublereal | entropyDelp_mole () const |
Get the difference in the standard state entropy between the current pressure and the reference pressure, p0. More... | |
virtual doublereal | gibbsDelp_mole () const |
Get the difference in the standard state Gibbs free energy between the current pressure and the reference pressure, p0. More... | |
virtual doublereal | cpDelp_mole () const |
Get the difference in standard state heat capacity between the current pressure and the reference pressure, p0. More... | |
doublereal | refPressure () const |
Return the reference pressure for this phase. More... | |
doublereal | minTemp () const |
return the minimum temperature More... | |
doublereal | maxTemp () const |
return the minimum temperature More... | |
virtual doublereal | pressure () const |
Returns the pressure (Pa) More... | |
virtual doublereal | thermalExpansionCoeff () const |
Return the volumetric thermal expansion coefficient. Units: 1/K. More... | |
virtual doublereal | temperature () const |
Return the current stored temperature. More... | |
virtual doublereal | critTemperature () const |
critical temperature More... | |
virtual doublereal | critPressure () const |
critical pressure More... | |
virtual doublereal | critDensity () const |
critical density More... | |
doublereal | molecularWeight () const |
Return the molecular weight of the species in units of kg kmol-1. More... | |
void | setMolecularWeight (doublereal mw) |
Set the molecular weight of the species. More... | |
virtual void | reportParams (size_t &kindex, int &type, doublereal *const c, doublereal &minTemp, doublereal &maxTemp, doublereal &refPressure) const |
This utility function reports back the type of parameterization and all of the parameters for the species, index. More... | |
virtual void | initAllPtrs (VPStandardStateTP *vptp_ptr, VPSSMgr *vpssmgr_ptr, MultiSpeciesThermo *spthermo_ptr) |
Initialize or Reinitialize all shallow pointers in the object. More... | |
Private Types | |
enum | SSVolume_Model { constant = 0, tpoly, density_tpoly } |
Types of general formulations for the specification of the standard state volume. More... | |
Private Member Functions | |
void | calcMolarVolume () const |
Does the internal calculation of the volume. More... | |
Mechanical Equation of State Properties | |
virtual void | setPressure (doublereal pres) |
Sets the pressure in the object. More... | |
virtual void | setTemperature (doublereal temp) |
Set the internal temperature. More... | |
virtual void | setState_TP (doublereal temp, doublereal pres) |
Set the internal temperature and pressure. More... | |
virtual void | setState_TR (doublereal temp, doublereal rho) |
Set the internal temperature and density. More... | |
Miscellaneous properties of the standard state | |
virtual doublereal | satPressure (doublereal t) |
saturation pressure More... | |
Initialization of the Object | |
virtual void | initThermo () |
Initialization routine for all of the shallow pointers. More... | |
void | constructPDSSFile (VPStandardStateTP *vptp_ptr, size_t spindex, const std::string &inputFile, const std::string &id) |
Initialization of a PDSS object using an input XML file. More... | |
void | constructPDSSXML (VPStandardStateTP *vptp_ptr, size_t spindex, const XML_Node &speciesNode, const XML_Node &phaseNode, bool spInstalled) |
Initialization of a PDSS object using an XML tree. More... | |
virtual void | initThermoXML (const XML_Node &phaseNode, const std::string &id) |
Initialization routine for the PDSS object based on the phaseNode. More... | |
Private Attributes | |
SSVolume_Model | volumeModel_ |
Enumerated data type describing the type of volume model used to calculate the standard state volume of the species. More... | |
doublereal | m_constMolarVolume |
Value of the constant molar volume for the species. More... | |
vector_fp | TCoeff_ |
coefficients for the temperature representation More... | |
doublereal | dVdT_ |
Derivative of the volume wrt temperature. More... | |
doublereal | d2VdT2_ |
2nd derivative of the volume wrt temperature More... | |
Additional Inherited Members | |
Protected Attributes inherited from PDSS | |
PDSS_enumType | m_pdssType |
Enumerated type describing the type of the PDSS object. More... | |
doublereal | m_temp |
Current temperature used by the PDSS object. More... | |
doublereal | m_pres |
State of the system - pressure. More... | |
doublereal | m_p0 |
Reference state pressure of the species. More... | |
doublereal | m_minTemp |
Minimum temperature. More... | |
doublereal | m_maxTemp |
Maximum temperature. More... | |
VPStandardStateTP * | m_tp |
ThermoPhase which this species belongs to. More... | |
VPSSMgr * | m_vpssmgr_ptr |
Pointer to the VPSS manager for this object. More... | |
doublereal | m_mw |
Molecular Weight of the species. More... | |
size_t | m_spindex |
Species index in the ThermoPhase corresponding to this species. More... | |
MultiSpeciesThermo * | m_spthermo |
Pointer to the species thermodynamic property manager. More... | |
doublereal * | m_h0_RT_ptr |
Reference state enthalpy divided by RT. More... | |
doublereal * | m_cp0_R_ptr |
Reference state heat capacity divided by R. More... | |
doublereal * | m_s0_R_ptr |
Reference state entropy divided by R. More... | |
doublereal * | m_g0_RT_ptr |
Reference state Gibbs free energy divided by RT. More... | |
doublereal * | m_V0_ptr |
Reference state molar volume (m3 kg-1) More... | |
doublereal * | m_hss_RT_ptr |
Standard state enthalpy divided by RT. More... | |
doublereal * | m_cpss_R_ptr |
Standard state heat capacity divided by R. More... | |
doublereal * | m_sss_R_ptr |
Standard state entropy divided by R. More... | |
doublereal * | m_gss_RT_ptr |
Standard state Gibbs free energy divided by RT. More... | |
doublereal * | m_Vss_ptr |
Standard State molar volume (m3 kg-1) More... | |
Class for pressure dependent standard states that uses a standard state volume model of some sort.
Class PDSS_SSVol is an implementation class that compute the properties of a single species in a phase at its standard states, for a range of temperatures and pressures. This particular class assumes that the calculation of the thermodynamics functions can be separated into a temperature polynomial representation for thermo functions that can be handled bey a SimpleThermo object and a separate calculation for the standard state volume. The Models include a cubic polynomial in temperature for either the standard state volume or the standard state density. The manager uses a SimpleThermo object to handle the calculation of the reference state. This object then adds the pressure dependencies and the volume terms to these thermo functions to complete the representation.
The class includes the following models for the representation of the standard state volume:
\[ V^o_k(T,P) = a_0 \]
\[ V^o_k(T,P) = a_0 + a_1 T + a_2 T^2 + a_3 T^3 + a_4 T^4 \]
\[ {\rho}^o_k(T,P) = \frac{M_k}{V^o_k(T,P)} = a_0 + a_1 T + a_2 T^2 + a_3 T^3 + a_4 T^4 \]
The standard molar Gibbs free energy for species k is determined from the enthalpy and entropy expressions
\[ G^o_k(T,P) = H^o_k(T,P) - S^o_k(T,P) \]
The enthalpy is calculated mostly from the MultiSpeciesThermo object's enthalpy evaluator. The dependence on pressure originates from the Maxwell relation
\[ {\left(\frac{dH^o_k}{dP}\right)}_T = T {\left(\frac{dS^o_k}{dP}\right)}_T + V^o_k \]
which is equal to
\[ {\left(\frac{dH^o_k}{dP}\right)}_T = V^o_k - T {\left(\frac{dV^o_k}{dT}\right)}_P \]
The entropy is calculated mostly from the MultiSpeciesThermo objects entropy evaluator. The dependence on pressure originates from the Maxwell relation:
\[ {\left(\frac{dS^o_k}{dP}\right)}_T = - {\left(\frac{dV^o_k}{dT}\right)}_P \]
The standard state constant-pressure heat capacity expression is obtained from taking the temperature derivative of the Maxwell relation involving the enthalpy given above to yield an expression for the pressure dependence of the heat capacity.
\[ {\left(\frac{d{C}^o_{p,k}}{dP}\right)}_T = - T {\left(\frac{{d}^2{V}^o_k}{{dT}^2}\right)}_T \]
The standard molar Internal Energy for species k is determined from the following relation.
\[ U^o_k(T,P) = H^o_k(T,P) - p V^o_k \]
An example of the specification of a standard state for the LiCl molten salt which employs a constant molar volume expression.
An example of the specification of a standard state for the LiCl molten salt which has a temperature dependent standard state volume.
Definition at line 163 of file PDSS_SSVol.h.
|
strongprivate |
Types of general formulations for the specification of the standard state volume.
Definition at line 304 of file PDSS_SSVol.h.
PDSS_SSVol | ( | VPStandardStateTP * | tp, |
size_t | spindex | ||
) |
Constructor.
tp | Pointer to the ThermoPhase object pertaining to the phase |
spindex | Species index of the species in the phase |
Definition at line 18 of file PDSS_SSVol.cpp.
References PDSS::m_pdssType, and PDSS_SSVol::TCoeff_.
Referenced by PDSS_SSVol::duplMyselfAsPDSS().
PDSS_SSVol | ( | VPStandardStateTP * | tp, |
size_t | spindex, | ||
const std::string & | inputFile, | ||
const std::string & | id = "" |
||
) |
Constructor that initializes the object by examining the input file of the ThermoPhase object.
This function calls the constructPDSSFile member function.
tp | Pointer to the ThermoPhase object pertaining to the phase |
spindex | Species index of the species in the phase |
inputFile | String name of the input file |
id | String name of the phase in the input file. The default is the empty string, in which case the first phase in the file is used. |
Definition at line 29 of file PDSS_SSVol.cpp.
References PDSS_SSVol::constructPDSSFile(), PDSS::m_pdssType, and Cantera::warn_deprecated().
PDSS_SSVol | ( | VPStandardStateTP * | vptp_ptr, |
size_t | spindex, | ||
const XML_Node & | speciesNode, | ||
const XML_Node & | phaseRef, | ||
bool | spInstalled | ||
) |
Constructor that initializes the object by examining the input file of the ThermoPhase object.
This function calls the constructPDSSXML member function.
vptp_ptr | Pointer to the ThermoPhase object pertaining to the phase |
spindex | Species index of the species in the phase |
speciesNode | Reference to the species XML tree. |
phaseRef | Reference to the XML tree containing the phase information. |
spInstalled | Boolean indicating whether the species is installed yet or not. |
Definition at line 41 of file PDSS_SSVol.cpp.
References PDSS_SSVol::constructPDSSXML(), and PDSS::m_pdssType.
|
virtual |
Duplication routine for objects which inherit from PDSS.
This function can be used to duplicate objects derived from PDSS even if the application only has a pointer to PDSS to work with.
Reimplemented from PDSS.
Definition at line 75 of file PDSS_SSVol.cpp.
References PDSS_SSVol::PDSS_SSVol().
|
virtual |
Return the standard state molar enthalpy divided by RT.
Reimplemented from PDSS.
Definition at line 165 of file PDSS_SSVol.cpp.
References PDSS::m_hss_RT_ptr, and PDSS::m_spindex.
|
virtual |
Return the molar internal Energy in units of J kmol-1.
Reimplemented from PDSS.
Definition at line 170 of file PDSS_SSVol.cpp.
References Cantera::GasConstant, PDSS::m_h0_RT_ptr, PDSS::m_pres, PDSS::m_spindex, PDSS::m_temp, and PDSS::m_Vss_ptr.
|
virtual |
Return the standard state entropy divided by RT.
Reimplemented from PDSS.
Definition at line 176 of file PDSS_SSVol.cpp.
References PDSS::m_spindex, and PDSS::m_sss_R_ptr.
|
virtual |
Return the molar Gibbs free energy divided by RT.
Reimplemented from PDSS.
Definition at line 181 of file PDSS_SSVol.cpp.
References PDSS::m_gss_RT_ptr, and PDSS::m_spindex.
|
virtual |
Return the molar const pressure heat capacity divided by RT.
Reimplemented from PDSS.
Definition at line 186 of file PDSS_SSVol.cpp.
References PDSS::m_cpss_R_ptr, and PDSS::m_spindex.
|
virtual |
Return the molar const volume heat capacity in units of J kmol-1 K-1.
Reimplemented from PDSS.
Definition at line 191 of file PDSS_SSVol.cpp.
References PDSS_Nondimensional::cp_mole(), PDSS::m_spindex, and PDSS::m_V0_ptr.
|
virtual |
Return the molar volume at standard state.
Reimplemented from PDSS.
Definition at line 196 of file PDSS_SSVol.cpp.
References PDSS::m_spindex, and PDSS::m_Vss_ptr.
|
virtual |
Return the standard state density at standard state.
Reimplemented from PDSS.
Definition at line 201 of file PDSS_SSVol.cpp.
References PDSS::m_mw, PDSS::m_spindex, and PDSS::m_Vss_ptr.
|
virtual |
Return the molar Gibbs free energy divided by RT at reference pressure.
Reimplemented from PDSS.
Definition at line 206 of file PDSS_SSVol.cpp.
References PDSS::m_g0_RT_ptr, and PDSS::m_spindex.
|
virtual |
Return the molar enthalpy divided by RT at reference pressure.
Reimplemented from PDSS.
Definition at line 211 of file PDSS_SSVol.cpp.
References PDSS::m_h0_RT_ptr, and PDSS::m_spindex.
|
virtual |
Return the molar entropy divided by R at reference pressure.
Reimplemented from PDSS.
Definition at line 216 of file PDSS_SSVol.cpp.
References PDSS::m_s0_R_ptr, and PDSS::m_spindex.
|
virtual |
Return the molar heat capacity divided by R at reference pressure.
Reimplemented from PDSS.
Definition at line 221 of file PDSS_SSVol.cpp.
References PDSS::m_cp0_R_ptr, and PDSS::m_spindex.
|
virtual |
Return the molar volume at reference pressure.
Reimplemented from PDSS.
Definition at line 226 of file PDSS_SSVol.cpp.
References PDSS::m_spindex, and PDSS::m_V0_ptr.
|
private |
Does the internal calculation of the volume.
Definition at line 231 of file PDSS_SSVol.cpp.
References PDSS_SSVol::constant, PDSS_SSVol::d2VdT2_, PDSS_SSVol::density_tpoly, PDSS_SSVol::dVdT_, PDSS_SSVol::m_constMolarVolume, PDSS::m_mw, PDSS::m_spindex, PDSS::m_temp, PDSS::m_Vss_ptr, PDSS_SSVol::TCoeff_, PDSS_SSVol::tpoly, and PDSS_SSVol::volumeModel_.
Referenced by PDSS_SSVol::setTemperature().
|
privatevirtual |
Sets the pressure in the object.
Currently, this sets the pressure in the PDSS object. It is indeterminant what happens to the owning VPStandardStateTP object and to the VPSSMgr object.
pres | Pressure to be set (Pascal) |
Reimplemented from PDSS.
Definition at line 252 of file PDSS_SSVol.cpp.
References PDSS::m_p0, and PDSS::m_pres.
|
privatevirtual |
Set the internal temperature.
temp | Temperature (Kelvin) |
Reimplemented from PDSS.
Definition at line 271 of file PDSS_SSVol.cpp.
References PDSS_SSVol::calcMolarVolume(), PDSS::m_cp0_R_ptr, PDSS::m_g0_RT_ptr, PDSS::m_h0_RT_ptr, PDSS::m_p0, PDSS::m_pres, PDSS::m_s0_R_ptr, PDSS::m_spindex, PDSS::m_spthermo, PDSS::m_temp, and MultiSpeciesThermo::update_one().
Referenced by PDSS_SSVol::setState_TP().
|
privatevirtual |
Set the internal temperature and pressure.
temp | Temperature (Kelvin) |
pres | pressure (Pascals) |
Reimplemented from PDSS.
Definition at line 293 of file PDSS_SSVol.cpp.
References PDSS::m_pres, and PDSS_SSVol::setTemperature().
|
privatevirtual |
Set the internal temperature and density.
temp | Temperature (Kelvin) |
rho | Density (kg m-3) |
Reimplemented from PDSS.
Definition at line 299 of file PDSS_SSVol.cpp.
References PDSS_SSVol::m_constMolarVolume, and PDSS::m_mw.
|
privatevirtual |
saturation pressure
T | Temperature (Kelvin) |
Reimplemented from PDSS.
Definition at line 309 of file PDSS_SSVol.cpp.
|
privatevirtual |
Initialization routine for all of the shallow pointers.
This is a cascading call, where each level should call the the parent level.
The initThermo() routines get called before the initThermoXML() routines from the constructPDSSXML() routine.
Calls initPtrs();
Reimplemented from PDSS.
Definition at line 157 of file PDSS_SSVol.cpp.
References PDSS::initThermo(), PDSS_SSVol::m_constMolarVolume, PDSS::m_p0, PDSS::m_spindex, PDSS::m_tp, PDSS::m_V0_ptr, PDSS::m_Vss_ptr, MultiSpeciesThermo::refPressure(), and ThermoPhase::speciesThermo().
|
private |
Initialization of a PDSS object using an input XML file.
This routine is a precursor to constructPDSSXML(XML_Node*) routine, which does most of the work.
vptp_ptr | Pointer to the Variable pressure ThermoPhase object |
spindex | Species index within the phase |
inputFile | XML file containing the description of the phase |
id | Optional parameter identifying the name of the phase. If none is given, the first XML phase element will be used. |
Definition at line 120 of file PDSS_SSVol.cpp.
References XML_Node::build(), XML_Node::child(), PDSS_SSVol::constructPDSSXML(), XML_Node::findByAttr(), Cantera::findInputFile(), Cantera::findXMLPhase(), Cantera::get_XML_NameID(), XML_Node::root(), Phase::speciesName(), and Cantera::warn_deprecated().
Referenced by PDSS_SSVol::PDSS_SSVol().
|
private |
Initialization of a PDSS object using an XML tree.
This routine is a driver for the initialization of the object.
basic logic:
vptp_ptr | Pointer to the Variable pressure ThermoPhase object |
spindex | Species index within the phase |
speciesNode | XML Node containing the species information |
phaseNode | Reference to the phase Information for the phase that owns this species. |
spInstalled | Boolean indicating whether the species is already installed. |
Definition at line 80 of file PDSS_SSVol.cpp.
References XML_Node::attrib(), PDSS_SSVol::constant, PDSS_SSVol::density_tpoly, XML_Node::findByName(), Cantera::getFloat(), Cantera::getFloatArray(), PDSS::initThermo(), PDSS_SSVol::m_constMolarVolume, PDSS::m_p0, PDSS::m_spindex, PDSS::m_tp, XML_Node::name(), MultiSpeciesThermo::refPressure(), ThermoPhase::speciesThermo(), PDSS_SSVol::TCoeff_, PDSS_SSVol::tpoly, and PDSS_SSVol::volumeModel_.
Referenced by PDSS_SSVol::constructPDSSFile(), and PDSS_SSVol::PDSS_SSVol().
|
privatevirtual |
Initialization routine for the PDSS object based on the phaseNode.
This is a cascading call, where each level should call the the parent level.
phaseNode | Reference to the phase Information for the phase that owns this species. |
id | Optional parameter identifying the name of the phase. If none is given, the first XML phase element will be used. |
Reimplemented from PDSS.
Definition at line 148 of file PDSS_SSVol.cpp.
References PDSS::initThermoXML(), PDSS::m_maxTemp, PDSS::m_minTemp, PDSS::m_mw, PDSS::m_p0, PDSS::m_spindex, PDSS::m_spthermo, PDSS::m_tp, MultiSpeciesThermo::maxTemp(), MultiSpeciesThermo::minTemp(), Phase::molecularWeight(), and MultiSpeciesThermo::refPressure().
|
private |
Enumerated data type describing the type of volume model used to calculate the standard state volume of the species.
Definition at line 323 of file PDSS_SSVol.h.
Referenced by PDSS_SSVol::calcMolarVolume(), and PDSS_SSVol::constructPDSSXML().
|
private |
Value of the constant molar volume for the species.
m3 / kmol
Definition at line 329 of file PDSS_SSVol.h.
Referenced by PDSS_SSVol::calcMolarVolume(), PDSS_SSVol::constructPDSSXML(), PDSS_SSVol::initThermo(), and PDSS_SSVol::setState_TR().
|
private |
coefficients for the temperature representation
Definition at line 332 of file PDSS_SSVol.h.
Referenced by PDSS_SSVol::calcMolarVolume(), PDSS_SSVol::constructPDSSXML(), and PDSS_SSVol::PDSS_SSVol().
|
mutableprivate |
Derivative of the volume wrt temperature.
Definition at line 335 of file PDSS_SSVol.h.
Referenced by PDSS_SSVol::calcMolarVolume().
|
mutableprivate |
2nd derivative of the volume wrt temperature
Definition at line 338 of file PDSS_SSVol.h.
Referenced by PDSS_SSVol::calcMolarVolume().