A species thermodynamic property manager for a phase. More...
#include <GeneralSpeciesThermo.h>
Public Member Functions | |
GeneralSpeciesThermo () | |
Constructor. | |
GeneralSpeciesThermo (const GeneralSpeciesThermo &b) | |
Copy constructor. | |
GeneralSpeciesThermo & | operator= (const GeneralSpeciesThermo &b) |
Assignment operator. | |
virtual | ~GeneralSpeciesThermo () |
Destructor. | |
virtual SpeciesThermo * | duplMyselfAsSpeciesThermo () const |
Duplicator. | |
virtual void | install (std::string name, int index, int type, const doublereal *c, doublereal minTemp, doublereal maxTemp, doublereal refPressure) |
Install a new species thermodynamic property parameterization for one species. | |
virtual void | install_STIT (SpeciesThermoInterpType *stit_ptr) |
Install a new species thermodynamic property parameterization for one species. | |
void | installPDSShandler (int k, PDSS *PDSS_ptr, VPSSMgr *vpssmgr_ptr) |
Install a PDSS object to handle the reference state thermodynamics calculation. | |
virtual void | update_one (int k, doublereal T, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const |
Like update(), but only updates the single species k. | |
virtual void | update (doublereal T, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const |
Compute the reference-state properties for all species. | |
virtual doublereal | minTemp (int k=-1) const |
Minimum temperature. | |
virtual doublereal | maxTemp (int k=-1) const |
Maximum temperature. | |
virtual doublereal | refPressure (int k=-1) const |
The reference-state pressure for species k. | |
virtual int | reportType (int index) const |
This utility function reports the type of parameterization used for the species with index number index. | |
virtual void | reportParams (int 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, index. | |
virtual void | modifyParams (int index, doublereal *c) |
Modify parameters for the standard state. | |
Protected Attributes | |
std::vector < SpeciesThermoInterpType * > | m_sp |
This is the main unknown in the object. | |
doublereal | m_tlow_max |
Maximum value of the lowest temperature. | |
doublereal | m_thigh_min |
Minimum value of the highest temperature. | |
doublereal | m_p0 |
reference pressure (Pa) | |
int | m_kk |
Internal variable indicating the length of the number of species in the phase. | |
Private Member Functions | |
SpeciesThermoInterpType * | provideSTIT (int k) |
Provide the SpeciesthermoInterpType object. | |
Friends | |
class | VPSSMgr |
Make the class VPSSMgr a friend because we need to access the function provideSTIT(). |
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. It is slow, however, because it recomputes the functions of temperature needed for each species. What it does is to create a vector of SpeciesThermoInterpType objects.
Definition at line 38 of file GeneralSpeciesThermo.h.
Constructor.
Definition at line 33 of file GeneralSpeciesThermo.cpp.
References GeneralSpeciesThermo::m_thigh_min, and GeneralSpeciesThermo::m_tlow_max.
Referenced by GeneralSpeciesThermo::duplMyselfAsSpeciesThermo().
GeneralSpeciesThermo | ( | const GeneralSpeciesThermo & | b | ) |
Copy constructor.
b | Object to be copied |
Definition at line 45 of file GeneralSpeciesThermo.cpp.
References SpeciesThermoInterpType::duplMyselfAsSpeciesThermoInterpType(), GeneralSpeciesThermo::m_kk, and GeneralSpeciesThermo::m_sp.
~GeneralSpeciesThermo | ( | ) | [virtual] |
Destructor.
Definition at line 84 of file GeneralSpeciesThermo.cpp.
References GeneralSpeciesThermo::m_kk, and GeneralSpeciesThermo::m_sp.
SpeciesThermo * duplMyselfAsSpeciesThermo | ( | ) | const [virtual] |
Duplicator.
Implements SpeciesThermo.
Definition at line 96 of file GeneralSpeciesThermo.cpp.
References GeneralSpeciesThermo::GeneralSpeciesThermo().
void install | ( | std::string | name, | |
int | index, | |||
int | type, | |||
const doublereal * | c, | |||
doublereal | minTemp, | |||
doublereal | maxTemp, | |||
doublereal | refPressure | |||
) | [virtual] |
Install a new species thermodynamic property parameterization for one species.
Install a SpeciesThermoInterpType object for the species, index. This routine contains an internal list of SpeciesThermoInterpType objects that it knows about. A factory-type lookup is done to create the object.
name | Name of the species | |
index | The 'update' method will update the property values for this species at position i index in the property arrays. | |
type | int flag specifying the type of parameterization to be installed. | |
c | vector of coefficients for the parameterization. This vector is simply passed through to the parameterization constructor. It's length depends upon the parameterization. | |
minTemp | minimum temperature for which this parameterization is valid. | |
maxTemp | maximum temperature for which this parameterization is valid. | |
refPressure | standard-state pressure for this parameterization. |
Implements SpeciesThermo.
Definition at line 109 of file GeneralSpeciesThermo.cpp.
References ADSORBATE, CONSTANT_CP, Cantera::int2str(), GeneralSpeciesThermo::m_kk, GeneralSpeciesThermo::m_sp, GeneralSpeciesThermo::m_thigh_min, GeneralSpeciesThermo::m_tlow_max, Cantera::max(), Cantera::min(), MU0_INTERP, NASA1, NASA2, SHOMATE1, SHOMATE2, and SIMPLE.
void install_STIT | ( | SpeciesThermoInterpType * | stit_ptr | ) | [virtual] |
Install a new species thermodynamic property parameterization for one species.
stit_ptr | Pointer to the SpeciesThermoInterpType object This will set up the thermo for one species |
Implements SpeciesThermo.
Definition at line 184 of file GeneralSpeciesThermo.cpp.
References AssertThrow, Cantera::int2str(), GeneralSpeciesThermo::m_kk, GeneralSpeciesThermo::m_sp, GeneralSpeciesThermo::m_thigh_min, GeneralSpeciesThermo::m_tlow_max, Cantera::max(), SpeciesThermoInterpType::maxTemp(), GeneralSpeciesThermo::maxTemp(), Cantera::min(), SpeciesThermoInterpType::minTemp(), GeneralSpeciesThermo::minTemp(), and SpeciesThermoInterpType::speciesIndex().
Referenced by GeneralSpeciesThermo::installPDSShandler().
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 217 of file GeneralSpeciesThermo.cpp.
References GeneralSpeciesThermo::install_STIT().
Referenced by VPSSMgr_Water_HKFT::createInstallPDSS(), VPSSMgr_Water_ConstVol::createInstallPDSS(), and VPSSMgr_General::returnPDSS_ptr().
doublereal maxTemp | ( | int | k = -1 |
) | const [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 |
Implements SpeciesThermo.
Definition at line 326 of file GeneralSpeciesThermo.cpp.
References GeneralSpeciesThermo::m_sp, GeneralSpeciesThermo::m_thigh_min, and SpeciesThermoInterpType::maxTemp().
Referenced by GeneralSpeciesThermo::install_STIT().
doublereal minTemp | ( | int | k = -1 |
) | const [virtual] |
Minimum temperature.
Return the lowest temperature at which the thermodynamic parameterization is valid.
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 |
If no argument is supplied, the value is the one for which all species parameterizations are valid. Otherwise, if an integer argument is given, the value applies only to the species with that index.
Implements SpeciesThermo.
Definition at line 314 of file GeneralSpeciesThermo.cpp.
References GeneralSpeciesThermo::m_sp, GeneralSpeciesThermo::m_tlow_max, and SpeciesThermoInterpType::minTemp().
Referenced by GeneralSpeciesThermo::install_STIT().
void modifyParams | ( | int | index, | |
doublereal * | c | |||
) | [virtual] |
Modify parameters for the standard state.
index | Species index | |
c | Vector of coefficients used to set the parameters for the standard state. |
Implements SpeciesThermo.
Definition at line 299 of file GeneralSpeciesThermo.cpp.
References GeneralSpeciesThermo::m_sp, and SpeciesThermoInterpType::modifyParameters().
GeneralSpeciesThermo & operator= | ( | const GeneralSpeciesThermo & | b | ) |
Assignment operator.
b | Object to be copied |
Definition at line 60 of file GeneralSpeciesThermo.cpp.
References SpeciesThermoInterpType::duplMyselfAsSpeciesThermoInterpType(), GeneralSpeciesThermo::m_kk, GeneralSpeciesThermo::m_sp, GeneralSpeciesThermo::m_thigh_min, and GeneralSpeciesThermo::m_tlow_max.
SpeciesThermoInterpType * provideSTIT | ( | int | k | ) | [private] |
Provide the SpeciesthermoInterpType object.
provide access to the SpeciesThermoInterpType object. This
k | integer parameter |
Definition at line 351 of file GeneralSpeciesThermo.cpp.
References GeneralSpeciesThermo::m_sp.
Referenced by VPSSMgr::initAllPtrs().
doublereal refPressure | ( | int | k = -1 |
) | const [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. Note that some SpeciesThermo implementations, such as those for ideal gases, require that all species in the same phase have the same reference state pressures.
k | Species Index |
Implements SpeciesThermo.
Definition at line 338 of file GeneralSpeciesThermo.cpp.
References GeneralSpeciesThermo::m_p0, GeneralSpeciesThermo::m_sp, and SpeciesThermoInterpType::refPressure().
void reportParams | ( | int | index, | |
int & | type, | |||
doublereal *const | c, | |||
doublereal & | minTemp, | |||
doublereal & | maxTemp, | |||
doublereal & | refPressure | |||
) | const [virtual] |
This utility function reports back the type of parameterization and all of the parameters for the species, 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). |
For the NASA object, there are 15 coefficients.
Implements SpeciesThermo.
Definition at line 276 of file GeneralSpeciesThermo.cpp.
References GeneralSpeciesThermo::m_sp, and SpeciesThermoInterpType::reportParameters().
int reportType | ( | int | index | ) | const [virtual] |
This utility function reports the type of parameterization used for the species with index number index.
This utility function reports the type of parameterization used for the species, index.
index | Species index |
Implements SpeciesThermo.
Definition at line 261 of file GeneralSpeciesThermo.cpp.
References GeneralSpeciesThermo::m_sp, and SpeciesThermoInterpType::reportType().
void update | ( | doublereal | T, | |
doublereal * | cp_R, | |||
doublereal * | h_RT, | |||
doublereal * | s_R | |||
) | const [virtual] |
Compute the reference-state properties for all species.
Update the 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). |
Implements SpeciesThermo.
Definition at line 240 of file GeneralSpeciesThermo.cpp.
References GeneralSpeciesThermo::m_sp, and SpeciesThermoInterpType::updatePropertiesTemp().
void update_one | ( | int | k, | |
doublereal | T, | |||
doublereal * | cp_R, | |||
doublereal * | h_RT, | |||
doublereal * | s_R | |||
) | const [virtual] |
Like update(), but only updates the single species k.
Update the properties for one species.
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). |
Reimplemented from SpeciesThermo.
Definition at line 227 of file GeneralSpeciesThermo.cpp.
References GeneralSpeciesThermo::m_sp, and SpeciesThermoInterpType::updatePropertiesTemp().
friend class VPSSMgr [friend] |
Make the class VPSSMgr a friend because we need to access the function provideSTIT().
Definition at line 273 of file GeneralSpeciesThermo.h.
int m_kk [protected] |
Internal variable indicating the length of the number of species in the phase.
Definition at line 268 of file GeneralSpeciesThermo.h.
Referenced by GeneralSpeciesThermo::GeneralSpeciesThermo(), GeneralSpeciesThermo::install(), GeneralSpeciesThermo::install_STIT(), GeneralSpeciesThermo::operator=(), and GeneralSpeciesThermo::~GeneralSpeciesThermo().
doublereal m_p0 [protected] |
reference pressure (Pa)
Definition at line 262 of file GeneralSpeciesThermo.h.
Referenced by GeneralSpeciesThermo::refPressure().
std::vector<SpeciesThermoInterpType *> m_sp [protected] |
This is the main unknown in the object.
It is a list of pointers to type SpeciesThermoInterpType. Note, this object owns the objects, so they are deleted in the destructor of this object. Note, that in some instances, m_sp[k] = 0, e.g., no SpeciesThermoInterpType is installed for one or more species. These cases must be handled by the calling routine.
Definition at line 253 of file GeneralSpeciesThermo.h.
Referenced by GeneralSpeciesThermo::GeneralSpeciesThermo(), GeneralSpeciesThermo::install(), GeneralSpeciesThermo::install_STIT(), GeneralSpeciesThermo::maxTemp(), GeneralSpeciesThermo::minTemp(), GeneralSpeciesThermo::modifyParams(), GeneralSpeciesThermo::operator=(), GeneralSpeciesThermo::provideSTIT(), GeneralSpeciesThermo::refPressure(), GeneralSpeciesThermo::reportParams(), GeneralSpeciesThermo::reportType(), GeneralSpeciesThermo::update(), GeneralSpeciesThermo::update_one(), and GeneralSpeciesThermo::~GeneralSpeciesThermo().
doublereal m_thigh_min [protected] |
Minimum value of the highest temperature.
Definition at line 259 of file GeneralSpeciesThermo.h.
Referenced by GeneralSpeciesThermo::GeneralSpeciesThermo(), GeneralSpeciesThermo::install(), GeneralSpeciesThermo::install_STIT(), GeneralSpeciesThermo::maxTemp(), and GeneralSpeciesThermo::operator=().
doublereal m_tlow_max [protected] |
Maximum value of the lowest temperature.
Definition at line 256 of file GeneralSpeciesThermo.h.
Referenced by GeneralSpeciesThermo::GeneralSpeciesThermo(), GeneralSpeciesThermo::install(), GeneralSpeciesThermo::install_STIT(), GeneralSpeciesThermo::minTemp(), and GeneralSpeciesThermo::operator=().