Cantera  2.0
Public Member Functions | 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.
 
 GeneralSpeciesThermo (const GeneralSpeciesThermo &b)
 Copy constructor.
 
GeneralSpeciesThermooperator= (const GeneralSpeciesThermo &b)
 Assignment operator.
 
virtual ~GeneralSpeciesThermo ()
 Destructor.
 
virtual SpeciesThermoduplMyselfAsSpeciesThermo () const
 Duplicator.
 
virtual void install (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.
 
virtual void install_STIT (SpeciesThermoInterpType *stit_ptr)
 Install a new species thermodynamic property parameterization for one species.
 
void installPDSShandler (size_t k, PDSS *PDSS_ptr, VPSSMgr *vpssmgr_ptr)
 Install a PDSS object to handle the reference state thermodynamics calculation.
 
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.
 
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 (size_t k=npos) const
 Minimum temperature.
 
virtual doublereal maxTemp (size_t k=npos) const
 Maximum temperature.
 
virtual doublereal refPressure (size_t k=npos) const
 The reference-state pressure for species k.
 
virtual int reportType (size_t index) const
 This utility function reports the type of parameterization used for the species with index number index.
 
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, index.
 
virtual void modifyParams (size_t 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)
 
size_t m_kk
 Internal variable indicating the length of the number of species in the phase.
 

Private Member Functions

SpeciesThermoInterpTypeprovideSTIT (size_t k)
 Provide the SpeciesthermoInterpType object.
 

Friends

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

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

Constructor & Destructor Documentation

Copy constructor.

Parameters
bObject to be copied

Definition at line 40 of file GeneralSpeciesThermo.cpp.

References SpeciesThermoInterpType::duplMyselfAsSpeciesThermoInterpType(), GeneralSpeciesThermo::m_kk, and GeneralSpeciesThermo::m_sp.

~GeneralSpeciesThermo ( )
virtual

Destructor.

Definition at line 80 of file GeneralSpeciesThermo.cpp.

References GeneralSpeciesThermo::m_kk, and GeneralSpeciesThermo::m_sp.

Member Function Documentation

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

Duplicator.

Implements SpeciesThermo.

Definition at line 93 of file GeneralSpeciesThermo.cpp.

References GeneralSpeciesThermo::GeneralSpeciesThermo().

void install ( 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
Todo:
Create a factory method for SpeciesThermoInterpType. That's basically what we are doing here.

Implements SpeciesThermo.

Definition at line 107 of file GeneralSpeciesThermo.cpp.

References ADSORBATE, CONSTANT_CP, Cantera::int2str(), GeneralSpeciesThermo::m_kk, GeneralSpeciesThermo::m_sp, GeneralSpeciesThermo::m_thigh_min, GeneralSpeciesThermo::m_tlow_max, ckr::max(), ckr::min(), MU0_INTERP, NASA1, NASA2, SHOMATE1, SHOMATE2, and SIMPLE.

void install_STIT ( SpeciesThermoInterpType stit_ptr)
virtual
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 215 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.

Update the properties for one species.

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 226 of file GeneralSpeciesThermo.cpp.

References GeneralSpeciesThermo::m_sp, 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.

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.

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 240 of file GeneralSpeciesThermo.cpp.

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

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

Parameters
kSpecies 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 318 of file GeneralSpeciesThermo.cpp.

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

Referenced by GeneralSpeciesThermo::install_STIT().

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 331 of file GeneralSpeciesThermo.cpp.

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

Referenced by GeneralSpeciesThermo::install_STIT().

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 344 of file GeneralSpeciesThermo.cpp.

References GeneralSpeciesThermo::m_p0, GeneralSpeciesThermo::m_sp, Cantera::npos, 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.

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

Parameters
indexSpecies index

Implements SpeciesThermo.

Definition at line 262 of file GeneralSpeciesThermo.cpp.

References GeneralSpeciesThermo::m_sp, 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, 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).

For the NASA object, there are 15 coefficients.

Implements SpeciesThermo.

Definition at line 278 of file GeneralSpeciesThermo.cpp.

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

void modifyParams ( size_t  index,
doublereal *  c 
)
virtual

Modify parameters for the standard state.

Parameters
indexSpecies index
cVector of coefficients used to set the parameters for the standard state.
Deprecated:
Parameters
indexSpecies index
cVector of coefficients used to set the parameters for the standard state.

Implements SpeciesThermo.

Definition at line 302 of file GeneralSpeciesThermo.cpp.

References GeneralSpeciesThermo::m_sp, and SpeciesThermoInterpType::modifyParameters().

SpeciesThermoInterpType * provideSTIT ( size_t  k)
private

Provide the SpeciesthermoInterpType object.

provide access to the SpeciesThermoInterpType object. This

Parameters
kinteger parameter
Returns
pointer to the SpeciesThermoInterpType object.

Definition at line 358 of file GeneralSpeciesThermo.cpp.

References GeneralSpeciesThermo::m_sp.

Referenced by VPSSMgr::initAllPtrs().

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

Member Data Documentation

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 249 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_tlow_max
protected
doublereal m_thigh_min
protected
doublereal m_p0
protected

reference pressure (Pa)

Definition at line 258 of file GeneralSpeciesThermo.h.

Referenced by GeneralSpeciesThermo::refPressure().

size_t m_kk
protected

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