Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Types | Protected Attributes | Private Member Functions | Friends | List of all members

A species thermodynamic property manager for a phase. More...

#include <GeneralSpeciesThermo.h>

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

Public Member Functions

 GeneralSpeciesThermo ()
 Constructor. More...
 
 GeneralSpeciesThermo (const GeneralSpeciesThermo &b)
 Copy constructor. More...
 
GeneralSpeciesThermooperator= (const GeneralSpeciesThermo &b)
 Assignment operator. More...
 
virtual SpeciesThermoduplMyselfAsSpeciesThermo () const
 Duplication routine for objects derived from SpeciesThermo. More...
 
virtual void install (const std::string &name, size_t index, int type, const doublereal *c, doublereal minTemp, doublereal maxTemp, doublereal refPressure)
 Install a new species thermodynamic property parameterization for one species. More...
 
virtual void install_STIT (size_t index, shared_ptr< SpeciesThermoInterpType > stit_ptr)
 Install a new species thermodynamic property parameterization for one 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...
 
- Public Member Functions inherited from SpeciesThermo
 SpeciesThermo ()
 Constructor. More...
 
virtual ~SpeciesThermo ()
 Destructor. 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,
std::vector< double > > 
tpoly_map
 

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
 
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...
 

Private Member Functions

SpeciesThermoInterpTypeprovideSTIT (size_t k)
 Provide the SpeciesthermoInterpType object. More...
 
const SpeciesThermoInterpTypeprovideSTIT (size_t k) const
 

Friends

class VPSSMgr
 Make the class VPSSMgr a friend because we need to access the function provideSTIT() More...
 

Additional Inherited Members

- Protected Member Functions inherited from SpeciesThermo
void markInstalled (size_t k)
 Mark species k as having its thermodynamic data installed. More...
 

Detailed Description

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 28 of file GeneralSpeciesThermo.h.

Constructor & Destructor Documentation

Constructor.

Definition at line 14 of file GeneralSpeciesThermo.cpp.

Referenced by GeneralSpeciesThermo::duplMyselfAsSpeciesThermo().

Copy constructor.

Parameters
bObject to be copied

Definition at line 21 of file GeneralSpeciesThermo.cpp.

References GeneralSpeciesThermo::m_sp.

Member Function Documentation

GeneralSpeciesThermo & operator= ( const GeneralSpeciesThermo b)
SpeciesThermo * duplMyselfAsSpeciesThermo ( ) const
virtual

Duplication routine for objects derived from SpeciesThermo.

This function can be used to duplicate objects derived from SpeciesThermo even if the application only has a pointer to SpeciesThermo to work with.

Implements SpeciesThermo.

Definition at line 74 of file GeneralSpeciesThermo.cpp.

References GeneralSpeciesThermo::GeneralSpeciesThermo().

void install ( const std::string &  name,
size_t  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.

Parameters
nameName of the species
indexThe 'update' method will update the property values for this species at position i index in the property arrays.
typeint flag specifying the type of parameterization to be installed.
cvector of coefficients for the parameterization. This vector is simply passed through to the parameterization constructor. Its length depends upon the parameterization.
minTempminimum temperature for which this parameterization is valid.
maxTempmaximum temperature for which this parameterization is valid.
refPressurestandard-state pressure for this parameterization.
See Also
speciesThermoTypes.h
Deprecated:
Use newSpeciesThermoInterpType and GeneralSpeciesThermo::install_STIT. To be removed after Cantera 2.2.

Implements SpeciesThermo.

Definition at line 79 of file GeneralSpeciesThermo.cpp.

References GeneralSpeciesThermo::install_STIT(), Cantera::newSpeciesThermoInterpType(), and Cantera::warn_deprecated().

void install_STIT ( size_t  index,
shared_ptr< SpeciesThermoInterpType stit 
)
virtual

Install a new species thermodynamic property parameterization for one species.

Parameters
indexIndex of the species being installed
stitPointer to the SpeciesThermoInterpType object This will set up the thermo for one species

Implements SpeciesThermo.

Definition at line 104 of file GeneralSpeciesThermo.cpp.

References AssertThrow, Cantera::int2str(), GeneralSpeciesThermo::m_sp, GeneralSpeciesThermo::m_thigh_min, GeneralSpeciesThermo::m_tlow_max, GeneralSpeciesThermo::m_tpoly, and SpeciesThermo::markInstalled().

Referenced by GeneralSpeciesThermo::install(), and GeneralSpeciesThermo::installPDSShandler().

void installPDSShandler ( size_t  k,
PDSS PDSS_ptr,
VPSSMgr vpssmgr_ptr 
)

Install a PDSS object to handle the reference state thermodynamics calculation.

Parameters
kspecies index
PDSS_ptrPressure dependent standard state (PDSS) object that will handle the reference state calc
vpssmgr_ptrPointer to the variable pressure standard state manager that handles the PDSS object.

Definition at line 126 of file GeneralSpeciesThermo.cpp.

References GeneralSpeciesThermo::install_STIT().

Referenced by VPSSMgr_Water_ConstVol::createInstallPDSS(), VPSSMgr_Water_HKFT::createInstallPDSS(), and VPSSMgr_General::returnPDSS_ptr().

void update_one ( size_t  k,
doublereal  T,
doublereal *  cp_R,
doublereal *  h_RT,
doublereal *  s_R 
) const
virtual

Like update(), but only updates the single species k.

Parameters
kspecies index
TTemperature (Kelvin)
cp_RVector of Dimensionless heat capacities. (length m_kk).
h_RTVector of Dimensionless enthalpies. (length m_kk).
s_RVector of Dimensionless entropies. (length m_kk).

Reimplemented from SpeciesThermo.

Definition at line 133 of file GeneralSpeciesThermo.cpp.

References GeneralSpeciesThermo::provideSTIT(), and SpeciesThermoInterpType::updatePropertiesTemp().

void update ( doublereal  T,
doublereal *  cp_R,
doublereal *  h_RT,
doublereal *  s_R 
) const
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.

Parameters
TTemperature (Kelvin)
cp_RVector of Dimensionless heat capacities. (length m_kk).
h_RTVector of Dimensionless enthalpies. (length m_kk).
s_RVector of Dimensionless entropies. (length m_kk).

Implements SpeciesThermo.

Definition at line 142 of file GeneralSpeciesThermo.cpp.

References GeneralSpeciesThermo::m_sp, and GeneralSpeciesThermo::m_tpoly.

doublereal minTemp ( size_t  k = npos) const
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.

Parameters
kSpecies index

Implements SpeciesThermo.

Definition at line 181 of file GeneralSpeciesThermo.cpp.

References GeneralSpeciesThermo::m_tlow_max, SpeciesThermoInterpType::minTemp(), Cantera::npos, and GeneralSpeciesThermo::provideSTIT().

doublereal maxTemp ( size_t  k = npos) 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.

Parameters
kSpecies Index

Implements SpeciesThermo.

Definition at line 192 of file GeneralSpeciesThermo.cpp.

References GeneralSpeciesThermo::m_thigh_min, SpeciesThermoInterpType::maxTemp(), Cantera::npos, and GeneralSpeciesThermo::provideSTIT().

doublereal refPressure ( size_t  k = npos) 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.

Parameters
kSpecies Index

Implements SpeciesThermo.

Definition at line 203 of file GeneralSpeciesThermo.cpp.

References GeneralSpeciesThermo::m_p0, Cantera::npos, GeneralSpeciesThermo::provideSTIT(), and SpeciesThermoInterpType::refPressure().

int reportType ( size_t  index) const
virtual

This utility function reports the type of parameterization used for the species with index number index.

Parameters
indexSpecies index

Implements SpeciesThermo.

Definition at line 158 of file GeneralSpeciesThermo.cpp.

References GeneralSpeciesThermo::provideSTIT(), and SpeciesThermoInterpType::reportType().

void reportParams ( size_t  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 with index number index.

Parameters
indexSpecies index
typeInteger type of the standard type
cVector of coefficients used to set the parameters for the standard state.
minTempoutput - Minimum temperature
maxTempoutput - Maximum temperature
refPressureoutput - reference pressure (Pa).

Implements SpeciesThermo.

Definition at line 167 of file GeneralSpeciesThermo.cpp.

References GeneralSpeciesThermo::provideSTIT(), and SpeciesThermoInterpType::reportParameters().

doublereal reportOneHf298 ( const size_t  k) const
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.

Parameters
kspecies index
Returns
Returns the current value of the Heat of Formation at 298K and 1 bar

Implements SpeciesThermo.

Definition at line 235 of file GeneralSpeciesThermo.cpp.

References GeneralSpeciesThermo::provideSTIT(), and SpeciesThermoInterpType::reportHf298().

void modifyOneHf298 ( const size_t  k,
const doublereal  Hf298New 
)
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.

Parameters
kIndex of the species
Hf298NewSpecify the new value of the Heat of Formation at 298K and 1 bar. units = J/kmol.

Implements SpeciesThermo.

Definition at line 245 of file GeneralSpeciesThermo.cpp.

References SpeciesThermoInterpType::modifyOneHf298(), and GeneralSpeciesThermo::provideSTIT().

SpeciesThermoInterpType * provideSTIT ( size_t  k)
private

Friends And Related Function Documentation

friend class VPSSMgr
friend

Make the class VPSSMgr a friend because we need to access the function provideSTIT()

Definition at line 163 of file GeneralSpeciesThermo.h.

Member Data Documentation

STIT_map m_sp
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 145 of file GeneralSpeciesThermo.h.

Referenced by GeneralSpeciesThermo::GeneralSpeciesThermo(), GeneralSpeciesThermo::install_STIT(), GeneralSpeciesThermo::operator=(), GeneralSpeciesThermo::provideSTIT(), and GeneralSpeciesThermo::update().

tpoly_map m_tpoly
mutableprotected

Temperature polynomials for each thermo parameterization.

Definition at line 148 of file GeneralSpeciesThermo.h.

Referenced by GeneralSpeciesThermo::install_STIT(), GeneralSpeciesThermo::operator=(), and GeneralSpeciesThermo::update().

doublereal m_tlow_max
protected

Maximum value of the lowest temperature.

Definition at line 153 of file GeneralSpeciesThermo.h.

Referenced by GeneralSpeciesThermo::install_STIT(), GeneralSpeciesThermo::minTemp(), and GeneralSpeciesThermo::operator=().

doublereal m_thigh_min
protected

Minimum value of the highest temperature.

Definition at line 156 of file GeneralSpeciesThermo.h.

Referenced by GeneralSpeciesThermo::install_STIT(), GeneralSpeciesThermo::maxTemp(), and GeneralSpeciesThermo::operator=().

doublereal m_p0
protected

reference pressure (Pa)

Definition at line 159 of file GeneralSpeciesThermo.h.

Referenced by GeneralSpeciesThermo::operator=(), and GeneralSpeciesThermo::refPressure().


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