Cantera
2.1.2
|
Manages standard state thermo properties for real water and a set of species which have the HKFT equation of state. More...
#include <VPSSMgr_Water_HKFT.h>
Public Member Functions | |
VPSSMgr_Water_HKFT (VPStandardStateTP *vptp_ptr, SpeciesThermo *spth) | |
Constructor. More... | |
VPSSMgr_Water_HKFT (const VPSSMgr_Water_HKFT &right) | |
Copy Constructor. More... | |
VPSSMgr_Water_HKFT & | operator= (const VPSSMgr_Water_HKFT &right) |
Assignment operator. More... | |
virtual VPSSMgr * | duplMyselfAsVPSSMgr () const |
Duplication routine for objects which derive from VPSSMgr. More... | |
virtual void | setState_TP (doublereal T, doublereal P) |
Set the temperature (K) and pressure (Pa) More... | |
virtual void | setState_T (doublereal T) |
Set the temperature (K) More... | |
virtual void | setState_P (doublereal P) |
Set the pressure (Pa) More... | |
virtual void | initAllPtrs (VPStandardStateTP *vp_ptr, SpeciesThermo *sp_ptr) |
Initialize the internal shallow pointers in this object. More... | |
Thermodynamic Values for the Species Reference States | |
There are also temporary variables for holding the species reference- state values of Cp, H, S, and V at the last temperature and reference pressure called. These functions are not recalculated if a new call is made using the previous temperature. All calculations are done within the routine _updateRefStateThermo(). | |
virtual void | getEnthalpy_RT_ref (doublereal *hrt) const |
virtual void | getGibbs_RT_ref (doublereal *grt) const |
virtual void | getGibbs_ref (doublereal *g) const |
virtual void | getEntropy_R_ref (doublereal *er) const |
virtual void | getCp_R_ref (doublereal *cpr) const |
virtual void | getStandardVolumes_ref (doublereal *vol) const |
Get the molar volumes of the species reference states at the current T and P_ref of the solution. More... | |
Utility Methods - Reports on various quantities | |
The following methods are used in the process of reporting various states and attributes | |
virtual PDSS_enumType | reportPDSSType (int index=-1) const |
This utility function reports the type of parameterization used for the species with index number index. More... | |
virtual VPSSMgr_enumType | reportVPSSMgrType () const |
This utility function reports the type of manager for the calculation of ss properties. More... | |
Initialization Methods - For Internal use (VPStandardState) | |
The following methods are used in the process of constructing the phase and setting its parameters from a specification in an input file. They are not normally used in application programs. To see how they are used, see files importCTML.cpp and ThermoFactory.cpp. | |
virtual void | initThermo () |
virtual void | initThermoXML (XML_Node &phaseNode, const std::string &id) |
Finalize the thermo after all species have been entered. More... | |
virtual PDSS * | createInstallPDSS (size_t k, const XML_Node &speciesNode, const XML_Node *const phaseNode_ptr) |
Install specific content for species k in the standard-state thermodynamic calculator and also create/return a PDSS object for that species. More... | |
Public Member Functions inherited from VPSSMgr | |
VPSSMgr (VPStandardStateTP *vptp_ptr, SpeciesThermo *spth=0) | |
Constructor. More... | |
virtual | ~VPSSMgr () |
Destructor. More... | |
VPSSMgr (const VPSSMgr &right) | |
Copy Constructor. More... | |
VPSSMgr & | operator= (const VPSSMgr &right) |
Assignment operator. More... | |
virtual void | getStandardChemPotentials (doublereal *mu) const |
Get the array of chemical potentials at unit activity. More... | |
virtual void | getGibbs_RT (doublereal *grt) const |
Get the nondimensional Gibbs functions for the species at their standard states of solution at the current T and P of the solution. More... | |
virtual void | getEnthalpy_RT (doublereal *hrt) const |
Get the nondimensional Enthalpy functions for the species at their standard states at the current T and P of the solution. More... | |
const vector_fp & | enthalpy_RT () const |
Return a reference to a vector of the molar enthalpies of the species in their standard states. More... | |
virtual void | getEntropy_R (doublereal *sr) const |
Get the array of nondimensional Enthalpy functions for the standard state species at the current T and P of the solution. More... | |
const vector_fp & | entropy_R () const |
Return a reference to a vector of the entropies of the species. More... | |
virtual void | getIntEnergy_RT (doublereal *urt) const |
Returns the vector of nondimensional internal Energies of the standard state at the current temperature and pressure of the solution for each species. More... | |
virtual void | getCp_R (doublereal *cpr) const |
Get the nondimensional Heat Capacities at constant pressure for the standard state of the species at the current T and P. More... | |
const vector_fp & | cp_R () const |
Return a reference to a vector of the constant pressure heat capacities of the species. More... | |
virtual void | getStandardVolumes (doublereal *vol) const |
Get the molar volumes of each species in their standard states at the current T and P of the solution. More... | |
virtual const vector_fp & | getStandardVolumes () const |
const vector_fp & | standardVolumes () const |
Return a reference to a vector of the species standard molar volumes. More... | |
const vector_fp & | Gibbs_RT_ref () const |
Return a reference to the vector of Gibbs free energies of the species. More... | |
virtual doublereal | minTemp (size_t k=npos) const |
Minimum temperature. More... | |
virtual doublereal | maxTemp (size_t k=npos) const |
Maximum temperature. More... | |
virtual doublereal | refPressure (size_t k=npos) const |
The reference-state pressure for the standard state. More... | |
doublereal | temperature () const |
Return the temperature stored in the object. More... | |
doublereal | pressure () const |
Return the pressure stored in the object. More... | |
SpeciesThermo * | SpeciesThermoMgr () |
Return the pointer to the reference-state Thermo calculator SpeciesThermo object. More... | |
virtual void | updateStandardStateThermo () |
Updates the internal standard state thermodynamic vectors at the current T and P of the solution. More... | |
void | initLengths () |
Initialize the lengths within the object. More... | |
void | installSTSpecies (size_t k, const XML_Node &speciesNode, const XML_Node *phaseNode_ptr) |
Install specific content for species k in the reference-state thermodynamic SpeciesManager object. More... | |
Private Attributes | |
PDSS_Water * | m_waterSS |
Shallow pointer to the water object. More... | |
doublereal | m_tlastRef |
Last reference temperature calculated. More... | |
Setting the Internal State of the System | |
All calls to change the internal state of the system's T and P are done through these routines These routine in turn call the following underlying virtual functions An important point to note is that between calls the assumption that the underlying PDSS objects will retain their set Temperatures and Pressure CAN NOT BE MADE. For efficiency reasons, we may twiddle these to get derivatives. | |
virtual void | updateRefStateThermo () const |
Updates the internal reference state thermodynamic vectors at the current T of the solution and the reference pressure. More... | |
virtual void | _updateRefStateThermo () const |
Updates the reference state thermodynamic functions at the current T of the solution and the reference pressure. More... | |
virtual void | _updateStandardStateThermo () |
Updates the standard state thermodynamic functions at the current T and P of the solution. More... | |
Manages standard state thermo properties for real water and a set of species which have the HKFT equation of state.
Definition at line 31 of file VPSSMgr_Water_HKFT.h.
VPSSMgr_Water_HKFT | ( | VPStandardStateTP * | vptp_ptr, |
SpeciesThermo * | spth | ||
) |
Constructor.
vptp_ptr | Pointer to the Variable pressure ThermoPhase object This object must have already been malloced. |
spth | Pointer to the optional SpeciesThermo object that will handle the calculation of the reference state thermodynamic coefficients. |
Definition at line 27 of file VPSSMgr_Water_HKFT.cpp.
References VPSSMgr::m_useTmpRefStateStorage, and VPSSMgr::m_useTmpStandardStateStorage.
Referenced by VPSSMgr_Water_HKFT::duplMyselfAsVPSSMgr().
VPSSMgr_Water_HKFT | ( | const VPSSMgr_Water_HKFT & | right | ) |
Copy Constructor.
Definition at line 37 of file VPSSMgr_Water_HKFT.cpp.
References VPSSMgr::m_useTmpRefStateStorage, and VPSSMgr::m_useTmpStandardStateStorage.
VPSSMgr_Water_HKFT & operator= | ( | const VPSSMgr_Water_HKFT & | right | ) |
Assignment operator.
Definition at line 49 of file VPSSMgr_Water_HKFT.cpp.
References VPSSMgr_Water_HKFT::m_tlastRef, VPSSMgr::m_vptp_ptr, VPSSMgr_Water_HKFT::m_waterSS, and VPSSMgr::operator=().
|
virtual |
Duplication routine for objects which derive from VPSSMgr.
This function can be used to duplicate objects derived from VPSSMgr even if the application only has a pointer to VPSSMgr to work with.
Reimplemented from VPSSMgr.
Definition at line 61 of file VPSSMgr_Water_HKFT.cpp.
References VPSSMgr_Water_HKFT::VPSSMgr_Water_HKFT().
|
virtual |
Returns the vector of nondimensional enthalpies of the reference state at the current temperature of the solution and the reference pressure for the species.
hrt | Output vector contains the nondimensional enthalpies of the reference state of the species length = m_kk, units = dimensionless. |
Reimplemented from VPSSMgr.
Definition at line 67 of file VPSSMgr_Water_HKFT.cpp.
References VPSSMgr::m_h0_RT, and VPSSMgr_Water_HKFT::updateRefStateThermo().
|
virtual |
Returns the vector of nondimensional Gibbs free energies of the reference state at the current temperature of the solution and the reference pressure for the species.
grt | Output vector contains the nondimensional Gibbs free energies of the reference state of the species length = m_kk, units = dimensionless. |
Reimplemented from VPSSMgr.
Definition at line 74 of file VPSSMgr_Water_HKFT.cpp.
References VPSSMgr::m_g0_RT, and VPSSMgr_Water_HKFT::updateRefStateThermo().
Referenced by VPSSMgr_Water_HKFT::getGibbs_ref().
|
virtual |
Returns the vector of the gibbs function of the reference state at the current temperature of the solution and the reference pressure for the species. units = J/kmol
g | Output vector contain the Gibbs free energies of the reference state of the species length = m_kk, units = J/kmol. |
Reimplemented from VPSSMgr.
Definition at line 81 of file VPSSMgr_Water_HKFT.cpp.
References Cantera::GasConstant, VPSSMgr_Water_HKFT::getGibbs_RT_ref(), VPSSMgr::m_kk, and VPSSMgr::m_tlast.
|
virtual |
Returns the vector of nondimensional entropies of the reference state at the current temperature of the solution and the reference pressure for the species.
er | Output vector contain the nondimensional entropies of the species in their reference states length: m_kk, units: dimensionless. |
Reimplemented from VPSSMgr.
Definition at line 91 of file VPSSMgr_Water_HKFT.cpp.
References VPSSMgr::m_s0_R, and VPSSMgr_Water_HKFT::updateRefStateThermo().
|
virtual |
Returns the vector of nondimensional constant pressure heat capacities of the reference state at the current temperature of the solution and reference pressure for the species.
cpr | Output vector contains the nondimensional heat capacities of the species in their reference states length: m_kk, units: dimensionless. |
Reimplemented from VPSSMgr.
Definition at line 98 of file VPSSMgr_Water_HKFT.cpp.
References VPSSMgr::m_cp0_R, and VPSSMgr_Water_HKFT::updateRefStateThermo().
|
virtual |
Get the molar volumes of the species reference states at the current T and P_ref of the solution.
units = m^3 / kmol
vol | Output vector containing the standard state volumes. Length: m_kk. |
Reimplemented from VPSSMgr.
Definition at line 105 of file VPSSMgr_Water_HKFT.cpp.
References VPSSMgr::m_V0, and VPSSMgr_Water_HKFT::updateRefStateThermo().
|
virtual |
Set the temperature (K) and pressure (Pa)
This sets the temperature and pressure and triggers calculation of underlying quantities
T | Temperature (K) |
P | Pressure (Pa) |
Reimplemented from VPSSMgr.
Definition at line 127 of file VPSSMgr_Water_HKFT.cpp.
References VPSSMgr_Water_HKFT::_updateStandardStateThermo(), VPSSMgr::m_plast, and VPSSMgr::m_tlast.
|
virtual |
Set the temperature (K)
T | Temperature (K) |
Reimplemented from VPSSMgr.
Definition at line 119 of file VPSSMgr_Water_HKFT.cpp.
References VPSSMgr_Water_HKFT::_updateStandardStateThermo(), and VPSSMgr::m_tlast.
|
virtual |
Set the pressure (Pa)
P | Pressure (Pa) |
Reimplemented from VPSSMgr.
Definition at line 111 of file VPSSMgr_Water_HKFT.cpp.
References VPSSMgr_Water_HKFT::_updateStandardStateThermo(), and VPSSMgr::m_plast.
|
virtual |
Updates the internal reference state thermodynamic vectors at the current T of the solution and the reference pressure.
If you are to peek internally inside the object, you need to call these functions after setState functions in order to be sure that the vectors are current.
Reimplemented from VPSSMgr.
Definition at line 139 of file VPSSMgr_Water_HKFT.cpp.
References VPSSMgr_Water_HKFT::_updateRefStateThermo(), VPSSMgr::m_tlast, and VPSSMgr_Water_HKFT::m_tlastRef.
Referenced by VPSSMgr_Water_HKFT::getCp_R_ref(), VPSSMgr_Water_HKFT::getEnthalpy_RT_ref(), VPSSMgr_Water_HKFT::getEntropy_R_ref(), VPSSMgr_Water_HKFT::getGibbs_RT_ref(), and VPSSMgr_Water_HKFT::getStandardVolumes_ref().
|
privatevirtual |
Updates the reference state thermodynamic functions at the current T of the solution and the reference pressure.
Underscore updates never check for the state of the system They just do the calculation.
Reimplemented from VPSSMgr.
Definition at line 147 of file VPSSMgr_Water_HKFT.cpp.
References PDSS_Water::cp_mole(), PDSS::cp_R(), PDSS_Water::density(), PDSS_Water::enthalpy_mole(), PDSS_HKFT::enthalpy_RT(), PDSS_HKFT::entropy_mole(), PDSS_Water::entropy_mole(), Cantera::GasConstant, PDSS::gibbs_RT(), VPSSMgr::m_cp0_R, VPSSMgr::m_g0_RT, VPSSMgr::m_h0_RT, VPSSMgr::m_hss_RT, VPSSMgr::m_kk, VPSSMgr::m_p0, VPSSMgr::m_plast, VPSSMgr::m_s0_R, VPSSMgr::m_sss_R, VPSSMgr::m_tlast, VPSSMgr::m_V0, VPSSMgr::m_vptp_ptr, VPSSMgr_Water_HKFT::m_waterSS, PDSS_HKFT::molarVolume(), Phase::molecularWeight(), PDSS_Water::pref_safe(), PDSS_HKFT::setState_TP(), and PDSS_Water::setState_TP().
Referenced by VPSSMgr_Water_HKFT::updateRefStateThermo().
|
privatevirtual |
Updates the standard state thermodynamic functions at the current T and P of the solution.
If m_useTmpStandardStateStorage is true, this function must be called for every call to functions in this class. It checks to see whether the temperature or pressure has changed and thus the ss thermodynamics functions for all of the species must be recalculated.
This function is responsible for updating the following internal members, when m_useTmpStandardStateStorage is true.
If m_useTmpStandardStateStorage is not true, this function may be required to be called by child classes to update internal member data.
Note, the base class implementation will throw an error. It must be reimplemented in derived classes.
Underscore updates never check for the state of the system They just do the calculation.
Reimplemented from VPSSMgr.
Definition at line 181 of file VPSSMgr_Water_HKFT.cpp.
References PDSS_Water::cp_mole(), PDSS::cp_R(), PDSS_Water::density(), PDSS_Water::enthalpy_mole(), PDSS_Water::entropy_mole(), PDSS::entropy_R(), Cantera::GasConstant, PDSS::gibbs_RT(), VPSSMgr::m_cpss_R, VPSSMgr::m_gss_RT, VPSSMgr::m_hss_RT, VPSSMgr::m_kk, VPSSMgr::m_plast, VPSSMgr::m_sss_R, VPSSMgr::m_tlast, VPSSMgr::m_vptp_ptr, VPSSMgr::m_Vss, VPSSMgr_Water_HKFT::m_waterSS, PDSS_HKFT::molarVolume(), Phase::molecularWeight(), PDSS_HKFT::setState_TP(), and PDSS_Water::setState_TP().
Referenced by VPSSMgr_Water_HKFT::setState_P(), VPSSMgr_Water_HKFT::setState_T(), and VPSSMgr_Water_HKFT::setState_TP().
|
virtual |
This utility function reports the type of parameterization used for the species with index number index.
The following methods are used in the process of reporting various states and attributes
index | Species index |
Reimplemented from VPSSMgr.
Definition at line 314 of file VPSSMgr_Water_HKFT.cpp.
|
virtual |
This utility function reports the type of manager for the calculation of ss properties.
Reimplemented from VPSSMgr.
Definition at line 319 of file VPSSMgr_Water_HKFT.cpp.
References Cantera::cVPSSMGR_WATER_HKFT.
|
virtual |
Initialize the object
This method is provided to allow subclasses to perform any initialization required after all species have been added. For example, it might be used to resize internal work arrays that must have an entry for each species. The base class implementation does nothing, and subclasses that do not require initialization do not need to overload this method. When importing a CTML phase description, this method is called just prior to returning from function importPhase().
Reimplemented from VPSSMgr.
Definition at line 203 of file VPSSMgr_Water_HKFT.cpp.
References VPSSMgr::initThermo().
|
virtual |
Finalize the thermo after all species have been entered.
This function is the LAST initialization routine to be called. It's called after createInstallPDSS() has been called for each species in the phase, and after initThermo() has been called. It's called via an inner-to-outer onion shell like manner.
In this routine, we currently calculate the reference pressure, the minimum and maximum temperature for the applicability of the thermo formulation.
phaseNode | Reference to the phaseNode XML node. |
id | ID of the phase. |
Reimplemented from VPSSMgr.
Definition at line 210 of file VPSSMgr_Water_HKFT.cpp.
References XML_Node::child(), PDSS_Water::density(), XML_Node::findByAttr(), XML_Node::findByName(), Cantera::get_XML_NameID(), VPSSMgr::initThermoXML(), Cantera::lowercase(), VPSSMgr::m_kk, VPSSMgr::m_vptp_ptr, VPSSMgr::m_Vss, VPSSMgr_Water_HKFT::m_waterSS, Phase::molecularWeight(), Cantera::OneAtm, XML_Node::root(), PDSS_Water::setState_TP(), and Phase::speciesNames().
|
virtual |
Install specific content for species k in the standard-state thermodynamic calculator and also create/return a PDSS object for that species.
This occurs before matrices are sized appropriately.
k | Species index in the phase |
speciesNode | XML Node corresponding to the species |
phaseNode_ptr | Pointer to the XML Node corresponding to the phase which owns the species |
Reimplemented from VPSSMgr.
Definition at line 243 of file VPSSMgr_Water_HKFT.cpp.
References XML_Node::findByName(), GeneralSpeciesThermo::installPDSShandler(), VPSSMgr::m_spthermo, VPSSMgr::m_vptp_ptr, and VPSSMgr_Water_HKFT::m_waterSS.
|
virtual |
Initialize the internal shallow pointers in this object.
There are a bunch of internal shallow pointers that point to the owning VPStandardStateTP and SpeciesThermo objects. This function reinitializes them. This function is called like an onion.
vp_ptr | Pointer to the VPStandardStateTP standard state |
sp_ptr | Pointer to the SpeciesThermo standard state |
Reimplemented from VPSSMgr.
Definition at line 303 of file VPSSMgr_Water_HKFT.cpp.
References VPSSMgr::initAllPtrs(), VPSSMgr::m_vptp_ptr, and VPSSMgr_Water_HKFT::m_waterSS.
|
private |
Shallow pointer to the water object.
Definition at line 135 of file VPSSMgr_Water_HKFT.h.
Referenced by VPSSMgr_Water_HKFT::_updateRefStateThermo(), VPSSMgr_Water_HKFT::_updateStandardStateThermo(), VPSSMgr_Water_HKFT::createInstallPDSS(), VPSSMgr_Water_HKFT::initAllPtrs(), VPSSMgr_Water_HKFT::initThermoXML(), and VPSSMgr_Water_HKFT::operator=().
|
mutableprivate |
Last reference temperature calculated.
Reference state calculations are totally separated from standard state calculations.
Definition at line 142 of file VPSSMgr_Water_HKFT.h.
Referenced by VPSSMgr_Water_HKFT::operator=(), and VPSSMgr_Water_HKFT::updateRefStateThermo().