| Cantera 3.0.0

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
14#include "cantera/thermo/SpeciesThermoInterpType.h"
15#include "cantera/thermo/speciesThermoTypes.h"
16
17 namespace 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 */
44 class ConstCpPoly: public SpeciesThermoInterpType
45{
46 public:
47 ConstCpPoly();
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
97 protected:
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
SpeciesThermoInterpType.h
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
Cantera::AnyMap
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:427
Cantera::ConstCpPoly
A constant-heat capacity species thermodynamic property manager class.
Definition ConstCpPoly.h:45
Cantera::ConstCpPoly::m_t0
double m_t0
Base temperature.
Definition ConstCpPoly.h:99
Cantera::ConstCpPoly::reportType
int reportType() const override
Returns an integer representing the type of parameterization.
Definition ConstCpPoly.h:69
Cantera::ConstCpPoly::m_h0_R
double m_h0_R
dimensionless value of the enthalpy at t0
Definition ConstCpPoly.h:103
Cantera::ConstCpPoly::getParameters
void getParameters(AnyMap &thermo) const override
Store the parameters of the species thermo object such that an identical species thermo object could ...
Definition ConstCpPoly.cpp:77
Cantera::ConstCpPoly::nCoeffs
size_t nCoeffs() const override
This utility function returns the number of coefficients for a given type of species parameterization...
Definition ConstCpPoly.h:86
Cantera::ConstCpPoly::setParameters
void setParameters(double t0, double h0, double s0, double cp0)
Set ConstCpPoly parameters.
Definition ConstCpPoly.cpp:29
Cantera::ConstCpPoly::reportParameters
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.
Definition ConstCpPoly.cpp:63
Cantera::ConstCpPoly::m_s0_R
double m_s0_R
Dimensionless value of the entropy at t0.
Definition ConstCpPoly.h:105
Cantera::ConstCpPoly::m_h0_R_orig
double m_h0_R_orig
Original value of h0_R, restored by calling resetHf298()
Definition ConstCpPoly.h:109
Cantera::ConstCpPoly::m_cp0_R
double m_cp0_R
Dimensionless value of the heat capacity.
Definition ConstCpPoly.h:101
Cantera::ConstCpPoly::updateProperties
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.
Definition ConstCpPoly.cpp:38
Cantera::ConstCpPoly::reportHf298
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)
Definition ConstCpPoly.cpp:87
Cantera::ConstCpPoly::resetHf298
void resetHf298() override
Restore the original heat of formation for this species.
Definition ConstCpPoly.cpp:104
Cantera::ConstCpPoly::m_logt0
double m_logt0
log of the t0 value
Definition ConstCpPoly.h:107
Cantera::ConstCpPoly::modifyOneHf298
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)
Definition ConstCpPoly.cpp:97
Cantera::ConstCpPoly::updatePropertiesTemp
void updatePropertiesTemp(const double temp, double *cp_R, double *h_RT, double *s_R) const override
Compute the reference-state property of one species.
Definition ConstCpPoly.cpp:51
Cantera::SpeciesThermoInterpType
Abstract Base class for the thermodynamic manager for an individual species' reference state.
Definition SpeciesThermoInterpType.h:113
Cantera
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564
speciesThermoTypes.h
Contains const definitions for types of species reference-state thermodynamics managers (see Species ...
CONSTANT_CP
#define CONSTANT_CP
Constant Cp.
Definition speciesThermoTypes.h:13