Cantera  3.1.0a1
Loading...
Searching...
No Matches
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 * \hat{c}_p^\circ(T) = \hat{c}_p^\circ(T^\circ)
28 * @f]
29 * @f[
30 * \hat{h}^\circ(T) = \hat{h}^\circ\left(T_0\right)
31 * + \hat{c}_p^\circ \left(T-T^\circ\right)
32 * @f]
33 * @f[
34 * \hat{s}^\circ(T) = \hat{s}^\circ(T_0)
35 * + \hat{c}_p^\circ \ln{\left(\frac{T}{T^\circ}\right)}
36 * @f]
37 *
38 * This parameterization takes 4 input values @f$ T^\circ @f$,
39 * @f$ \hat{h}^\circ(T^\circ) @f$, @f$ \hat{s}^\circ(T^\circ) @f$ and
40 * @f$ \hat{c}_p^\circ(T^\circ) @f$, see setParameters(). The default value of
41 * @f$ T^\circ @f$ is 298.15 K; the default value for the other parameters is 0.0.
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. Contains 4 parameters
56 * in the order of setParameters() arguments.
57 */
58 ConstCpPoly(double tlow, double thigh, double pref, const double* coeffs);
59
60 /**
61 * Set ConstCpPoly parameters.
62 * @param t0 @f$ T^\circ @f$ [K]
63 * @param h0 @f$ \hat{h}^\circ(T^\circ) @f$ [J/kmol]
64 * @param s0 @f$ \hat{s}^\circ(T^\circ) @f$ [J/kmol/K]
65 * @param cp0 @f$ \hat{c}_p^\circ(T^\circ) @f$ [J/kmol/K]
66 */
67 void setParameters(double t0, double h0, double s0, double cp0);
68
69 int reportType() const override {
70 return CONSTANT_CP;
71 }
72
73 /**
74 * @copydoc SpeciesThermoInterpType::updateProperties
75 *
76 * Form and Length of the temperature polynomial:
77 * - m_t[0] = tt;
78 *
79 */
80 void updateProperties(const double* tt, double* cp_R, double* h_RT,
81 double* s_R) const override;
82
83 void updatePropertiesTemp(const double temp, double* cp_R, double* h_RT,
84 double* s_R) const override;
85
86 size_t nCoeffs() const override { return 4; }
87
88 void reportParameters(size_t& n, int& type, double& tlow, double& thigh,
89 double& pref, double* const coeffs) const override;
90
91 void getParameters(AnyMap& thermo) const override;
92
93 double reportHf298(double* const h298=nullptr) const override;
94 void modifyOneHf298(const size_t k, const double Hf298New) override;
95 void resetHf298() override;
96
97protected:
98 //! Base temperature
99 double m_t0 = 298.15;
100 //! Dimensionless value of the heat capacity
101 double m_cp0_R = 0.0;
102 //! dimensionless value of the enthalpy at t0
103 double m_h0_R = 0.0;
104 //! Dimensionless value of the entropy at t0
105 double m_s0_R = 0.0;
106 //! log of the t0 value
107 double m_logt0 = log(298.15);
108 //! Original value of h0_R, restored by calling resetHf298()
109 double m_h0_R_orig = 0.0;
110};
111
112}
113
114#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:427
A constant-heat capacity species thermodynamic property manager class.
Definition ConstCpPoly.h:45
double m_t0
Base temperature.
Definition ConstCpPoly.h:99
int reportType() const override
Returns an integer representing the type of parameterization.
Definition ConstCpPoly.h:69
double m_h0_R
dimensionless value of the enthalpy at t0
void getParameters(AnyMap &thermo) const override
Store the parameters of the species thermo object such that an identical species thermo object could ...
size_t nCoeffs() const override
This utility function returns the number of coefficients for a given type of species parameterization...
Definition ConstCpPoly.h:86
void setParameters(double t0, double h0, double s0, double cp0)
Set ConstCpPoly parameters.
void reportParameters(size_t &n, int &type, double &tlow, double &thigh, double &pref, double *const coeffs) const override
This utility function returns the type of parameterization and all of the parameters for the species.
double m_s0_R
Dimensionless value of the entropy at t0.
double m_h0_R_orig
Original value of h0_R, restored by calling resetHf298()
double m_cp0_R
Dimensionless value of the heat capacity.
void updateProperties(const double *tt, double *cp_R, double *h_RT, double *s_R) const override
Update the properties for this species, given a temperature polynomial.
double reportHf298(double *const h298=nullptr) const override
Report the 298 K Heat of Formation of the standard state of one species (J kmol-1)
void resetHf298() override
Restore the original heat of formation for this species.
double m_logt0
log of the t0 value
void modifyOneHf298(const size_t k, const double Hf298New) override
Modify the value of the 298 K Heat of Formation of one species in the phase (J kmol-1)
void updatePropertiesTemp(const double temp, double *cp_R, double *h_RT, double *s_R) const override
Compute the reference-state property of one species.
Abstract Base class for the thermodynamic manager for an individual species' reference state.
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564
Contains const definitions for types of species reference-state thermodynamics managers (see Species ...
#define CONSTANT_CP
Constant Cp.