Cantera  2.1.2
Public Member Functions | Public Attributes | Protected Attributes | List of all members

#include <SimpleThermo.h>

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

Public Member Functions

 SimpleThermo ()
 Constructor. More...
 
 SimpleThermo (const SimpleThermo &right)
 Copy constructor. More...
 
SimpleThermooperator= (const SimpleThermo &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. More...
 
virtual void install_STIT (SpeciesThermoInterpType *stit_ptr)
 Install a new species thermodynamic property parameterization for one species. 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 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 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
 
- Public Member Functions inherited from SpeciesThermo
 SpeciesThermo ()
 Constructor. More...
 
virtual ~SpeciesThermo ()
 Destructor. More...
 
 SpeciesThermo (const SpeciesThermo &right)
 Copy Constructor for the SpeciesThermo object. More...
 
SpeciesThermooperator= (const SpeciesThermo &right)
 Assignment operator for the SpeciesThermo object. More...
 

Public Attributes

const int ID
 The type of parameterization. More...
 
- Public Attributes inherited from SpeciesThermo
bool m_allow_discontinuities
 

Protected Attributes

std::map< size_t, size_t > m_loc
 Mapping between the species index and the vector index where the coefficients are kept. More...
 
std::vector< size_t > m_index
 Map between the vector index where the coefficients are kept and the species index. 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...
 
vector_fp m_t0
 Vector of base temperatures (kelvin) More...
 
vector_fp m_logt0
 Vector of base log temperatures (kelvin) More...
 
vector_fp m_h0_R
 Vector of base dimensionless Enthalpies. More...
 
vector_fp m_s0_R
 Vector of base dimensionless Entropies. More...
 
vector_fp m_cp0_R
 Vector of base dimensionless heat capacities. More...
 
doublereal m_p0
 Reference pressure (Pa) More...
 
size_t m_nspData
 Number of species data points in the object. More...
 

Detailed Description

A constant-heat capacity species thermodynamic property manager class. This makes the assumption that the heat capacity is a constant. Then, the following relations are used to complete the specification of the thermodynamic functions for each species in the phase.

\[ \frac{c_p(T)}{R} = Cp0\_R \]

\[ \frac{h^0(T)}{RT} = \frac{1}{T} * (h0\_R + (T - T_0) * Cp0\_R) \]

\[ \frac{s^0(T)}{R} = (s0\_R + (log(T) - log(T_0)) * Cp0\_R) \]

This parameterization takes 4 input values. These are:

All species must have the same reference pressure. The single-species standard-state property Manager ConstCpPoly has the same parameterization as the SimpleThermo class does.

See Also
ConstCpPoly

Definition at line 47 of file SimpleThermo.h.

Constructor & Destructor Documentation

SimpleThermo ( )
inline

Constructor.

Definition at line 55 of file SimpleThermo.h.

Referenced by SimpleThermo::duplMyselfAsSpeciesThermo().

SimpleThermo ( const SimpleThermo right)
inline

Copy constructor.

Parameters
rightObject to be copied

Definition at line 66 of file SimpleThermo.h.

References SimpleThermo::operator=().

Member Function Documentation

SimpleThermo& operator= ( const SimpleThermo 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 107 of file SimpleThermo.h.

References SimpleThermo::SimpleThermo().

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.

Parameters
nameString name of the species
indexSpecies index, k
typeint flag specifying the type of parameterization to be installed.
cVector of coefficients for the parameterization. There are 4 coefficients. The values (and units) are the following
  • c[0] = \( T_0 \)(Kelvin)
  • c[1] = \( H_k^o(T_0, p_{ref}) \) (J/kmol)
  • c[2] = \( S_k^o(T_0, p_{ref}) \) (J/kmol K)
  • c[3] = \( {Cp}_k^o(T_0, p_{ref}) \) (J(kmol K)
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.
See Also
ConstCpPoly

Implements SpeciesThermo.

Definition at line 134 of file SimpleThermo.h.

References Cantera::fp2str(), Cantera::GasConstant, SimpleThermo::m_cp0_R, SimpleThermo::m_h0_R, SimpleThermo::m_index, SimpleThermo::m_loc, SimpleThermo::m_logt0, SimpleThermo::m_nspData, SimpleThermo::m_p0, SimpleThermo::m_s0_R, SimpleThermo::m_t0, SimpleThermo::m_thigh, SimpleThermo::m_thigh_min, SimpleThermo::m_tlow, SimpleThermo::m_tlow_max, and Cantera::writelog().

virtual void install_STIT ( SpeciesThermoInterpType stit_ptr)
inlinevirtual

Install a new species thermodynamic property parameterization for one species.

Parameters
stit_ptrPointer to the SpeciesThermoInterpType object This will set up the thermo for one species

Implements SpeciesThermo.

Definition at line 176 of file SimpleThermo.h.

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 180 of file SimpleThermo.h.

References SimpleThermo::m_cp0_R, SimpleThermo::m_h0_R, SimpleThermo::m_index, SimpleThermo::m_logt0, SimpleThermo::m_nspData, SimpleThermo::m_s0_R, and SimpleThermo::m_t0.

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 201 of file SimpleThermo.h.

References SimpleThermo::m_cp0_R, SimpleThermo::m_h0_R, SimpleThermo::m_loc, SimpleThermo::m_logt0, SimpleThermo::m_s0_R, and SimpleThermo::m_t0.

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 211 of file SimpleThermo.h.

References SimpleThermo::m_loc, SimpleThermo::m_tlow, SimpleThermo::m_tlow_max, and Cantera::npos.

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 219 of file SimpleThermo.h.

References SimpleThermo::m_loc, SimpleThermo::m_thigh, SimpleThermo::m_thigh_min, and Cantera::npos.

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 227 of file SimpleThermo.h.

References SimpleThermo::m_p0.

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 231 of file SimpleThermo.h.

References SIMPLE.

Referenced by SimpleThermo::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, index.

Parameters
indexSpecies index
typeInteger type of the standard type
cVector of coefficients used to set the parameters for the standard state. For the SimpleThermo object, there are 4 coefficients.
minTemp_output - Minimum temperature
maxTemp_output - Maximum temperature
refPressure_output - reference pressure (Pa).
Deprecated:

Implements SpeciesThermo.

Definition at line 249 of file SimpleThermo.h.

References Cantera::GasConstant, SimpleThermo::m_cp0_R, SimpleThermo::m_h0_R, SimpleThermo::m_loc, SimpleThermo::m_p0, SimpleThermo::m_s0_R, SimpleThermo::m_t0, SimpleThermo::m_thigh, SimpleThermo::m_tlow, SimpleThermo::reportType(), and SIMPLE.

Member Data Documentation

const int ID

The type of parameterization.

Note, this value is used in some template functions. For this object the value is SIMPLE.

Definition at line 52 of file SimpleThermo.h.

std::map<size_t, size_t> m_loc
mutableprotected

Mapping between the species index and the vector index where the coefficients are kept.

This object doesn't have a one-to one correspondence between the species index, kspec, and the data location index,indexData, m_cp0_R[indexData]. This index keeps track of it. indexData = m_loc[kspec]

Definition at line 285 of file SimpleThermo.h.

Referenced by SimpleThermo::install(), SimpleThermo::maxTemp(), SimpleThermo::minTemp(), SimpleThermo::operator=(), SimpleThermo::reportParams(), and SimpleThermo::update_one().

std::vector<size_t> m_index
protected

Map between the vector index where the coefficients are kept and the species index.

Length is equal to the number of dataPoints. kspec = m_index[indexData]

Definition at line 292 of file SimpleThermo.h.

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

doublereal m_tlow_max
protected

Maximum value of the low temperature limit.

Definition at line 295 of file SimpleThermo.h.

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

doublereal m_thigh_min
protected

Minimum value of the high temperature limit.

Definition at line 298 of file SimpleThermo.h.

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

vector_fp m_tlow
protected

Vector of low temperature limits (species index)

Length is equal to number of data points

Definition at line 304 of file SimpleThermo.h.

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

vector_fp m_thigh
protected

Vector of low temperature limits (species index)

Length is equal to number of data points

Definition at line 310 of file SimpleThermo.h.

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

vector_fp m_t0
protected

Vector of base temperatures (kelvin)

Length is equal to the number of species data points

Definition at line 316 of file SimpleThermo.h.

Referenced by SimpleThermo::install(), SimpleThermo::operator=(), SimpleThermo::reportParams(), SimpleThermo::update(), and SimpleThermo::update_one().

vector_fp m_logt0
protected

Vector of base log temperatures (kelvin)

Length is equal to the number of species data points

Definition at line 322 of file SimpleThermo.h.

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

vector_fp m_h0_R
protected

Vector of base dimensionless Enthalpies.

Length is equal to the number of species data points

Definition at line 328 of file SimpleThermo.h.

Referenced by SimpleThermo::install(), SimpleThermo::operator=(), SimpleThermo::reportParams(), SimpleThermo::update(), and SimpleThermo::update_one().

vector_fp m_s0_R
protected

Vector of base dimensionless Entropies.

Length is equal to the number of species data points

Definition at line 334 of file SimpleThermo.h.

Referenced by SimpleThermo::install(), SimpleThermo::operator=(), SimpleThermo::reportParams(), SimpleThermo::update(), and SimpleThermo::update_one().

vector_fp m_cp0_R
protected

Vector of base dimensionless heat capacities.

Length is equal to the number of species data points

Definition at line 340 of file SimpleThermo.h.

Referenced by SimpleThermo::install(), SimpleThermo::operator=(), SimpleThermo::reportParams(), SimpleThermo::update(), and SimpleThermo::update_one().

doublereal m_p0
protected

Reference pressure (Pa)

all species must have the same reference pressure.

Definition at line 346 of file SimpleThermo.h.

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

size_t m_nspData
protected

Number of species data points in the object.

This is less than or equal to the number of species in the phase.

Definition at line 352 of file SimpleThermo.h.

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


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