NasaThermo Class Reference
[Managers for Calculating Reference-State Thermodynamics]

A species thermodynamic property manager for the NASA polynomial parameterization with two temperature ranges. More...

#include <NasaThermo.h>

Inheritance diagram for NasaThermo:
Inheritance graph
[legend]
Collaboration diagram for NasaThermo:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 NasaThermo ()
 constructor
 NasaThermo (const NasaThermo &right)
 Copy constructor.
NasaThermooperator= (const NasaThermo &right)
 Assignment operator.
virtual ~NasaThermo ()
 destructor
virtual SpeciesThermoduplMyselfAsSpeciesThermo () const
 Duplication routine for objects which inherit from SpeciesThermo.
virtual void install (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.
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
virtual void modifyParams (int index, doublereal *c)
 Modify parameters for the standard state.
virtual void install (std::string name, int index, int type, const doublereal *c, doublereal minTemp, doublereal maxTemp, doublereal refPressure)=0
 Install a new species thermodynamic property parameterization for one species.

Public Attributes

const int ID
 Initialized to the type of parameterization.

Protected Attributes

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

Private Member Functions

void checkContinuity (std::string name, double tmid, const doublereal *clow, doublereal *chigh)
 see SpeciesThermoFactory.cpp for the definition
doublereal enthalpy_RT (double t, const doublereal *c)
 for internal use by checkContinuity
doublereal entropy_R (double t, const doublereal *c)
 for internal use by checkContinuity

Detailed Description

A species thermodynamic property manager for the NASA polynomial parameterization with two temperature ranges.

This class is designed to efficiently evaluate the properties of a large number of species with the NASA parameterization.

The original NASA polynomial parameterization expressed the heat capacity as a fourth-order polynomial in temperature, with separate coefficients for each of two temperature ranges. (The newer NASA format adds coefficients for 1/T and 1/T^2, and allows multiple temperature ranges.) This class is designed for use with the original parameterization, which is used, for example, by the Chemkin software package.

In many cases, the midpoint temperature is the same for many species. To take advantage of this, class NasaThermo groups species with a common midpoint temperature, so that checking which range the desired temperature is in need be done only once for each group.

Note:
There is a special CTML element for entering the coefficients of this parameterization.
See also:
importCTML

Definition at line 55 of file NasaThermo.h.


Constructor & Destructor Documentation

NasaThermo (  )  [inline]

constructor

Definition at line 66 of file NasaThermo.h.

References NasaThermo::m_t.

Referenced by NasaThermo::duplMyselfAsSpeciesThermo().

NasaThermo ( const NasaThermo right  )  [inline]

Copy constructor.

Parameters:
right NasaThermo object to be copied.

Definition at line 80 of file NasaThermo.h.

References NasaThermo::operator=().

virtual ~NasaThermo (  )  [inline, virtual]

destructor

Definition at line 120 of file NasaThermo.h.


Member Function Documentation

void checkContinuity ( std::string  name,
double  tmid,
const doublereal *  clow,
doublereal *  chigh 
) [private]

see SpeciesThermoFactory.cpp for the definition

Parameters:
name string name of species
tmid Mid temperature, between the two temperature regions
clow coefficients for lower temperature region
chigh coefficients for higher temperature region

Definition at line 251 of file SpeciesThermoFactory.cpp.

References NasaThermo::enthalpy_RT(), NasaThermo::entropy_R(), Cantera::fp2str(), Cantera::poly4(), and Cantera::writelog().

Referenced by NasaThermo::install(), and NasaThermo::modifyParams().

virtual SpeciesThermo* duplMyselfAsSpeciesThermo (  )  const [inline, virtual]

Duplication routine for objects which inherit from SpeciesThermo.

This virtual routine can be used to duplicate SpeciesThermo objects inherited from SpeciesThermo even if the application only has a pointer to SpeciesThermo to work with. ->commented out because we first need to add copy constructors and assignment operators to all of the derived classes.

Implements SpeciesThermo.

Definition at line 131 of file NasaThermo.h.

References NasaThermo::NasaThermo().

doublereal enthalpy_RT ( double  t,
const doublereal *  c 
) [inline, private]

for internal use by checkContinuity

Parameters:
t temperature
c coefficient array

Definition at line 599 of file NasaThermo.h.

References Cantera::OneThird.

Referenced by NasaThermo::checkContinuity().

doublereal entropy_R ( double  t,
const doublereal *  c 
) [inline, private]

for internal use by checkContinuity

Parameters:
t temperature
c coefficient array

Definition at line 610 of file NasaThermo.h.

References Cantera::OneThird.

Referenced by NasaThermo::checkContinuity().

virtual void install ( std::string  name,
int  index,
int  type,
const doublereal *  c,
doublereal  minTemp,
doublereal  maxTemp,
doublereal  refPressure 
) [pure virtual, inherited]

Install a new species thermodynamic property parameterization for one species.

Parameters:
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.
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:
speciesThermoTypes.h

Implemented in GeneralSpeciesThermo, and SpeciesThermoDuo< T1, T2 >.

virtual void install ( string  name,
int  index,
int  type,
const doublereal *  c,
doublereal  minTemp,
doublereal  maxTemp,
doublereal  refPressure 
) [inline, virtual]

install a new species thermodynamic property parameterization for one species.

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

  • c[0] midpoint temperature
  • c[1] - c[7] coefficients for low T range
  • c[8] - c[14] coefficients for high T range
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:
speciesThermoTypes.h

Definition at line 158 of file NasaThermo.h.

References NasaThermo::checkContinuity(), Cantera::fp2str(), NasaThermo::m_group_map, NasaThermo::m_high, NasaThermo::m_index, NasaThermo::m_low, NasaThermo::m_name, NasaThermo::m_ngroups, NasaThermo::m_p0, NasaThermo::m_posInGroup_map, NasaThermo::m_thigh, NasaThermo::m_thigh_min, NasaThermo::m_tlow, NasaThermo::m_tlow_max, NasaThermo::m_tmid, and Cantera::writelog().

virtual void install_STIT ( SpeciesThermoInterpType stit_ptr  )  [inline, virtual]

Install a new species thermodynamic property parameterization for one species.

Parameters:
stit_ptr Pointer to the SpeciesThermoInterpType object This will set up the thermo for one species

Implements SpeciesThermo.

Definition at line 227 of file NasaThermo.h.

virtual doublereal maxTemp ( int  k = -1  )  const [inline, 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:
k Species index

Implements SpeciesThermo.

Definition at line 339 of file NasaThermo.h.

References NasaThermo::m_thigh, and NasaThermo::m_thigh_min.

virtual doublereal minTemp ( int  k = -1  )  const [inline, 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:
k Species index

Implements SpeciesThermo.

Definition at line 322 of file NasaThermo.h.

References NasaThermo::m_tlow, and NasaThermo::m_tlow_max.

virtual void modifyParams ( int  index,
doublereal *  c 
) [inline, virtual]

Modify parameters for the standard state.

This utility function modifies the array of coefficients. The array is the same as that returned by reportParams, so a call can first be made to reportParams to populate the array, and then modifyParams can be called to alter selected values. For the NASA object, there are 15 coefficients.

Parameters:
index Species index
c Vector of coefficients used to set the parameters for the standard state.

Implements SpeciesThermo.

Definition at line 437 of file NasaThermo.h.

References NasaThermo::checkContinuity(), NasaThermo::m_group_map, NasaThermo::m_high, NasaThermo::m_low, NasaThermo::m_name, NasaThermo::m_posInGroup_map, NasaPoly1::maxTemp(), NasaPoly1::modifyParameters(), NASA, and NasaThermo::reportType().

NasaThermo& operator= ( const NasaThermo right  )  [inline]
virtual doublereal refPressure ( int  k = -1  )  const [inline, 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:
k Species index

Implements SpeciesThermo.

Definition at line 359 of file NasaThermo.h.

References NasaThermo::m_p0.

virtual void reportParams ( int  index,
int &  type,
doublereal *const   c,
doublereal &  minTemp,
doublereal &  maxTemp,
doublereal &  refPressure 
) const [inline, virtual]

This utility function reports back the type of parameterization and all of the parameters for the species, index.

Parameters:
index Species index
type Integer type of the standard type
c Vector of coefficients used to set the parameters for the standard state. For the NASA object, there are 15 coefficients.
minTemp output - Minimum temperature
maxTemp output - Maximum temperature
refPressure output - reference pressure (Pa).

Implements SpeciesThermo.

Definition at line 385 of file NasaThermo.h.

References NasaThermo::m_group_map, NasaThermo::m_high, NasaThermo::m_low, NasaThermo::m_posInGroup_map, NasaPoly1::maxTemp(), NASA, NASA1, NasaPoly1::reportParameters(), and NasaThermo::reportType().

virtual int reportType ( int  index  )  const [inline, virtual]

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

Parameters:
index Species index

Implements SpeciesThermo.

Definition at line 369 of file NasaThermo.h.

References NASA.

Referenced by NasaThermo::modifyParams(), and NasaThermo::reportParams().

virtual void update ( doublereal  t,
doublereal *  cp_R,
doublereal *  h_RT,
doublereal *  s_R 
) const [inline, 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:
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 284 of file NasaThermo.h.

References NasaThermo::m_high, NasaThermo::m_low, NasaThermo::m_ngroups, NasaThermo::m_t, and NasaThermo::m_tmid.

virtual void update_one ( int  k,
doublereal  t,
doublereal *  cp_R,
doublereal *  h_RT,
doublereal *  s_R 
) const [inline, virtual]

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

Parameters:
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 244 of file NasaThermo.h.

References NasaThermo::m_group_map, NasaThermo::m_high, NasaThermo::m_low, NasaThermo::m_posInGroup_map, NasaThermo::m_t, NasaPoly1::maxTemp(), and NasaPoly1::updateProperties().


Member Data Documentation

const int ID

Initialized to the type of parameterization.

Note, this value is used in some template functions

Definition at line 63 of file NasaThermo.h.

map<int, int> m_group_map [mutable, 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 indecises start at 1, so a decrement is always performed to access vectors.

Definition at line 570 of file NasaThermo.h.

Referenced by NasaThermo::install(), NasaThermo::modifyParams(), NasaThermo::operator=(), NasaThermo::reportParams(), and NasaThermo::update_one().

vector<vector<NasaPoly1> > 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 511 of file NasaThermo.h.

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

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 526 of file NasaThermo.h.

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

vector<vector<NasaPoly1> > 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 520 of file NasaThermo.h.

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

map<int, string> m_name [mutable, protected]

Species name as a function of the species index.

Definition at line 580 of file NasaThermo.h.

Referenced by NasaThermo::install(), NasaThermo::modifyParams(), and NasaThermo::operator=().

int m_ngroups [protected]

number of groups

Definition at line 559 of file NasaThermo.h.

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

doublereal m_p0 [protected]

Reference pressure (Pa).

all species must have the same reference pressure.

Definition at line 556 of file NasaThermo.h.

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

map<int, int> m_posInGroup_map [mutable, 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 storred.

Definition at line 577 of file NasaThermo.h.

Referenced by NasaThermo::install(), NasaThermo::modifyParams(), NasaThermo::operator=(), NasaThermo::reportParams(), and NasaThermo::update_one().

vector_fp m_t [mutable, protected]

Vector of temperature polynomials.

Definition at line 562 of file NasaThermo.h.

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

vector_fp m_thigh [protected]

Vector of low temperature limits (species index).

Length is equal to number of species

Definition at line 550 of file NasaThermo.h.

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

doublereal m_thigh_min [protected]

Minimum value of the high temperature limit.

Definition at line 538 of file NasaThermo.h.

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

vector_fp m_tlow [protected]

Vector of low temperature limits (species index).

Length is equal to number of species

Definition at line 544 of file NasaThermo.h.

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

doublereal m_tlow_max [protected]

Maximum value of the low temperature limit.

Definition at line 535 of file NasaThermo.h.

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

vector_fp m_tmid [protected]

Vector of log temperature limits.

Length is equal to the number of groups.

Definition at line 532 of file NasaThermo.h.

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


The documentation for this class was generated from the following files:
Generated by  doxygen 1.6.3