Cantera
2.3.0
|
A species thermodynamic property manager for a phase. More...
#include <MultiSpeciesThermo.h>
Public Member Functions | |
MultiSpeciesThermo () | |
Constructor. More... | |
MultiSpeciesThermo (const MultiSpeciesThermo &b) | |
MultiSpeciesThermo & | operator= (const MultiSpeciesThermo &b) |
virtual MultiSpeciesThermo * | duplMyselfAsSpeciesThermo () const |
Duplication routine for objects derived from MultiSpeciesThermo. More... | |
virtual void | install_STIT (size_t index, shared_ptr< SpeciesThermoInterpType > stit) |
Install a new species thermodynamic property parameterization for one species. More... | |
virtual void | modifySpecies (size_t index, shared_ptr< SpeciesThermoInterpType > spec) |
Modify the species thermodynamic property parameterization for a species. More... | |
void | installPDSShandler (size_t k, PDSS *PDSS_ptr, VPSSMgr *vpssmgr_ptr) |
Install a PDSS object to handle the reference state thermodynamics calculation. More... | |
virtual void | update_one (size_t k, doublereal T, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const |
Like update(), but only updates the single species k. More... | |
virtual void | update (doublereal T, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const |
Compute the reference-state properties for all 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 species k. More... | |
virtual int | reportType (size_t index) const |
This utility function reports the type of parameterization used for the species with index number index. More... | |
virtual void | reportParams (size_t index, 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 with index number index. More... | |
virtual doublereal | reportOneHf298 (const size_t k) const |
Report the 298 K Heat of Formation of the standard state of one species (J kmol-1) More... | |
virtual void | modifyOneHf298 (const size_t k, const doublereal Hf298New) |
Modify the value of the 298 K Heat of Formation of the standard state of one species in the phase (J kmol-1) More... | |
virtual void | resetHf298 (const size_t k) |
Restore the original heat of formation of one or more species. More... | |
bool | ready (size_t nSpecies) |
Check if data for all species (0 through nSpecies-1) has been installed. More... | |
Protected Types | |
typedef std::pair< size_t, shared_ptr< SpeciesThermoInterpType > > | index_STIT |
typedef std::map< int, std::vector< index_STIT > > | STIT_map |
typedef std::map< int, vector_fp > | tpoly_map |
Protected Member Functions | |
void | markInstalled (size_t k) |
Mark species k as having its thermodynamic data installed. More... | |
Protected Attributes | |
STIT_map | m_sp |
This is the main data structure, which contains the SpeciesThermoInterpType objects, sorted by the parameterization type. More... | |
tpoly_map | m_tpoly |
Temperature polynomials for each thermo parameterization. More... | |
std::map< size_t, std::pair< int, size_t > > | m_speciesLoc |
Map from species index to location within m_sp, such that m_sp[m_speciesLoc[k].first][m_speciesLoc[k].second] is the SpeciesThermoInterpType object for species k . More... | |
doublereal | m_tlow_max |
Maximum value of the lowest temperature. More... | |
doublereal | m_thigh_min |
Minimum value of the highest temperature. More... | |
doublereal | m_p0 |
reference pressure (Pa) More... | |
std::vector< bool > | m_installed |
indicates if data for species has been installed More... | |
Private Member Functions | |
SpeciesThermoInterpType * | provideSTIT (size_t k) |
Provide the SpeciesthermoInterpType object. More... | |
const SpeciesThermoInterpType * | provideSTIT (size_t k) const |
Friends | |
class | VPSSMgr |
Make the class VPSSMgr a friend because we need to access the function provideSTIT() More... | |
A species thermodynamic property manager for a phase.
This is a general manager that can handle a wide variety of species thermodynamic polynomials for individual species and compute their nondimensional, reference-state thermodynamic properties (i.e. as a function of temperature only).
The ThermoPhase object relies on MultiSpeciesThermo to calculate the thermodynamic properties of the reference state for all of the species in the phase, for a range of temperatures. Note, the pressure dependence of the species thermodynamic functions is not handled at this level. Species using the same parameterization are grouped together in order to minimize the operation count and achieve better efficiency.
The most important member function for the MultiSpeciesThermo class is the member function MultiSpeciesThermo::update(). The function calculates the values of Cp/R, H/RT, and S/R for all of the species at once at the specified temperature.
Usually, all of the species in a phase are installed into a MultiSpeciesThermo object. However, there is no requirement that a MultiSpeciesThermo object handles all of the species in a phase. The member function install_STIT() is called to install each species into the MultiSpeciesThermo object.
Definition at line 46 of file MultiSpeciesThermo.h.
Constructor.
Definition at line 19 of file MultiSpeciesThermo.cpp.
Referenced by MultiSpeciesThermo::duplMyselfAsSpeciesThermo().
MultiSpeciesThermo | ( | const MultiSpeciesThermo & | b | ) |
Definition at line 26 of file MultiSpeciesThermo.cpp.
MultiSpeciesThermo & operator= | ( | const MultiSpeciesThermo & | b | ) |
Definition at line 48 of file MultiSpeciesThermo.cpp.
|
virtual |
Duplication routine for objects derived from MultiSpeciesThermo.
This function can be used to duplicate objects derived from MultiSpeciesThermo even if the application only has a pointer to MultiSpeciesThermo to work with.
Definition at line 75 of file MultiSpeciesThermo.cpp.
References MultiSpeciesThermo::MultiSpeciesThermo(), and Cantera::warn_deprecated().
|
virtual |
Install a new species thermodynamic property parameterization for one species.
index | Index of the species being installed |
stit | Pointer to the SpeciesThermoInterpType object This will set up the thermo for one species |
Definition at line 82 of file MultiSpeciesThermo.cpp.
References AssertThrowMsg, and MultiSpeciesThermo::m_speciesLoc.
Referenced by ThermoPhase::addSpecies(), VPSSMgr_IdealGas::createInstallPDSS(), MultiSpeciesThermo::installPDSShandler(), and VPSSMgr::installSTSpecies().
|
virtual |
Modify the species thermodynamic property parameterization for a species.
index | Index of the species being installed |
spec | Pointer to the SpeciesThermoInterpType object |
Definition at line 105 of file MultiSpeciesThermo.cpp.
References MultiSpeciesThermo::m_speciesLoc.
Referenced by ThermoPhase::modifySpecies().
Install a PDSS object to handle the reference state thermodynamics calculation.
k | species index |
PDSS_ptr | Pressure dependent standard state (PDSS) object that will handle the reference state calc |
vpssmgr_ptr | Pointer to the variable pressure standard state manager that handles the PDSS object. |
Definition at line 137 of file MultiSpeciesThermo.cpp.
References MultiSpeciesThermo::install_STIT().
Referenced by VPSSMgr_Water_ConstVol::createInstallPDSS(), VPSSMgr_Water_HKFT::createInstallPDSS(), and VPSSMgr_General::returnPDSS_ptr().
|
virtual |
Like update(), but only updates the single species k.
k | species index |
T | Temperature (Kelvin) |
cp_R | Vector of Dimensionless heat capacities. (length m_kk). |
h_RT | Vector of Dimensionless enthalpies. (length m_kk). |
s_R | Vector of Dimensionless entropies. (length m_kk). |
Definition at line 144 of file MultiSpeciesThermo.cpp.
References MultiSpeciesThermo::provideSTIT(), and SpeciesThermoInterpType::updatePropertiesTemp().
Referenced by PDSS_ConstVol::setTemperature(), PDSS_IdealGas::setTemperature(), and PDSS_SSVol::setTemperature().
|
virtual |
Compute the reference-state properties for all species.
Given temperature T in K, this method updates the values of the non- dimensional heat capacity at constant pressure, enthalpy, and entropy, at the reference pressure, Pref of each of the standard states.
T | Temperature (Kelvin) |
cp_R | Vector of Dimensionless heat capacities. (length m_kk). |
h_RT | Vector of Dimensionless enthalpies. (length m_kk). |
s_R | Vector of Dimensionless entropies. (length m_kk). |
Definition at line 153 of file MultiSpeciesThermo.cpp.
References MultiSpeciesThermo::m_sp, and MultiSpeciesThermo::m_tpoly.
Referenced by MixtureFugacityTP::_updateReferenceStateThermo(), VPSSMgr_Water_ConstVol::_updateRefStateThermo(), VPSSMgr::_updateRefStateThermo(), MaskellSolidSolnPhase::_updateThermo(), ConstDensityThermo::_updateThermo(), SingleSpeciesTP::_updateThermo(), SurfPhase::_updateThermo(), IdealGasPhase::_updateThermo(), IdealSolidSolnPhase::_updateThermo(), and LatticePhase::_updateThermo().
|
virtual |
Minimum temperature.
If no argument is supplied, this method returns the minimum temperature for which all parameterizations are valid. If an integer index k is supplied, then the value returned is the minimum temperature for species k in the phase.
k | Species index |
Definition at line 192 of file MultiSpeciesThermo.cpp.
References MultiSpeciesThermo::m_tlow_max, SpeciesThermoInterpType::minTemp(), Cantera::npos, and MultiSpeciesThermo::provideSTIT().
Referenced by PDSS_IdealGas::initThermo(), PDSS_IonsFromNeutral::initThermo(), PDSS_ConstVol::initThermoXML(), PDSS_SSVol::initThermoXML(), and ThermoPhase::minTemp().
|
virtual |
Maximum temperature.
If no argument is supplied, this method returns the maximum temperature for which all parameterizations are valid. If an integer index k is supplied, then the value returned is the maximum temperature for parameterization k.
k | Species Index |
Definition at line 203 of file MultiSpeciesThermo.cpp.
References MultiSpeciesThermo::m_thigh_min, SpeciesThermoInterpType::maxTemp(), Cantera::npos, and MultiSpeciesThermo::provideSTIT().
Referenced by PDSS_IdealGas::initThermo(), PDSS_IonsFromNeutral::initThermo(), PDSS_ConstVol::initThermoXML(), PDSS_SSVol::initThermoXML(), and ThermoPhase::maxTemp().
|
virtual |
The reference-state pressure for species k.
Returns the reference state pressure in Pascals for species k. If k is left out of the argument list, it returns the reference state pressure for the first species.
k | Species Index |
Definition at line 214 of file MultiSpeciesThermo.cpp.
References MultiSpeciesThermo::m_p0, Cantera::npos, MultiSpeciesThermo::provideSTIT(), and SpeciesThermoInterpType::refPressure().
Referenced by PDSS_ConstVol::constructPDSSXML(), PDSS_SSVol::constructPDSSXML(), VPSSMgr_IdealGas::createInstallPDSS(), ConstDensityThermo::enthalpy_mole(), RedlichKwongMFTP::entropy_mole(), IdealGasPhase::entropy_mole(), ConstDensityThermo::getChemPotentials(), MixtureFugacityTP::getEntropy_R(), IdealGasPhase::getEntropy_R(), PureFluidPhase::getEntropy_R_ref(), MixtureFugacityTP::getGibbs_RT(), IdealGasPhase::getGibbs_RT(), PureFluidPhase::getGibbs_RT_ref(), IdealGasPhase::getPartialMolarEntropies(), MixtureFugacityTP::getPureGibbs(), IdealGasPhase::getPureGibbs(), MixtureFugacityTP::getStandardChemPotentials(), IdealGasPhase::getStandardChemPotentials(), PDSS_ConstVol::initThermo(), PDSS_IdealGas::initThermo(), PDSS_IonsFromNeutral::initThermo(), PDSS_SSVol::initThermo(), PDSS_ConstVol::initThermoXML(), PDSS_SSVol::initThermoXML(), VPSSMgr::installSTSpecies(), and ThermoPhase::refPressure().
|
virtual |
This utility function reports the type of parameterization used for the species with index number index.
index | Species index |
Definition at line 169 of file MultiSpeciesThermo.cpp.
References MultiSpeciesThermo::provideSTIT(), and SpeciesThermoInterpType::reportType().
|
virtual |
This utility function reports back the type of parameterization and all of the parameters for the species with index number index.
index | Species index |
type | Integer type of the standard type |
c | Vector of coefficients used to set the parameters for the standard state. |
minTemp | output - Minimum temperature |
maxTemp | output - Maximum temperature |
refPressure | output - reference pressure (Pa). |
Definition at line 178 of file MultiSpeciesThermo.cpp.
|
virtual |
Report the 298 K Heat of Formation of the standard state of one species (J kmol-1)
The 298K Heat of Formation is defined as the enthalpy change to create the standard state of the species from its constituent elements in their standard states at 298 K and 1 bar.
k | species index |
Definition at line 245 of file MultiSpeciesThermo.cpp.
References MultiSpeciesThermo::provideSTIT(), and SpeciesThermoInterpType::reportHf298().
Referenced by ThermoPhase::Hf298SS().
|
virtual |
Modify the value of the 298 K Heat of Formation of the standard state of one species in the phase (J kmol-1)
The 298K heat of formation is defined as the enthalpy change to create the standard state of the species from its constituent elements in their standard states at 298 K and 1 bar.
k | Index of the species |
Hf298New | Specify the new value of the Heat of Formation at 298K and 1 bar. units = J/kmol. |
Definition at line 255 of file MultiSpeciesThermo.cpp.
References SpeciesThermoInterpType::modifyOneHf298(), and MultiSpeciesThermo::provideSTIT().
Referenced by ThermoPhase::modifyOneHf298SS(), and LatticeSolidPhase::modifyOneHf298SS().
|
virtual |
Restore the original heat of formation of one or more species.
Resets changes made by modifyOneHf298(). If the species index is not specified, the heats of formation for all species are restored.
Definition at line 263 of file MultiSpeciesThermo.cpp.
References MultiSpeciesThermo::provideSTIT(), and SpeciesThermoInterpType::resetHf298().
Referenced by ThermoPhase::resetHf298().
bool ready | ( | size_t | nSpecies | ) |
Check if data for all species (0 through nSpecies-1) has been installed.
Definition at line 271 of file MultiSpeciesThermo.cpp.
References MultiSpeciesThermo::m_installed.
Referenced by ThermoPhase::initThermo().
|
private |
Provide the SpeciesthermoInterpType object.
k | species index |
Definition at line 225 of file MultiSpeciesThermo.cpp.
References MultiSpeciesThermo::m_sp, and MultiSpeciesThermo::m_speciesLoc.
Referenced by VPSSMgr::initAllPtrs(), MultiSpeciesThermo::maxTemp(), MultiSpeciesThermo::minTemp(), MultiSpeciesThermo::modifyOneHf298(), MultiSpeciesThermo::refPressure(), MultiSpeciesThermo::reportOneHf298(), MultiSpeciesThermo::reportType(), MultiSpeciesThermo::resetHf298(), and MultiSpeciesThermo::update_one().
|
protected |
Mark species k as having its thermodynamic data installed.
Definition at line 283 of file MultiSpeciesThermo.cpp.
References MultiSpeciesThermo::m_installed.
|
friend |
Make the class VPSSMgr a friend because we need to access the function provideSTIT()
Definition at line 258 of file MultiSpeciesThermo.h.
|
protected |
This is the main data structure, which contains the SpeciesThermoInterpType objects, sorted by the parameterization type.
m_sp[i]
is the vector of [species index, STIT] pairs which use parameterization i
.
Definition at line 234 of file MultiSpeciesThermo.h.
Referenced by MultiSpeciesThermo::provideSTIT(), and MultiSpeciesThermo::update().
|
mutableprotected |
Temperature polynomials for each thermo parameterization.
Definition at line 237 of file MultiSpeciesThermo.h.
Referenced by MultiSpeciesThermo::update().
|
protected |
Map from species index to location within m_sp, such that m_sp[m_speciesLoc[k].first][m_speciesLoc[k].second]
is the SpeciesThermoInterpType object for species k
.
Definition at line 242 of file MultiSpeciesThermo.h.
Referenced by MultiSpeciesThermo::install_STIT(), MultiSpeciesThermo::modifySpecies(), and MultiSpeciesThermo::provideSTIT().
|
protected |
Maximum value of the lowest temperature.
Definition at line 245 of file MultiSpeciesThermo.h.
Referenced by MultiSpeciesThermo::minTemp().
|
protected |
Minimum value of the highest temperature.
Definition at line 248 of file MultiSpeciesThermo.h.
Referenced by MultiSpeciesThermo::maxTemp().
|
protected |
reference pressure (Pa)
Definition at line 251 of file MultiSpeciesThermo.h.
Referenced by MultiSpeciesThermo::refPressure().
|
protected |
indicates if data for species has been installed
Definition at line 254 of file MultiSpeciesThermo.h.
Referenced by MultiSpeciesThermo::markInstalled(), and MultiSpeciesThermo::ready().