Cantera  2.3.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members

Class that handles the calculation of standard state thermo properties for a set of species belonging to a single phase in a completely general but slow way. More...

#include <VPSSMgr_General.h>

Inheritance diagram for VPSSMgr_General:
[legend]
Collaboration diagram for VPSSMgr_General:
[legend]

Public Member Functions

 VPSSMgr_General (VPStandardStateTP *vp_ptr, MultiSpeciesThermo *spth)
 Constructor. More...
 
 VPSSMgr_General (const VPSSMgr_General &right)
 
VPSSMgr_Generaloperator= (const VPSSMgr_General &right)
 
virtual VPSSMgrduplMyselfAsVPSSMgr () const
 Duplication routine for objects which derive from VPSSMgr. More...
 
virtual PDSScreateInstallPDSS (size_t k, const XML_Node &speciesNode, const XML_Node *const phaseNode_ptr)
 Factory routine for the creation of PDSS objects that are then internally registered with this VPSSMgr object. More...
 
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...
 
virtual void initAllPtrs (VPStandardStateTP *vp_ptr, MultiSpeciesThermo *sp_ptr)
 Initialize the internal shallow pointers in this object. More...
 
- Public Member Functions inherited from VPSSMgr
 VPSSMgr (VPStandardStateTP *vptp_ptr, MultiSpeciesThermo *spth=0)
 Constructor. More...
 
 VPSSMgr (const VPSSMgr &right)
 
VPSSMgroperator= (const VPSSMgr &right)
 
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_fpenthalpy_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_fpentropy_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_fpcp_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_fpgetStandardVolumes () const
 
const vector_fpstandardVolumes () const
 Return a reference to a vector of the species standard molar volumes. More...
 
virtual void getEnthalpy_RT_ref (doublereal *hrt) const
 
virtual void getGibbs_RT_ref (doublereal *grt) const
 
const vector_fpGibbs_RT_ref () const
 Return a reference to the vector of Gibbs free energies of the species. More...
 
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...
 
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...
 
void initLengths ()
 Initialize the lengths within the object. More...
 
virtual void initThermoXML (XML_Node &phaseNode, const std::string &id)
 Finalize the thermo after all species have been entered. 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...
 
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...
 
doublereal temperature () const
 Return the temperature stored in the object. More...
 
doublereal pressure () const
 Return the pressure stored in the object. More...
 
MultiSpeciesThermoSpeciesThermoMgr ()
 Return the pointer to the reference-state Thermo calculator MultiSpeciesThermo object. More...
 
virtual void updateStandardStateThermo ()
 Updates the internal standard state thermodynamic vectors at the current T and P of the solution. More...
 
virtual void updateRefStateThermo () const
 Updates the internal reference state thermodynamic vectors at the current T of the solution and the reference pressure. More...
 

Protected Member Functions

Properties of the Standard State of the Species in the Solution

Within VPStandardStateTP, these properties are calculated via a common routine, _updateStandardStateThermo(), which must be overloaded in inherited objects. The values are cached within this object, and are not recalculated unless the temperature or pressure changes.

virtual void _updateStandardStateThermo ()
 Updates the standard state thermodynamic functions at the current T and P of the solution. More...
 
virtual void _updateRefStateThermo () const
 Updates the reference state thermodynamic functions at the current T of the solution and the reference pressure. 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 getGibbs_ref (doublereal *g) const
 
Initialization Methods - For Internal use

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 importPhase().

virtual void initThermo ()
 
- Protected Member Functions inherited from VPSSMgr

Private Member Functions

PDSSreturnPDSS_ptr (size_t k, const XML_Node &speciesNode, const XML_Node *const phaseNode_ptr, bool &doST)
 Local factory routine for the creation of PDSS objects. More...
 

Private Attributes

std::vector< PDSS * > m_PDSS_ptrs
 Shallow pointers containing the PDSS objects for the species in this phase. More...
 

Additional Inherited Members

- Protected Attributes inherited from VPSSMgr
size_t m_kk
 Number of species in the phase. More...
 
VPStandardStateTPm_vptp_ptr
 Variable pressure ThermoPhase object. More...
 
MultiSpeciesThermom_spthermo
 Pointer to reference state thermo calculator. More...
 
doublereal m_tlast
 The last temperature at which the standard state thermodynamic properties were calculated at. More...
 
doublereal m_plast
 The last pressure at which the Standard State thermodynamic properties were calculated at. More...
 
doublereal m_p0
 Reference pressure (Pa) must be the same for all species - defaults to 1 atm. More...
 
doublereal m_minTemp
 minimum temperature for the standard state calculations More...
 
doublereal m_maxTemp
 maximum temperature for the standard state calculations More...
 
bool m_useTmpRefStateStorage
 boolean indicating whether temporary reference state storage is used -> default is false More...
 
vector_fp m_h0_RT
 Vector containing the species reference enthalpies at T = m_tlast and P = p_ref. More...
 
vector_fp m_cp0_R
 Vector containing the species reference constant pressure heat capacities at T = m_tlast and P = p_ref. More...
 
vector_fp m_g0_RT
 Vector containing the species reference Gibbs functions at T = m_tlast and P = p_ref. More...
 
vector_fp m_s0_R
 Vector containing the species reference entropies at T = m_tlast and P = p_ref. More...
 
vector_fp m_V0
 Vector containing the species reference molar volumes. More...
 
bool m_useTmpStandardStateStorage
 boolean indicating whether temporary standard state storage is used -> default is false More...
 
vector_fp m_hss_RT
 Vector containing the species Standard State enthalpies at T = m_tlast and P = m_plast. More...
 
vector_fp m_cpss_R
 Vector containing the species Standard State constant pressure heat capacities at T = m_tlast and P = m_plast. More...
 
vector_fp m_gss_RT
 Vector containing the species Standard State Gibbs functions at T = m_tlast and P = m_plast. More...
 
vector_fp m_sss_R
 Vector containing the species Standard State entropies at T = m_tlast and P = m_plast. More...
 
vector_fp m_Vss
 Vector containing the species standard state volumes at T = m_tlast and P = m_plast. More...
 
vector_fp mPDSS_h0_RT
 species reference enthalpies - used by individual PDSS objects More...
 
vector_fp mPDSS_cp0_R
 species reference heat capacities - used by individual PDSS objects More...
 
vector_fp mPDSS_g0_RT
 species reference Gibbs free energies - used by individual PDSS objects More...
 
vector_fp mPDSS_s0_R
 species reference entropies - used by individual PDSS objects More...
 
vector_fp mPDSS_V0
 species reference state molar Volumes - used by individual PDSS objects More...
 
vector_fp mPDSS_hss_RT
 species standard state enthalpies - used by individual PDSS objects More...
 
vector_fp mPDSS_cpss_R
 species standard state heat capacities - used by individual PDSS objects More...
 
vector_fp mPDSS_gss_RT
 species standard state Gibbs free energies - used by individual PDSS objects More...
 
vector_fp mPDSS_sss_R
 species standard state entropies - used by individual PDSS objects More...
 
vector_fp mPDSS_Vss
 species standard state molar Volumes - used by individual PDSS objects More...
 

Detailed Description

Class that handles the calculation of standard state thermo properties for a set of species belonging to a single phase in a completely general but slow way.

This class manages the calculation of standard state thermo properties for a set of species belonging to a single phase in a completely general but slow way. The way this does this is to call the underlying PDSS routines one at a time for every species.

Definition at line 31 of file VPSSMgr_General.h.

Constructor & Destructor Documentation

◆ VPSSMgr_General()

Constructor.

Parameters
vp_ptrPointer to the owning VPStandardStateTP object for the phase.
spthPointer to the MultiSpeciesThermo object for the phase.

Definition at line 29 of file VPSSMgr_General.cpp.

References VPSSMgr::m_useTmpRefStateStorage, and VPSSMgr::m_useTmpStandardStateStorage.

Referenced by VPSSMgr_General::duplMyselfAsVPSSMgr().

Member Function Documentation

◆ duplMyselfAsVPSSMgr()

VPSSMgr * duplMyselfAsVPSSMgr ( ) const
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.

Deprecated:
To be removed after Cantera 2.3 for all classes derived from VPSSMgr.

Reimplemented from VPSSMgr.

Definition at line 67 of file VPSSMgr_General.cpp.

References VPSSMgr_General::VPSSMgr_General().

◆ _updateStandardStateThermo()

void _updateStandardStateThermo ( )
protectedvirtual

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.

  • m_hss_RT;
  • m_cpss_R;
  • m_gss_RT;
  • m_sss_R;
  • m_Vss

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 99 of file VPSSMgr_General.cpp.

References PDSS::cp_R(), PDSS::enthalpy_RT(), PDSS::entropy_R(), VPSSMgr::m_cpss_R, VPSSMgr::m_gss_RT, VPSSMgr::m_hss_RT, VPSSMgr::m_kk, VPSSMgr_General::m_PDSS_ptrs, VPSSMgr::m_plast, VPSSMgr::m_sss_R, VPSSMgr::m_tlast, VPSSMgr::m_Vss, PDSS::molarVolume(), and PDSS::setState_TP().

◆ _updateRefStateThermo()

void _updateRefStateThermo ( ) const
protectedvirtual

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 84 of file VPSSMgr_General.cpp.

References PDSS::cp_R_ref(), PDSS::enthalpy_RT_ref(), PDSS::entropy_R_ref(), VPSSMgr::m_cp0_R, VPSSMgr::m_g0_RT, VPSSMgr::m_h0_RT, VPSSMgr::m_kk, VPSSMgr_General::m_PDSS_ptrs, VPSSMgr::m_plast, VPSSMgr::m_s0_R, VPSSMgr::m_tlast, VPSSMgr::m_useTmpRefStateStorage, VPSSMgr::m_V0, PDSS::molarVolume_ref(), and PDSS::setState_TP().

◆ getGibbs_ref()

void getGibbs_ref ( doublereal *  g) const
protectedvirtual

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

Parameters
gOutput 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 117 of file VPSSMgr_General.cpp.

References PDSS::enthalpy_RT_ref(), PDSS::entropy_R_ref(), Cantera::GasConstant, VPSSMgr::m_g0_RT, VPSSMgr::m_kk, VPSSMgr_General::m_PDSS_ptrs, VPSSMgr::m_plast, VPSSMgr::m_tlast, VPSSMgr::m_useTmpRefStateStorage, Cantera::scale(), and PDSS::setState_TP().

◆ initThermo()

void initThermo ( )
protectedvirtual

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 112 of file VPSSMgr_General.cpp.

References VPSSMgr::initLengths().

◆ returnPDSS_ptr()

PDSS * returnPDSS_ptr ( size_t  k,
const XML_Node speciesNode,
const XML_Node *const  phaseNode_ptr,
bool &  doST 
)
private

Local factory routine for the creation of PDSS objects.

This routine is specific to the VPSSMgr_General object. It will create a PDSS object for species k, by searching and querying for the "standardState" XML node in the standard state description of the species. If this XML node doesn't exist, it will assume that the standard state is an ideal gas. It decides on the attribute, "model", what PDSS object to create.

Parameters
speciesNodeXML node for the standard state of the species
kSpecies number
phaseNode_ptrpointer to the phase XML node
doSToutput variable indicating whether the instantiation has resulted in a MultiSpeciesThermo object being created and registered with the MultiSpeciesThermo manager class.
Returns
the pointer to a newly created PDSS object

Definition at line 133 of file VPSSMgr_General.cpp.

References XML_Node::attrib(), XML_Node::findByName(), MultiSpeciesThermo::installPDSShandler(), VPSSMgr::installSTSpecies(), VPSSMgr::m_spthermo, VPSSMgr::m_useTmpRefStateStorage, and VPSSMgr::m_vptp_ptr.

Referenced by VPSSMgr_General::createInstallPDSS().

◆ createInstallPDSS()

PDSS * createInstallPDSS ( size_t  k,
const XML_Node speciesNode,
const XML_Node *const  phaseNode_ptr 
)
virtual

Factory routine for the creation of PDSS objects that are then internally registered with this VPSSMgr object.

This function sets up the internal data within this object for handling the calculation of the standard state for the species.

This routine will create a PDSS object for species k, by searching and querying for the "standardState" XML node in the standard state description of the species. It will then store the object's pointer in a vector of pointers, and it will own the object.

Parameters
kSpecies number
speciesNodeXML node for the standard state of the species
phaseNode_ptrpointer to the phase XML node
Returns
the pointer to the newly created PDSS object

Reimplemented from VPSSMgr.

Definition at line 181 of file VPSSMgr_General.cpp.

References VPSSMgr::m_kk, VPSSMgr::m_maxTemp, VPSSMgr::m_minTemp, VPSSMgr::m_p0, VPSSMgr_General::m_PDSS_ptrs, PDSS::maxTemp(), PDSS::minTemp(), PDSS::refPressure(), and VPSSMgr_General::returnPDSS_ptr().

◆ reportPDSSType()

PDSS_enumType reportPDSSType ( int  index = -1) const
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

Parameters
indexSpecies index
Deprecated:
To be removed after Cantera 2.3.

Reimplemented from VPSSMgr.

Definition at line 200 of file VPSSMgr_General.cpp.

References VPSSMgr_General::m_PDSS_ptrs, and Cantera::warn_deprecated().

◆ reportVPSSMgrType()

VPSSMgr_enumType reportVPSSMgrType ( ) const
virtual

This utility function reports the type of manager for the calculation of ss properties.

Returns
an enum type called VPSSMgr_enumType, which is a list of the known VPSSMgr objects
Deprecated:
Unused. To be removed after Cantera 2.3.

Reimplemented from VPSSMgr.

Definition at line 207 of file VPSSMgr_General.cpp.

References Cantera::cVPSSMGR_GENERAL, and Cantera::warn_deprecated().

◆ initAllPtrs()

void initAllPtrs ( VPStandardStateTP vp_ptr,
MultiSpeciesThermo sp_ptr 
)
virtual

Initialize the internal shallow pointers in this object.

There are a bunch of internal shallow pointers that point to the owning VPStandardStateTP and MultiSpeciesThermo objects. This function reinitializes them. This function is called like an onion.

Parameters
vp_ptrPointer to the VPStandardStateTP standard state
sp_ptrPointer to the MultiSpeciesThermo standard state
Deprecated:
To be removed after Cantera 2.3 for all classes derived from VPSSMgr.

Reimplemented from VPSSMgr.

Definition at line 72 of file VPSSMgr_General.cpp.

References VPSSMgr::initAllPtrs(), VPSSMgr::m_kk, VPSSMgr_General::m_PDSS_ptrs, and VPSSMgr::m_vptp_ptr.

Member Data Documentation

◆ m_PDSS_ptrs

std::vector<PDSS*> m_PDSS_ptrs
private

Shallow pointers containing the PDSS objects for the species in this phase.

This object doesn't own these pointers.

Definition at line 131 of file VPSSMgr_General.h.

Referenced by VPSSMgr_General::_updateRefStateThermo(), VPSSMgr_General::_updateStandardStateThermo(), VPSSMgr_General::createInstallPDSS(), VPSSMgr_General::getGibbs_ref(), VPSSMgr_General::initAllPtrs(), and VPSSMgr_General::reportPDSSType().


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