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

A species thermodynamic property manager for the Shomate polynomial parameterization. More...

#include <ShomateThermo.h>

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

Public Member Functions

 ShomateThermo ()
 constructor More...
 
 ShomateThermo (const ShomateThermo &right)
 Copy Constructor. More...
 
ShomateThermooperator= (const ShomateThermo &right)
 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 using Shomate polynomials. More...
 
virtual void install_STIT (size_t index, shared_ptr< SpeciesThermoInterpType > stit_ptr)
 Install a new species thermodynamic property parameterization for one species. 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...
 

Public Attributes

const int ID
 Initialized to the type of parameterization. More...
 

Protected Attributes

std::vector< std::vector
< ShomatePoly > > 
m_high
 Vector of vector of NasaPoly1's for the high temp region. More...
 
std::vector< std::vector
< ShomatePoly > > 
m_low
 Vector of vector of NasaPoly1's for the low temp region. More...
 
std::map< int, int > m_index
 Map between the midpoint temperature, as an int, to the group number. More...
 
vector_fp m_tmid
 Vector of log temperature limits. More...
 
doublereal m_tlow_max
 Maximum value of the low temperature limit. More...
 
doublereal m_thigh_min
 Minimum value of the high temperature limit. More...
 
vector_fp m_tlow
 Vector of low temperature limits (species index) More...
 
vector_fp m_thigh
 Vector of low temperature limits (species index) More...
 
doublereal m_p0
 Reference pressure (Pa) More...
 
int m_ngroups
 number of groups More...
 
vector_fp m_t
 Vector of temperature polynomials. More...
 
std::map< size_t, size_t > m_group_map
 
std::map< size_t, size_t > m_posInGroup_map
 

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 the Shomate polynomial parameterization.

This is the parameterization used in the NIST Chemistry WebBook (http://webbook.nist.gov/chemistry) The parameterization assumes there are two temperature regions each with its own Shomate polynomial representation, for each species in the phase.

\[ \tilde{c}_p^0(T) = A + B t + C t^2 + D t^3 + \frac{E}{t^2} \]

\[ \tilde{h}^0(T) = A t + \frac{B t^2}{2} + \frac{C t^3}{3} + \frac{D t^4}{4} - \frac{E}{t} + F. \]

\[ \tilde{s}^0(T) = A\ln t + B t + \frac{C t^2}{2} + \frac{D t^3}{3} - \frac{E}{2t^2} + G. \]

In the above expressions, the thermodynamic polynomials are expressed in dimensional units, but the temperature, \( t \), is divided by 1000. The following dimensions are assumed in the above expressions:

Note, the polynomial data (i.e., A, ... , G) is entered in dimensional form.

This is in contrast to the NASA database polynomials which are entered in nondimensional form (i.e., NASA parameterizes C_p/R, while Shomate parameterizes C_p assuming units of J/gmol*K - and kJ/gmol*K for H). Note, also that the H - H_298.15 equation has units of kJ/gmol, because of the implicit integration of (t = T 1000), which provides a multiplier of 1000 to the Enthalpy equation.

Deprecated:
To be removed after Cantera 2.2. Use GeneralSpeciesThermo instead.

Definition at line 61 of file ShomateThermo.h.

Constructor & Destructor Documentation

ShomateThermo ( )
inline

constructor

Definition at line 71 of file ShomateThermo.h.

References ShomateThermo::m_t, and Cantera::warn_deprecated().

Referenced by ShomateThermo::duplMyselfAsSpeciesThermo().

ShomateThermo ( const ShomateThermo right)
inline

Copy Constructor.

Parameters
rightObject to be copied

Definition at line 86 of file ShomateThermo.h.

Member Function Documentation

ShomateThermo& operator= ( const ShomateThermo right)
inline
virtual SpeciesThermo* duplMyselfAsSpeciesThermo ( ) const
inlinevirtual

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 122 of file ShomateThermo.h.

References ShomateThermo::ShomateThermo().

virtual void install ( const std::string &  name,
size_t  index,
int  type,
const doublereal *  c,
doublereal  minTemp,
doublereal  maxTemp,
doublereal  refPressure 
)
inlinevirtual

Install a new species thermodynamic property parameterization for one species using Shomate polynomials.

Two temperature regions are assumed.

Parameters
nameName of the species
indexSpecies index
typeint flag specifying the type of parameterization to be installed.
cVector of coefficients for the parameterization. There are 15 coefficients for the 2-zone Shomate polynomial. The first coefficient is the value of Tmid. The next 7 coefficients are the low temperature range Shomate coefficients. The last 7 are the high temperature range Shomate coefficients.
minTempminimum temperature for which this parameterization is valid.
maxTempmaximum temperature for which this parameterization is valid.
refPressurestandard-state pressure for this parameterization.
See Also
ShomatePoly
ShomatePoly2

Implements SpeciesThermo.

Definition at line 151 of file ShomateThermo.h.

References Cantera::fp2str(), Cantera::int2str(), ShomateThermo::m_group_map, ShomateThermo::m_high, ShomateThermo::m_index, ShomateThermo::m_low, ShomateThermo::m_ngroups, ShomateThermo::m_p0, ShomateThermo::m_posInGroup_map, ShomateThermo::m_thigh, ShomateThermo::m_thigh_min, ShomateThermo::m_tlow, ShomateThermo::m_tlow_max, ShomateThermo::m_tmid, SpeciesThermo::markInstalled(), ShomateThermo::maxTemp(), ShomateThermo::minTemp(), ShomateThermo::refPressure(), SHOMATE, and Cantera::writelog().

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

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 207 of file ShomateThermo.h.

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

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 220 of file ShomateThermo.h.

References Cantera::GasConstant, Cantera::getValue(), ShomateThermo::m_group_map, ShomateThermo::m_high, ShomateThermo::m_low, ShomateThermo::m_posInGroup_map, ShomateThermo::m_t, ShomateThermo::maxTemp(), and ShomatePoly::updateProperties().

virtual void update ( doublereal  T,
doublereal *  cp_R,
doublereal *  h_RT,
doublereal *  s_R 
) const
inlinevirtual

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 245 of file ShomateThermo.h.

References Cantera::GasConstant, ShomateThermo::m_high, ShomateThermo::m_low, ShomateThermo::m_ngroups, ShomateThermo::m_t, and ShomateThermo::m_tmid.

virtual doublereal minTemp ( size_t  k = npos) const
inlinevirtual

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 271 of file ShomateThermo.h.

References ShomateThermo::m_tlow, ShomateThermo::m_tlow_max, and Cantera::npos.

Referenced by ShomateThermo::install().

virtual doublereal maxTemp ( size_t  k = npos) const
inlinevirtual

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 279 of file ShomateThermo.h.

References ShomateThermo::m_thigh, ShomateThermo::m_thigh_min, and Cantera::npos.

Referenced by ShomateThermo::install(), and ShomateThermo::update_one().

virtual doublereal refPressure ( size_t  k = npos) const
inlinevirtual

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 287 of file ShomateThermo.h.

References ShomateThermo::m_p0.

Referenced by ShomateThermo::install().

virtual int reportType ( size_t  index) const
inlinevirtual

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

Parameters
indexSpecies index

Implements SpeciesThermo.

Definition at line 291 of file ShomateThermo.h.

References SHOMATE.

Referenced by ShomateThermo::reportParams().

virtual void reportParams ( size_t  index,
int &  type,
doublereal *const  c,
doublereal &  minTemp,
doublereal &  maxTemp,
doublereal &  refPressure 
) const
inlinevirtual

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 295 of file ShomateThermo.h.

References Cantera::getValue(), ShomateThermo::m_group_map, ShomateThermo::m_high, ShomateThermo::m_low, ShomateThermo::m_posInGroup_map, SpeciesThermoInterpType::maxTemp(), ShomatePoly::reportParameters(), ShomateThermo::reportType(), SHOMATE, and SHOMATE1.

virtual doublereal reportOneHf298 ( const size_t  k) const
inlinevirtual

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 338 of file ShomateThermo.h.

References Cantera::getValue(), ShomateThermo::m_group_map, ShomateThermo::m_high, ShomateThermo::m_low, ShomateThermo::m_posInGroup_map, SpeciesThermoInterpType::maxTemp(), and ShomatePoly::reportHf298().

Referenced by ShomateThermo::modifyOneHf298().

virtual void modifyOneHf298 ( const size_t  k,
const doublereal  Hf298New 
)
inlinevirtual

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 351 of file ShomateThermo.h.

References ShomateThermo::m_group_map, ShomateThermo::m_high, ShomateThermo::m_low, ShomateThermo::m_posInGroup_map, SpeciesThermoInterpType::maxTemp(), ShomatePoly::modifyOneHf298(), ShomatePoly::reportHf298(), and ShomateThermo::reportOneHf298().

Member Data Documentation

const int ID

Initialized to the type of parameterization.

Note, this value is used in some template functions

Definition at line 68 of file ShomateThermo.h.

std::vector<std::vector<ShomatePoly> > m_high
protected

Vector of vector of NasaPoly1's for the high temp region.

This is the high temp region representation. The first Length is equal to the number of groups. The second vector is equal to the number of species in that particular group.

Definition at line 381 of file ShomateThermo.h.

Referenced by ShomateThermo::install(), ShomateThermo::modifyOneHf298(), ShomateThermo::operator=(), ShomateThermo::reportOneHf298(), ShomateThermo::reportParams(), ShomateThermo::update(), and ShomateThermo::update_one().

std::vector<std::vector<ShomatePoly> > m_low
protected

Vector of vector of NasaPoly1's for the low temp region.

This is the low temp region representation. The first Length is equal to the number of groups. The second vector is equal to the number of species in that particular group.

Definition at line 389 of file ShomateThermo.h.

Referenced by ShomateThermo::install(), ShomateThermo::modifyOneHf298(), ShomateThermo::operator=(), ShomateThermo::reportOneHf298(), ShomateThermo::reportParams(), ShomateThermo::update(), and ShomateThermo::update_one().

std::map<int, int> m_index
protected

Map between the midpoint temperature, as an int, to the group number.

Length is equal to the number of groups. Only used in the setup.

Definition at line 395 of file ShomateThermo.h.

Referenced by ShomateThermo::install(), and ShomateThermo::operator=().

vector_fp m_tmid
protected

Vector of log temperature limits.

Length is equal to the number of groups.

Definition at line 401 of file ShomateThermo.h.

Referenced by ShomateThermo::install(), ShomateThermo::operator=(), and ShomateThermo::update().

doublereal m_tlow_max
protected

Maximum value of the low temperature limit.

Definition at line 404 of file ShomateThermo.h.

Referenced by ShomateThermo::install(), ShomateThermo::minTemp(), and ShomateThermo::operator=().

doublereal m_thigh_min
protected

Minimum value of the high temperature limit.

Definition at line 407 of file ShomateThermo.h.

Referenced by ShomateThermo::install(), ShomateThermo::maxTemp(), and ShomateThermo::operator=().

vector_fp m_tlow
protected

Vector of low temperature limits (species index)

Length is equal to number of species

Definition at line 413 of file ShomateThermo.h.

Referenced by ShomateThermo::install(), ShomateThermo::minTemp(), and ShomateThermo::operator=().

vector_fp m_thigh
protected

Vector of low temperature limits (species index)

Length is equal to number of species

Definition at line 419 of file ShomateThermo.h.

Referenced by ShomateThermo::install(), ShomateThermo::maxTemp(), and ShomateThermo::operator=().

doublereal m_p0
protected

Reference pressure (Pa)

all species must have the same reference pressure.

Definition at line 425 of file ShomateThermo.h.

Referenced by ShomateThermo::install(), ShomateThermo::operator=(), and ShomateThermo::refPressure().

int m_ngroups
protected

number of groups

Definition at line 428 of file ShomateThermo.h.

Referenced by ShomateThermo::install(), ShomateThermo::operator=(), and ShomateThermo::update().

vector_fp m_t
mutableprotected

Vector of temperature polynomials.

Definition at line 431 of file ShomateThermo.h.

Referenced by ShomateThermo::operator=(), ShomateThermo::ShomateThermo(), ShomateThermo::update(), and ShomateThermo::update_one().

std::map<size_t, size_t> m_group_map
protected

This map takes as its index, the species index in the phase. It returns the group index, where the temperature polynomials for that species are stored. group indices start at 1, so a decrement is always performed to access vectors.

Definition at line 439 of file ShomateThermo.h.

Referenced by ShomateThermo::install(), ShomateThermo::modifyOneHf298(), ShomateThermo::operator=(), ShomateThermo::reportOneHf298(), ShomateThermo::reportParams(), and ShomateThermo::update_one().

std::map<size_t, size_t> m_posInGroup_map
protected

This map takes as its index, the species index in the phase. It returns the position index within the group, where the temperature polynomials for that species are stored.

Definition at line 446 of file ShomateThermo.h.

Referenced by ShomateThermo::install(), ShomateThermo::modifyOneHf298(), ShomateThermo::operator=(), ShomateThermo::reportOneHf298(), ShomateThermo::reportParams(), and ShomateThermo::update_one().


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