Cantera 2.6.0

Public Member Functions | Protected Attributes | List of all members
ConstCpPoly Class Reference
Models of Phases of Matter » Thermodynamic Properties » Species Reference-State Thermodynamic Properties

A constant-heat capacity species thermodynamic property manager class. More...

`#include <ConstCpPoly.h>`

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

## Public Member Functions
| ConstCpPoly (double tlow, double thigh, double pref, const double *coeffs)
| Constructor with all input data. More...
void | setParameters (double t0, double h0, double s0, double cp0)
virtual int | reportType () const
| Returns an integer representing the type of parameterization. More...
void | updateProperties (const doublereal *tt, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
| Update the properties for this species, given a temperature polynomial. More...
void | updatePropertiesTemp (const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
| Compute the reference-state property of one species. More...
size_t | nCoeffs () const
| This utility function returns the number of coefficients for a given type of species parameterization. More...
void | reportParameters (size_t &n, int &type, doublereal &tlow, doublereal &thigh, doublereal &pref, doublereal *const coeffs) const
| This utility function returns the type of parameterization and all of the parameters for the species. More...
virtual void | getParameters (AnyMap &thermo) const
| Store the parameters of the species thermo object such that an identical species thermo object could be reconstructed using the newSpeciesThermo() function. More...
virtual doublereal | reportHf298 (doublereal *const h298=0) 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 one species in the phase (J kmol-1) More...
virtual void | resetHf298 ()
| Restore the original heat of formation for this species. More...
Public Member Functions inherited from SpeciesThermoInterpType
| SpeciesThermoInterpType (double tlow, double thigh, double pref)
| SpeciesThermoInterpType (const SpeciesThermoInterpType &b)=delete
SpeciesThermoInterpType & | operator= (const SpeciesThermoInterpType &b)=delete
virtual doublereal | minTemp () const
| Returns the minimum temperature that the thermo parameterization is valid. More...
virtual void | setMinTemp (double Tmin)
| Set the minimum temperature at which the thermo parameterization is valid. More...
virtual doublereal | maxTemp () const
| Returns the maximum temperature that the thermo parameterization is valid. More...
virtual void | setMaxTemp (double Tmax)
| Set the maximum temperature at which the thermo parameterization is valid. More...
virtual doublereal | refPressure () const
| Returns the reference pressure (Pa) More...
virtual void | setRefPressure (double Pref)
| Set the reference pressure [Pa]. More...
virtual void | validate (const std::string &name)
| Check for problems with the parameterization, and generate warnings or throw and exception if any are found. More...
virtual int | reportType () const
| Returns an integer representing the type of parameterization. More...
virtual size_t | temperaturePolySize () const
| Number of terms in the temperature polynomial for this parameterization. More...
virtual void | updateTemperaturePoly (double T, double *T_poly) const
| Given the temperature T, compute the terms of the temperature polynomial T_poly. More...
virtual void | updateProperties (const doublereal *tt, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
| Update the properties for this species, given a temperature polynomial. More...
virtual void | updatePropertiesTemp (const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
| Compute the reference-state property of one species. More...
virtual size_t | nCoeffs () const
| This utility function returns the number of coefficients for a given type of species parameterization. More...
virtual void | reportParameters (size_t &index, int &type, doublereal &minTemp, doublereal &maxTemp, doublereal &refPressure, doublereal *const coeffs) const
| This utility function returns the type of parameterization and all of the parameters for the species. More...
AnyMap | parameters (bool withInput=true) const
| Return the parameters of the species thermo object such that an identical species thermo object could be reconstructed using the newSpeciesThermo() function. More...
virtual doublereal | reportHf298 (doublereal *const h298=0) 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 one species in the phase (J kmol-1) More...
virtual void | resetHf298 ()
| Restore the original heat of formation for this species. More...
const AnyMap & | input () const
| Access input data associated with the species thermo definition. More...
AnyMap & | input ()

## Protected Attributes
doublereal | m_t0
| Base temperature. More...
doublereal | m_cp0_R
| Dimensionless value of the heat capacity. More...
doublereal | m_h0_R
| dimensionless value of the enthaply at t0 More...
doublereal | m_s0_R
| Dimensionless value of the entropy at t0. More...
doublereal | m_logt0
| log of the t0 value More...
double | m_h0_R_orig
| Original value of h0_R, restored by calling resetHf298() More...
Protected Attributes inherited from SpeciesThermoInterpType
doublereal | m_lowT
| lowest valid temperature More...
doublereal | m_highT
| Highest valid temperature. More...
doublereal | m_Pref
| Reference state pressure. More...
AnyMap | m_input

## Additional Inherited Members
virtual void | getParameters (AnyMap &thermo) const
| Store the parameters of the species thermo object such that an identical species thermo object could be reconstructed using the newSpeciesThermo() function. 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 the species.

\[ \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:

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

Definition at line 44 of file ConstCpPoly.h.

## Constructor & Destructor Documentation

## ◆ ConstCpPoly() [1/2]

ConstCpPoly | ( |  | ) |

Definition at line 17 of file ConstCpPoly.cpp.

## ◆ ConstCpPoly() [2/2]

ConstCpPoly | ( | double | tlow,
|  | double | thigh,
|  | double | pref,
|  | const double * | coeffs
| ) |  |

Constructor with all input data.

Parameters

  tlow | Minimum temperature
  thigh | Maximum temperature
  pref | reference pressure (Pa).
  coeffs | Vector of coefficients used to set the parameters for the standard state for species n. There are 4 coefficients for the ConstCpPoly parameterization. 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)

Definition at line 28 of file ConstCpPoly.cpp.

References ConstCpPoly::setParameters().

## Member Function Documentation

## ◆ setParameters()

void setParameters | ( | double | t0,
|  | double | h0,
|  | double | s0,
|  | double | cp0
| ) |  |

Parameters

  t0 | \( T_0 \) [K]
  h0 | \( h_k^o(T_0, p_{ref}) \) [J/kmol]
  s0 | \( s_k^o(T_0, p_{ref}) \) [J/kmol/K]
  cp0 | \( c_{p,k}^o(T_0, p_{ref}) \) [J/kmol/K]

Definition at line 35 of file ConstCpPoly.cpp.

Referenced by ConstCpPoly::ConstCpPoly().

## ◆ reportType()

virtual int reportType | ( |  | ) | const
| inline virtual

Returns an integer representing the type of parameterization.

Reimplemented from SpeciesThermoInterpType.

Definition at line 72 of file ConstCpPoly.h.

References CONSTANT_CP.

## ◆ updateProperties()

void updateProperties | ( | const doublereal * | tt,
|  | doublereal * | cp_R,
|  | doublereal * | h_RT,
|  | doublereal * | s_R
| ) |  | const
| virtual

Update the properties for this species, given a temperature polynomial.

This method is called with a pointer to an array containing the functions of temperature needed by this parameterization, and three pointers to arrays where the computed property values should be written. This method updates only one value in each array.

The form and length of the Temperature Polynomial may vary depending on the parameterization.

Parameters

  tt | vector of evaluated temperature functions
  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).

Form and Length of the temperature polynomial:

- m_t[0] = tt;

Reimplemented from SpeciesThermoInterpType.

Definition at line 44 of file ConstCpPoly.cpp.

References ConstCpPoly::m_cp0_R, ConstCpPoly::m_h0_R, ConstCpPoly::m_logt0, ConstCpPoly::m_s0_R, and ConstCpPoly::m_t0.

## ◆ updatePropertiesTemp()

void updatePropertiesTemp | ( | const doublereal | temp,
|  | doublereal * | cp_R,
|  | doublereal * | h_RT,
|  | doublereal * | s_R
| ) |  | const
| virtual

Compute the reference-state property of one 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, of the species.

Parameters

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

Definition at line 57 of file ConstCpPoly.cpp.

References ConstCpPoly::m_cp0_R, ConstCpPoly::m_h0_R, ConstCpPoly::m_logt0, ConstCpPoly::m_s0_R, and ConstCpPoly::m_t0.

## ◆ nCoeffs()

size_t nCoeffs | ( |  | ) | const
| inline virtual

This utility function returns the number of coefficients for a given type of species parameterization.

Reimplemented from SpeciesThermoInterpType.

Definition at line 91 of file ConstCpPoly.h.

## ◆ reportParameters()

void reportParameters | ( | size_t & | index,
|  | int & | type,
|  | doublereal & | minTemp,
|  | doublereal & | maxTemp,
|  | doublereal & | refPressure,
|  | doublereal *const | coeffs
| ) |  | const
| virtual

This utility function returns the type of parameterization and all of the parameters for the species.

All parameters are output variables

Parameters

  index | Species index
  type | Integer type of the standard type
  minTemp | output - Minimum temperature
  maxTemp | output - Maximum temperature
  refPressure | output - reference pressure (Pa).
  coeffs | Vector of coefficients used to set the parameters for the standard state.

Reimplemented from SpeciesThermoInterpType.

Definition at line 69 of file ConstCpPoly.cpp.

## ◆ getParameters()

void getParameters | ( | AnyMap & | thermo | ) | const
| virtual

Store the parameters of the species thermo object such that an identical species thermo object could be reconstructed using the newSpeciesThermo() function.

Reimplemented from SpeciesThermoInterpType.

Definition at line 85 of file ConstCpPoly.cpp.

References Cantera::GasConstant, SpeciesThermoInterpType::getParameters(), ConstCpPoly::m_cp0_R, ConstCpPoly::m_h0_R, ConstCpPoly::m_s0_R, and ConstCpPoly::m_t0.

## ◆ reportHf298()

doublereal reportHf298 | ( | doublereal *const | h298 = `0` | ) | 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

  h298 | If this is nonnull, the current value of the Heat of Formation at 298K and 1 bar for species m_speciesIndex is returned in h298[m_speciesIndex].

Returns
  the current value of the Heat of Formation at 298K and 1 bar for species m_speciesIndex.

Reimplemented from SpeciesThermoInterpType.

Definition at line 95 of file ConstCpPoly.cpp.

References Cantera::GasConstant, ConstCpPoly::m_cp0_R, ConstCpPoly::m_h0_R, and ConstCpPoly::m_t0.

Referenced by ConstCpPoly::modifyOneHf298().

## ◆ modifyOneHf298()

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

Modify the value of the 298 K Heat of Formation 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

  k | Species k
  Hf298New | Specify the new value of the Heat of Formation at 298K and 1 bar

Reimplemented from SpeciesThermoInterpType.

Definition at line 105 of file ConstCpPoly.cpp.

References Cantera::GasConstant, ConstCpPoly::m_h0_R, and ConstCpPoly::reportHf298().

## ◆ resetHf298()

void resetHf298 | ( |  | ) |
| virtual

Restore the original heat of formation for this species.

Resets changes made by modifyOneHf298().

Reimplemented from SpeciesThermoInterpType.

Definition at line 112 of file ConstCpPoly.cpp.

References ConstCpPoly::m_h0_R, and ConstCpPoly::m_h0_R_orig.

## Member Data Documentation

## ◆ m_t0

doublereal m_t0
| protected

Base temperature.

Definition at line 106 of file ConstCpPoly.h.

Referenced by ConstCpPoly::getParameters(), ConstCpPoly::reportHf298(), ConstCpPoly::updateProperties(), and ConstCpPoly::updatePropertiesTemp().

## ◆ m_cp0_R

doublereal m_cp0_R
| protected

Dimensionless value of the heat capacity.

Definition at line 108 of file ConstCpPoly.h.

Referenced by ConstCpPoly::getParameters(), ConstCpPoly::reportHf298(), ConstCpPoly::updateProperties(), and ConstCpPoly::updatePropertiesTemp().

## ◆ m_h0_R

doublereal m_h0_R
| protected

dimensionless value of the enthaply at t0

Definition at line 110 of file ConstCpPoly.h.

Referenced by ConstCpPoly::getParameters(), ConstCpPoly::modifyOneHf298(), ConstCpPoly::reportHf298(), ConstCpPoly::resetHf298(), ConstCpPoly::updateProperties(), and ConstCpPoly::updatePropertiesTemp().

## ◆ m_s0_R

doublereal m_s0_R
| protected

Dimensionless value of the entropy at t0.

Definition at line 112 of file ConstCpPoly.h.

Referenced by ConstCpPoly::getParameters(), ConstCpPoly::updateProperties(), and ConstCpPoly::updatePropertiesTemp().

## ◆ m_logt0

doublereal m_logt0
| protected

log of the t0 value

Definition at line 114 of file ConstCpPoly.h.

Referenced by ConstCpPoly::updateProperties(), and ConstCpPoly::updatePropertiesTemp().

## ◆ m_h0_R_orig

double m_h0_R_orig
| protected

Original value of h0_R, restored by calling resetHf298()

Definition at line 116 of file ConstCpPoly.h.

Referenced by ConstCpPoly::resetHf298().

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

- ConstCpPoly.h
- ConstCpPoly.cpp