Cantera 2.6.0

PDSS_SSVol.h
Go to the documentation of this file.
1/**
2 * @file PDSS_SSVol.h
3 * Declarations for the class PDSS_SSVol (pressure dependent standard state)
4 * which handles calculations for a single species with an expression for the standard state molar volume in a phase
5 * given by an enumerated data type
6 * (see class \ref pdssthermo and \link Cantera::PDSS_SSVol PDSS_SSVol\endlink).
7 */
8
9// This file is part of Cantera. See License.txt in the top-level directory or
10// at https://cantera.org/license.txt for license and copyright information.
11
12#ifndef CT_PDSS_SSVOL_H
13#define CT_PDSS_SSVOL_H
14
15#include "PDSS.h"
16
17 namespace Cantera
18{
19//! Class for pressure dependent standard states that uses a standard state
20//! volume model of some sort.
21/*!
22 * @attention This class currently does not have any test cases or examples. Its
23 * implementation may be incomplete, and future changes to Cantera may
24 * unexpectedly cause this class to stop working. If you use this class,
25 * please consider contributing examples or test cases. In the absence of
26 * new tests or examples, this class may be deprecated and removed in a
27 * future version of Cantera. See
28 * https://github.com/Cantera/cantera/issues/267 for additional information.
29 *
30 * Class PDSS_SSVol is an implementation class that compute the properties of a
31 * single species in a phase at its standard states, for a range of temperatures
32 * and pressures. This particular class assumes that the calculation of the
33 * thermodynamics functions can be separated into a temperature polynomial
34 * representation for thermo functions that can be handled by a SimpleThermo
35 * object and a separate calculation for the standard state volume. The Models
36 * include a cubic polynomial in temperature for either the standard state
37 * volume or the standard state density. The manager uses a SimpleThermo object
38 * to handle the calculation of the reference state. This object then adds the
39 * pressure dependencies and the volume terms to these thermo functions to
40 * complete the representation.
41 *
42 * The class includes the following models for the representation of the
43 * standard state volume:
44 *
45 * - Temperature polynomial for the standard state volume
46 * - This standard state model is invoked with the keyword "temperature_polynomial".
47 * The standard state volume is considered a function of temperature only.
48 * \f[
49 * V^o_k(T,P) = a_0 + a_1 T + a_2 T^2 + a_3 T^3
50 * \f]
51 *
52 * - Temperature polynomial for the standard state density
53 * - This standard state model is invoked with the keyword "density_temperature_polynomial".
54 * The standard state density, which is the inverse of the volume,
55 * is considered a function of temperature only.
56 * \f[
57 * {\rho}^o_k(T,P) = \frac{M_k}{V^o_k(T,P)} = a_0 + a_1 T + a_2 T^2 + a_3 T^3
58 * \f]
59 *
60 * ## Specification of Species Standard State Properties
61 *
62 * The standard molar Gibbs free energy for species *k* is determined from
63 * the enthalpy and entropy expressions
64 *
65 * \f[
66 * G^o_k(T,P) = H^o_k(T,P) - S^o_k(T,P)
67 * \f]
68 *
69 * The enthalpy is calculated mostly from the MultiSpeciesThermo object's enthalpy
70 * evaluator. The dependence on pressure originates from the Maxwell relation
71 *
72 * \f[
73 * {\left(\frac{dH^o_k}{dP}\right)}_T = T {\left(\frac{dS^o_k}{dP}\right)}_T + V^o_k
74 * \f]
75 * which is equal to
76 *
77 * \f[
78 * {\left(\frac{dH^o_k}{dP}\right)}_T = V^o_k - T {\left(\frac{dV^o_k}{dT}\right)}_P
79 * \f]
80 *
81 * The entropy is calculated mostly from the MultiSpeciesThermo objects entropy
82 * evaluator. The dependence on pressure originates from the Maxwell relation:
83 *
84 * \f[
85 * {\left(\frac{dS^o_k}{dP}\right)}_T = - {\left(\frac{dV^o_k}{dT}\right)}_P
86 * \f]
87 *
88 * The standard state constant-pressure heat capacity expression is obtained
89 * from taking the temperature derivative of the Maxwell relation involving the
90 * enthalpy given above to yield an expression for the pressure dependence of
91 * the heat capacity.
92 *
93 * \f[
94 * {\left(\frac{d{C}^o_{p,k}}{dP}\right)}_T = - T {\left(\frac{{d}^2{V}^o_k}{{dT}^2}\right)}_T
95 * \f]
96 *
97 * The standard molar Internal Energy for species *k* is determined from the
98 * following relation.
99 *
100 * \f[
101 * U^o_k(T,P) = H^o_k(T,P) - p V^o_k
102 * \f]
103 *
104 * ## XML Example
105 *
106 * *Note: The XML input format is deprecated and will be removed in %Cantera 3.0*
107 *
108 * An example of the specification of a standard state for the LiCl molten salt
109 * which has a temperature dependent standard state volume.
110 *
111 * @code
112 * <speciesData id="species_MoltenSalt">
113 * <species name="LiCl(L)">
114 * <atomArray> Li:1 Cl:1 </atomArray>
115 * <standardState model="density_temperature_polynomial">
116 * <densityTemperaturePolynomial units="gm/cm3" >
117 * 1.98715, -5.890906E-4, 0.0, 0.0
118 * </densityTemperaturePolynomial>
119 * </standardState>
120 * <thermo>
121 * <Shomate Pref="1 bar" Tmax="2000.0" Tmin="700.0">
122 * <floatArray size="7">
123 * 73.18025, -9.047232, -0.316390,
124 * 0.079587, 0.013594, -417.1314,
125 * 157.6711
126 * </floatArray>
127 * </Shomate>
128 * </thermo>
129 * </species>
130 * </speciesData>
131 * @endcode
132 *
133 * @ingroup pdssthermo
134 */
135 class PDSS_SSVol : public PDSS_Nondimensional
136{
137 public:
138 //! Default Constructor
139 PDSS_SSVol();
140
141 //! @name Molar Thermodynamic Properties of the Species Standard State in the Solution
142 //! @{
143
144 // See PDSS.h for documentation of functions overridden from Class PDSS
145
146 virtual doublereal intEnergy_mole() const;
147 virtual doublereal cv_mole() const;
148
149 //! @}
150
151 //! @name Mechanical Equation of State Properties
152 //! @{
153
154 virtual void setPressure(doublereal pres);
155 virtual void setTemperature(doublereal temp);
156 virtual void setState_TP(doublereal temp, doublereal pres);
157
158 //! @}
159 //! @name Miscellaneous properties of the standard state
160 //! @{
161
162 virtual doublereal satPressure(doublereal t);
163
164 //! @}
165 //! @name Initialization of the Object
166 //! @{
167
168 virtual void initThermo();
169
170 //! Set polynomial coefficients for the standard state molar volume as a
171 //! function of temperature. Cubic polynomial (4 coefficients). Leading
172 //! coefficient is the constant (temperature-independent) term [m^3/kmol].
173 void setVolumePolynomial(double* coeffs);
174
175 //! Set polynomial coefficients for the standard state density as a function
176 //! of temperature. Cubic polynomial (4 coefficients). Leading coefficient
177 //! is the constant (temperature-independent) term [kg/m^3].
178 void setDensityPolynomial(double* coeffs);
179
180 virtual void setParametersFromXML(const XML_Node& speciesNode);
181 virtual void getParameters(AnyMap& eosNode) const;
182
183 //! @}
184
185 private:
186 //! Does the internal calculation of the volume
187 void calcMolarVolume();
188
189 //! Types of general formulations for the specification of the standard
190 //! state volume
191 enum class SSVolume_Model {
192 //! This approximation is for a species with a cubic polynomial in
193 //! temperature
194 /*!
195 * V^ss = a_0 + a_1 T + a_2 T^2 + a_3 T^3
196 */
197 tpoly,
198 //! This approximation is for a species where the density is expressed
199 //! as a cubic polynomial in temperature
200 /*!
201 * V^ss = M / (a_0 + a_1 T + a_2 T^2 + a_3 T^3)
202 */
203 density_tpoly
204 };
205
206 //! Enumerated data type describing the type of volume model
207 //! used to calculate the standard state volume of the species
208 SSVolume_Model volumeModel_;
209
210 //! coefficients for the temperature representation
211 vector_fp TCoeff_;
212
213 //! Derivative of the volume wrt temperature
214 mutable doublereal dVdT_;
215
216 //! 2nd derivative of the volume wrt temperature
217 mutable doublereal d2VdT2_;
218};
219
220}
221
222#endif
PDSS.h
Declarations for the virtual base class PDSS (pressure dependent standard state) which handles calcul...
Cantera::AnyMap
A map of string keys to values whose type can vary at runtime.
Definition: AnyMap.h:399
Cantera::PDSS_Nondimensional
Base class for PDSS classes which compute nondimensional properties directly.
Definition: PDSS.h:493
Cantera::PDSS_SSVol
Class for pressure dependent standard states that uses a standard state volume model of some sort.
Definition: PDSS_SSVol.h:136
Cantera::PDSS_SSVol::getParameters
virtual void getParameters(AnyMap &eosNode) const
Store the parameters needed to reconstruct a copy of this PDSS object.
Definition: PDSS_SSVol.cpp:68
Cantera::PDSS_SSVol::d2VdT2_
doublereal d2VdT2_
2nd derivative of the volume wrt temperature
Definition: PDSS_SSVol.h:217
Cantera::PDSS_SSVol::setPressure
virtual void setPressure(doublereal pres)
Sets the pressure in the object.
Definition: PDSS_SSVol.cpp:149
Cantera::PDSS_SSVol::setDensityPolynomial
void setDensityPolynomial(double *coeffs)
Set polynomial coefficients for the standard state density as a function of temperature.
Definition: PDSS_SSVol.cpp:61
Cantera::PDSS_SSVol::setVolumePolynomial
void setVolumePolynomial(double *coeffs)
Set polynomial coefficients for the standard state molar volume as a function of temperature.
Definition: PDSS_SSVol.cpp:54
Cantera::PDSS_SSVol::setState_TP
virtual void setState_TP(doublereal temp, doublereal pres)
Set the internal temperature and pressure.
Definition: PDSS_SSVol.cpp:190
Cantera::PDSS_SSVol::cv_mole
virtual doublereal cv_mole() const
Return the molar const volume heat capacity in units of J kmol-1 K-1.
Definition: PDSS_SSVol.cpp:123
Cantera::PDSS_SSVol::TCoeff_
vector_fp TCoeff_
coefficients for the temperature representation
Definition: PDSS_SSVol.h:211
Cantera::PDSS_SSVol::setTemperature
virtual void setTemperature(doublereal temp)
Set the internal temperature.
Definition: PDSS_SSVol.cpp:168
Cantera::PDSS_SSVol::PDSS_SSVol
PDSS_SSVol()
Default Constructor.
Definition: PDSS_SSVol.cpp:19
Cantera::PDSS_SSVol::dVdT_
doublereal dVdT_
Derivative of the volume wrt temperature.
Definition: PDSS_SSVol.h:214
Cantera::PDSS_SSVol::initThermo
virtual void initThermo()
Initialization routine.
Definition: PDSS_SSVol.cpp:88
Cantera::PDSS_SSVol::SSVolume_Model
SSVolume_Model
Types of general formulations for the specification of the standard state volume.
Definition: PDSS_SSVol.h:191
Cantera::PDSS_SSVol::setParametersFromXML
virtual void setParametersFromXML(const XML_Node &speciesNode)
Initialization routine for the PDSS object based on the speciesNode.
Definition: PDSS_SSVol.cpp:25
Cantera::PDSS_SSVol::calcMolarVolume
void calcMolarVolume()
Does the internal calculation of the volume.
Definition: PDSS_SSVol.cpp:128
Cantera::PDSS_SSVol::satPressure
virtual doublereal satPressure(doublereal t)
saturation pressure
Definition: PDSS_SSVol.cpp:196
Cantera::PDSS_SSVol::volumeModel_
SSVolume_Model volumeModel_
Enumerated data type describing the type of volume model used to calculate the standard state volume ...
Definition: PDSS_SSVol.h:208
Cantera::PDSS_SSVol::intEnergy_mole
virtual doublereal intEnergy_mole() const
Return the molar internal Energy in units of J kmol-1.
Definition: PDSS_SSVol.cpp:117
Cantera::XML_Node
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:103
Cantera
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:557
Cantera::vector_fp
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Definition: ct_defs.h:184