Cantera  2.3.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 http://www.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  //! empty constructor
47  //! @deprecated To be removed after Cantera 2.3.
48  ConstCpPoly();
49 
50  //! Normal constructor
51  /*!
52  * @param tlow Minimum temperature
53  * @param thigh Maximum temperature
54  * @param pref reference pressure (Pa).
55  * @param coeffs Vector of coefficients used to set the parameters for
56  * the standard state for species n. There are 4
57  * coefficients for the ConstCpPoly parameterization.
58  * - c[0] = \f$ T_0 \f$(Kelvin)
59  * - c[1] = \f$ H_k^o(T_0, p_{ref}) \f$ (J/kmol)
60  * - c[2] = \f$ S_k^o(T_0, p_{ref}) \f$ (J/kmol K)
61  * - c[3] = \f$ {Cp}_k^o(T_0, p_{ref}) \f$ (J(kmol K)
62  */
63  ConstCpPoly(double tlow, double thigh, double pref, const double* coeffs);
64 
67 
68  virtual int reportType() const {
69  return CONSTANT_CP;
70  }
71 
72  /*!
73  * @copydoc SpeciesThermoInterpType::updateProperties
74  *
75  * Form and Length of the temperature polynomial:
76  * - m_t[0] = tt;
77  *
78  */
79  void updateProperties(const doublereal* tt,
80  doublereal* cp_R, doublereal* h_RT,
81  doublereal* s_R) const;
82 
83  void updatePropertiesTemp(const doublereal temp,
84  doublereal* cp_R, doublereal* h_RT,
85  doublereal* s_R) const;
86  void reportParameters(size_t& n, int& type,
87  doublereal& tlow, doublereal& thigh,
88  doublereal& pref,
89  doublereal* const coeffs) const;
90 
91  //! @deprecated To be removed after Cantera 2.3. Use
92  //! MultiSpeciesThermo::modifySpecies instead.
93  virtual void modifyParameters(doublereal* coeffs);
94 
95  virtual doublereal reportHf298(doublereal* const h298 = 0) const;
96  virtual void modifyOneHf298(const size_t k, const doublereal Hf298New);
97  virtual void resetHf298();
98 
99 protected:
100  //! Base temperature
101  doublereal m_t0;
102  //! Dimensionless value of the heat capacity
103  doublereal m_cp0_R;
104  //! dimensionless value of the enthaply at t0
105  doublereal m_h0_R;
106  //! Dimensionless value of the entropy at t0
107  doublereal m_s0_R;
108  //! log of the t0 value
109  doublereal m_logt0;
110  //! Original value of h0_R, restored by calling resetHf298()
111  double m_h0_R_orig;
112 };
113 
114 }
115 
116 #endif
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
Abstract Base class for the thermodynamic manager for an individual species' reference state...
#define CONSTANT_CP
Constant Cp.
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 SpeciesThermoInterpType * duplMyselfAsSpeciesThermoInterpType() const
Definition: ConstCpPoly.cpp:39
virtual void modifyParameters(doublereal *coeffs)
Definition: ConstCpPoly.cpp:85
void reportParameters(size_t &n, int &type, doublereal &tlow, doublereal &thigh, doublereal &pref, doublereal *const coeffs) const
This utility function reports back the type of parameterization and all of the parameters for the spe...
Definition: ConstCpPoly.cpp:69
doublereal m_s0_R
Dimensionless value of the entropy at t0.
Definition: ConstCpPoly.h:107
A constant-heat capacity species thermodynamic property manager class.
Definition: ConstCpPoly.h:43
virtual int reportType() const
Returns an integer representing the type of parameterization.
Definition: ConstCpPoly.h:68
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
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
double m_h0_R_orig
Original value of h0_R, restored by calling resetHf298()
Definition: ConstCpPoly.h:111
doublereal m_h0_R
dimensionless value of the enthaply at t0
Definition: ConstCpPoly.h:105
doublereal m_t0
Base temperature.
Definition: ConstCpPoly.h:101
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:96
Namespace for the Cantera kernel.
Definition: application.cpp:29
virtual void resetHf298()
Restore the original heat of formation for this species.
ConstCpPoly()
empty constructor
Definition: ConstCpPoly.cpp:15
doublereal m_logt0
log of the t0 value
Definition: ConstCpPoly.h:109
doublereal m_cp0_R
Dimensionless value of the heat capacity.
Definition: ConstCpPoly.h:103