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