Cantera 2.6.0
ConstCpPoly.h
Go to the documentation of this file.
1/**
2 * @file ConstCpPoly.h
3 * Headers for the \link Cantera::SpeciesThermoInterpType SpeciesThermoInterpType\endlink
4 * object that employs a constant heat capacity assumption (see \ref spthermo and
5 * \link Cantera::ConstCpPoly ConstCpPoly\endlink).
6 */
7
8// This file is part of Cantera. See License.txt in the top-level directory or
9// at https://cantera.org/license.txt for license and copyright information.
10
11#ifndef CT_CONSTCPPOLY_H
12#define CT_CONSTCPPOLY_H
13
16
17namespace Cantera
18{
19
20/**
21 * A constant-heat capacity species thermodynamic property manager class. This
22 * makes the assumption that the heat capacity is a constant. Then, the
23 * following relations are used to complete the specification of the
24 * thermodynamic functions for the species.
25 *
26 * \f[
27 * \frac{c_p(T)}{R} = Cp0\_R
28 * \f]
29 * \f[
30 * \frac{h^0(T)}{RT} = \frac{1}{T} * (h0\_R + (T - T_0) * Cp0\_R)
31 * \f]
32 * \f[
33 * \frac{s^0(T)}{R} = (s0\_R + (log(T) - log(T_0)) * Cp0\_R)
34 * \f]
35 *
36 * This parameterization takes 4 input values. These are:
37 * - c[0] = \f$ T_0 \f$(Kelvin)
38 * - c[1] = \f$ H_k^o(T_0, p_{ref}) \f$ (J/kmol)
39 * - c[2] = \f$ S_k^o(T_0, p_{ref}) \f$ (J/kmol K)
40 * - c[3] = \f$ {Cp}_k^o(T_0, p_{ref}) \f$ (J(kmol K)
41 *
42 * @ingroup spthermo
43 */
45{
46public:
48
49 //! Constructor with all input data
50 /*!
51 * @param tlow Minimum temperature
52 * @param thigh Maximum temperature
53 * @param pref reference pressure (Pa).
54 * @param coeffs Vector of coefficients used to set the parameters for
55 * the standard state for species n. There are 4
56 * coefficients for the ConstCpPoly parameterization.
57 * - c[0] = \f$ T_0 \f$(Kelvin)
58 * - c[1] = \f$ H_k^o(T_0, p_{ref}) \f$ (J/kmol)
59 * - c[2] = \f$ S_k^o(T_0, p_{ref}) \f$ (J/kmol K)
60 * - c[3] = \f$ {Cp}_k^o(T_0, p_{ref}) \f$ (J(kmol K)
61 */
62 ConstCpPoly(double tlow, double thigh, double pref, const double* coeffs);
63
64 /*!
65 * @param t0 \f$ T_0 \f$ [K]
66 * @param h0 \f$ h_k^o(T_0, p_{ref}) \f$ [J/kmol]
67 * @param s0 \f$ s_k^o(T_0, p_{ref}) \f$ [J/kmol/K]
68 * @param cp0 \f$ c_{p,k}^o(T_0, p_{ref}) \f$ [J/kmol/K]
69 */
70 void setParameters(double t0, double h0, double s0, double cp0);
71
72 virtual int reportType() const {
73 return CONSTANT_CP;
74 }
75
76 /*!
77 * @copydoc SpeciesThermoInterpType::updateProperties
78 *
79 * Form and Length of the temperature polynomial:
80 * - m_t[0] = tt;
81 *
82 */
83 void updateProperties(const doublereal* tt,
84 doublereal* cp_R, doublereal* h_RT,
85 doublereal* s_R) const;
86
87 void updatePropertiesTemp(const doublereal temp,
88 doublereal* cp_R, doublereal* h_RT,
89 doublereal* s_R) const;
90
91 size_t nCoeffs() const { return 4; }
92
93 void reportParameters(size_t& n, int& type,
94 doublereal& tlow, doublereal& thigh,
95 doublereal& pref,
96 doublereal* const coeffs) const;
97
98 virtual void getParameters(AnyMap& thermo) const;
99
100 virtual doublereal reportHf298(doublereal* const h298 = 0) const;
101 virtual void modifyOneHf298(const size_t k, const doublereal Hf298New);
102 virtual void resetHf298();
103
104protected:
105 //! Base temperature
106 doublereal m_t0;
107 //! Dimensionless value of the heat capacity
108 doublereal m_cp0_R;
109 //! dimensionless value of the enthaply at t0
110 doublereal m_h0_R;
111 //! Dimensionless value of the entropy at t0
112 doublereal m_s0_R;
113 //! log of the t0 value
114 doublereal m_logt0;
115 //! Original value of h0_R, restored by calling resetHf298()
117};
118
119}
120
121#endif
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
A map of string keys to values whose type can vary at runtime.
Definition: AnyMap.h:399
A constant-heat capacity species thermodynamic property manager class.
Definition: ConstCpPoly.h:45
virtual void resetHf298()
Restore the original heat of formation for this species.
void setParameters(double t0, double h0, double s0, double cp0)
Definition: ConstCpPoly.cpp:35
doublereal m_s0_R
Dimensionless value of the entropy at t0.
Definition: ConstCpPoly.h:112
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)
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)
Definition: ConstCpPoly.cpp:95
virtual void getParameters(AnyMap &thermo) const
Store the parameters of the species thermo object such that an identical species thermo object could ...
Definition: ConstCpPoly.cpp:85
doublereal m_logt0
log of the t0 value
Definition: ConstCpPoly.h:114
void updatePropertiesTemp(const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state property of one species.
Definition: ConstCpPoly.cpp:57
double m_h0_R_orig
Original value of h0_R, restored by calling resetHf298()
Definition: ConstCpPoly.h:116
size_t nCoeffs() const
This utility function returns the number of coefficients for a given type of species parameterization...
Definition: ConstCpPoly.h:91
doublereal m_cp0_R
Dimensionless value of the heat capacity.
Definition: ConstCpPoly.h:108
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.
Definition: ConstCpPoly.cpp:69
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.
Definition: ConstCpPoly.cpp:44
virtual int reportType() const
Returns an integer representing the type of parameterization.
Definition: ConstCpPoly.h:72
doublereal m_h0_R
dimensionless value of the enthaply at t0
Definition: ConstCpPoly.h:110
doublereal m_t0
Base temperature.
Definition: ConstCpPoly.h:106
Abstract Base class for the thermodynamic manager for an individual species' reference state.
Namespace for the Cantera kernel.
Definition: AnyMap.h:29
Contains const definitions for types of species reference-state thermodynamics managers (see Species ...
#define CONSTANT_CP
Constant Cp.