| Cantera 3.0.0

Loading...
Searching...
No Matches
PDSS.cpp
Go to the documentation of this file.
1/**
2 * @file PDSS.cpp
3 * Implementation of a pressure dependent standard state
4 * virtual function
5 * (see class @link Cantera::PDSS PDSS@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#include "cantera/base/global.h"
12#include "cantera/thermo/PDSS.h"
13#include "cantera/thermo/VPStandardStateTP.h"
14
15 namespace Cantera
16{
17
18 double PDSS::enthalpy_mole() const
19{
20 throw NotImplementedError("PDSS::enthalpy_mole");
21}
22
23 double PDSS::enthalpy_RT() const
24{
25 throw NotImplementedError("PDSS::enthalpy_RT");
26}
27
28 double PDSS::intEnergy_mole() const
29{
30 throw NotImplementedError("PDSS::intEnergy_mole");
31}
32
33 double PDSS::entropy_mole() const
34{
35 throw NotImplementedError("PDSS::entropy_mole");
36}
37
38 double PDSS::entropy_R() const
39{
40 throw NotImplementedError("PDSS::entropy_R");
41}
42
43 double PDSS::gibbs_mole() const
44{
45 throw NotImplementedError("PDSS::gibbs_mole");
46}
47
48 double PDSS::gibbs_RT() const
49{
50 throw NotImplementedError("PDSS::gibbs_RT");
51}
52
53 double PDSS::cp_mole() const
54{
55 throw NotImplementedError("PDSS::cp_mole");
56}
57
58 double PDSS::cp_R() const
59{
60 throw NotImplementedError("PDSS::cp_R");
61}
62
63 double PDSS::molarVolume() const
64{
65 throw NotImplementedError("PDSS::molarVolume");
66}
67
68 double PDSS::density() const
69{
70 throw NotImplementedError("PDSS::density");
71}
72
73 double PDSS::cv_mole() const
74{
75 throw NotImplementedError("PDSS::cv_mole");
76}
77
78 double PDSS::gibbs_RT_ref() const
79{
80 throw NotImplementedError("PDSS::gibbs_RT_ref");
81}
82
83 double PDSS::enthalpy_RT_ref() const
84{
85 throw NotImplementedError("PDSS::enthalpy_RT_ref");
86}
87
88 double PDSS::entropy_R_ref() const
89{
90 throw NotImplementedError("PDSS::entropy_RT_ref");
91}
92
93 double PDSS::cp_R_ref() const
94{
95 throw NotImplementedError("PDSS::entropy_RT_ref");
96}
97
98 double PDSS::molarVolume_ref() const
99{
100 throw NotImplementedError("PDSS::molarVolume_ref");
101}
102
103 double PDSS::enthalpyDelp_mole() const
104{
105 warn_deprecated("PDSS::enthalpyDelp_mole", "To be removed after Cantera 3.0");
106 return enthalpy_mole() - m_temp * GasConstant * enthalpy_RT_ref();
107}
108
109 double PDSS::entropyDelp_mole() const
110{
111 warn_deprecated("PDSS::entropyDelp_mole", "To be removed after Cantera 3.0");
112 return entropy_mole() - GasConstant * entropy_R_ref();
113}
114
115 double PDSS::gibbsDelp_mole() const
116{
117 warn_deprecated("PDSS::gibbsDelp_mole", "To be removed after Cantera 3.0");
118 return gibbs_mole() - m_temp * GasConstant * gibbs_RT_ref();
119}
120
121 double PDSS::cpDelp_mole() const
122{
123 warn_deprecated("PDSS::cpDelp_mole", "To be removed after Cantera 3.0");
124 return cp_mole() - GasConstant * cp_R_ref();
125}
126
127 double PDSS::pressure() const
128{
129 return m_pres;
130}
131
132 double PDSS::thermalExpansionCoeff() const
133{
134 throw NotImplementedError("PDSS::thermalExpansionCoeff");
135}
136
137 double PDSS::critTemperature() const
138{
139 throw NotImplementedError("PDSS::critTemperature");
140}
141
142 double PDSS::critPressure() const
143{
144 throw NotImplementedError("PDSS::critPressure");
145}
146
147 double PDSS::critDensity() const
148{
149 throw NotImplementedError("PDSS::critDensity");
150}
151
152 void PDSS::setPressure(double pres)
153{
154 m_pres = pres;
155}
156
157 double PDSS::temperature() const
158{
159 return m_temp;
160}
161
162 void PDSS::setTemperature(double temp)
163{
164 m_temp = temp;
165}
166
167 double PDSS::molecularWeight() const
168{
169 return m_mw;
170}
171 void PDSS::setMolecularWeight(double mw)
172{
173 m_mw = mw;
174}
175
176 void PDSS::setState_TP(double temp, double pres)
177{
178 throw NotImplementedError("PDSS::setState_TP");
179}
180
181 void PDSS::setState_TR(double temp, double rho)
182{
183 throw NotImplementedError("PDSS::setState_TR");
184}
185
186 double PDSS::satPressure(double t)
187{
188 throw NotImplementedError("PDSS::satPressure");
189}
190
191 void PDSS::reportParams(size_t& kindex, int& type, double* const c, double& minTemp_,
192 double& maxTemp_, double& refPressure_) const
193{
194 warn_deprecated("PDSS:reportParams", "To be removed after Cantera 3.0. "
195 "Use getParameters(AnyMap&) instead.");
196 kindex = npos;
197 type = 0;
198 minTemp_ = m_minTemp;
199 maxTemp_ = m_maxTemp;
200 refPressure_ = m_p0;
201}
202
203// PDSS_Molar methods
204
205 double PDSS_Molar::enthalpy_RT() const
206{
207 return enthalpy_mole() / (GasConstant * temperature());
208}
209
210 double PDSS_Molar::entropy_R() const
211{
212 return entropy_mole() / GasConstant;
213}
214
215 double PDSS_Molar::gibbs_RT() const
216{
217 return gibbs_mole() / (GasConstant * temperature());
218}
219
220 double PDSS_Molar::cp_R() const
221{
222 return cp_mole() / GasConstant;
223}
224
225// PDSS_Nondimensional methods
226
227PDSS_Nondimensional::PDSS_Nondimensional()
228 : m_h0_RT(0.0)
229 , m_cp0_R(0.0)
230 , m_s0_R(0.0)
231 , m_g0_RT(0.0)
232 , m_V0(0.0)
233 , m_hss_RT(0.0)
234 , m_cpss_R(0.0)
235 , m_sss_R(0.0)
236 , m_gss_RT(0.0)
237 , m_Vss(0.0)
238{
239}
240
241 double PDSS_Nondimensional::enthalpy_mole() const
242{
243 return enthalpy_RT() * GasConstant * temperature();
244}
245
246 double PDSS_Nondimensional::entropy_mole() const
247{
248 return entropy_R() * GasConstant;
249}
250
251 double PDSS_Nondimensional::gibbs_mole() const
252{
253 return gibbs_RT() * GasConstant * temperature();
254}
255
256 double PDSS_Nondimensional::cp_mole() const
257{
258 return cp_R() * GasConstant;
259}
260
261 double PDSS_Nondimensional::gibbs_RT_ref() const
262{
263 return m_g0_RT;
264}
265
266 double PDSS_Nondimensional::enthalpy_RT_ref() const
267{
268 return m_h0_RT;
269}
270
271 double PDSS_Nondimensional::entropy_R_ref() const
272{
273 return m_s0_R;
274}
275
276 double PDSS_Nondimensional::cp_R_ref() const
277{
278 return m_cp0_R;
279}
280
281 double PDSS_Nondimensional::molarVolume_ref() const
282{
283 return m_V0;
284}
285
286 double PDSS_Nondimensional::enthalpy_RT() const
287{
288 return m_hss_RT;
289}
290
291 double PDSS_Nondimensional::entropy_R() const
292{
293 return m_sss_R;
294}
295
296 double PDSS_Nondimensional::gibbs_RT() const
297{
298 return m_gss_RT;
299}
300
301 double PDSS_Nondimensional::cp_R() const
302{
303 return m_cpss_R;
304}
305
306 double PDSS_Nondimensional::molarVolume() const
307{
308 return m_Vss;
309}
310
311 double PDSS_Nondimensional::density() const
312{
313 return m_mw / m_Vss;
314}
315
316}
PDSS.h
Declarations for the virtual base class PDSS (pressure dependent standard state) which handles calcul...
VPStandardStateTP.h
Header file for a derived class of ThermoPhase that handles variable pressure standard state methods ...
Cantera::NotImplementedError
An error indicating that an unimplemented function has been called.
Definition ctexceptions.h:195
Cantera::PDSS_Molar::cp_R
double cp_R() const override
Return the molar const pressure heat capacity divided by RT.
Definition PDSS.cpp:220
Cantera::PDSS_Molar::entropy_R
double entropy_R() const override
Return the standard state entropy divided by RT.
Definition PDSS.cpp:210
Cantera::PDSS_Molar::enthalpy_RT
double enthalpy_RT() const override
Return the standard state molar enthalpy divided by RT.
Definition PDSS.cpp:205
Cantera::PDSS_Molar::gibbs_RT
double gibbs_RT() const override
Return the molar Gibbs free energy divided by RT.
Definition PDSS.cpp:215
Cantera::PDSS_Nondimensional::molarVolume
double molarVolume() const override
Return the molar volume at standard state.
Definition PDSS.cpp:306
Cantera::PDSS_Nondimensional::enthalpy_mole
double enthalpy_mole() const override
Return the molar enthalpy in units of J kmol-1.
Definition PDSS.cpp:241
Cantera::PDSS_Nondimensional::m_sss_R
double m_sss_R
Standard state entropy divided by R.
Definition PDSS.h:516
Cantera::PDSS_Nondimensional::gibbs_RT_ref
double gibbs_RT_ref() const override
Return the molar Gibbs free energy divided by RT at reference pressure.
Definition PDSS.cpp:261
Cantera::PDSS_Nondimensional::cp_R
double cp_R() const override
Return the molar const pressure heat capacity divided by RT.
Definition PDSS.cpp:301
Cantera::PDSS_Nondimensional::m_cpss_R
double m_cpss_R
Standard state heat capacity divided by R.
Definition PDSS.h:515
Cantera::PDSS_Nondimensional::entropy_R_ref
double entropy_R_ref() const override
Return the molar entropy divided by R at reference pressure.
Definition PDSS.cpp:271
Cantera::PDSS_Nondimensional::enthalpy_RT_ref
double enthalpy_RT_ref() const override
Return the molar enthalpy divided by RT at reference pressure.
Definition PDSS.cpp:266
Cantera::PDSS_Nondimensional::m_h0_RT
double m_h0_RT
Reference state enthalpy divided by RT.
Definition PDSS.h:509
Cantera::PDSS_Nondimensional::m_g0_RT
double m_g0_RT
Reference state Gibbs free energy divided by RT.
Definition PDSS.h:512
Cantera::PDSS_Nondimensional::m_s0_R
double m_s0_R
Reference state entropy divided by R.
Definition PDSS.h:511
Cantera::PDSS_Nondimensional::entropy_mole
double entropy_mole() const override
Return the molar entropy in units of J kmol-1 K-1.
Definition PDSS.cpp:246
Cantera::PDSS_Nondimensional::m_gss_RT
double m_gss_RT
Standard state Gibbs free energy divided by RT.
Definition PDSS.h:517
Cantera::PDSS_Nondimensional::entropy_R
double entropy_R() const override
Return the standard state entropy divided by RT.
Definition PDSS.cpp:291
Cantera::PDSS_Nondimensional::m_cp0_R
double m_cp0_R
Reference state heat capacity divided by R.
Definition PDSS.h:510
Cantera::PDSS_Nondimensional::cp_mole
double cp_mole() const override
Return the molar const pressure heat capacity in units of J kmol-1 K-1.
Definition PDSS.cpp:256
Cantera::PDSS_Nondimensional::enthalpy_RT
double enthalpy_RT() const override
Return the standard state molar enthalpy divided by RT.
Definition PDSS.cpp:286
Cantera::PDSS_Nondimensional::m_Vss
double m_Vss
Standard State molar volume (m^3/kmol)
Definition PDSS.h:518
Cantera::PDSS_Nondimensional::density
double density() const override
Return the standard state density at standard state.
Definition PDSS.cpp:311
Cantera::PDSS_Nondimensional::gibbs_mole
double gibbs_mole() const override
Return the molar Gibbs free energy in units of J kmol-1.
Definition PDSS.cpp:251
Cantera::PDSS_Nondimensional::m_hss_RT
double m_hss_RT
Standard state enthalpy divided by RT.
Definition PDSS.h:514
Cantera::PDSS_Nondimensional::molarVolume_ref
double molarVolume_ref() const override
Return the molar volume at reference pressure.
Definition PDSS.cpp:281
Cantera::PDSS_Nondimensional::gibbs_RT
double gibbs_RT() const override
Return the molar Gibbs free energy divided by RT.
Definition PDSS.cpp:296
Cantera::PDSS_Nondimensional::m_V0
double m_V0
Reference state molar volume (m^3/kmol)
Definition PDSS.h:513
Cantera::PDSS_Nondimensional::cp_R_ref
double cp_R_ref() const override
Return the molar heat capacity divided by R at reference pressure.
Definition PDSS.cpp:276
Cantera::PDSS::satPressure
virtual double satPressure(double T)
saturation pressure
Definition PDSS.cpp:186
Cantera::PDSS::molecularWeight
double molecularWeight() const
Return the molecular weight of the species in units of kg kmol-1.
Definition PDSS.cpp:167
Cantera::PDSS::enthalpyDelp_mole
virtual double enthalpyDelp_mole() const
Get the difference in the standard state enthalpy between the current pressure and the reference pres...
Definition PDSS.cpp:103
Cantera::PDSS::cv_mole
virtual double cv_mole() const
Return the molar const volume heat capacity in units of J kmol-1 K-1.
Definition PDSS.cpp:73
Cantera::PDSS::reportParams
virtual void reportParams(size_t &kindex, int &type, double *const c, double &minTemp, double &maxTemp, double &refPressure) const
This utility function reports back the type of parameterization and all of the parameters for the spe...
Definition PDSS.cpp:191
Cantera::PDSS::setTemperature
virtual void setTemperature(double temp)
Set the internal temperature.
Definition PDSS.cpp:162
Cantera::PDSS::entropy_mole
virtual double entropy_mole() const
Return the molar entropy in units of J kmol-1 K-1.
Definition PDSS.cpp:33
Cantera::PDSS::enthalpy_mole
virtual double enthalpy_mole() const
Return the molar enthalpy in units of J kmol-1.
Definition PDSS.cpp:18
Cantera::PDSS::gibbs_RT
virtual double gibbs_RT() const
Return the molar Gibbs free energy divided by RT.
Definition PDSS.cpp:48
Cantera::PDSS::m_p0
double m_p0
Reference state pressure of the species.
Definition PDSS.h:455
Cantera::PDSS::cp_R_ref
virtual double cp_R_ref() const
Return the molar heat capacity divided by R at reference pressure.
Definition PDSS.cpp:93
Cantera::PDSS::m_temp
double m_temp
Current temperature used by the PDSS object.
Definition PDSS.h:449
Cantera::PDSS::density
virtual double density() const
Return the standard state density at standard state.
Definition PDSS.cpp:68
Cantera::PDSS::pressure
virtual double pressure() const
Returns the pressure (Pa)
Definition PDSS.cpp:127
Cantera::PDSS::gibbsDelp_mole
virtual double gibbsDelp_mole() const
Get the difference in the standard state Gibbs free energy between the current pressure and the refer...
Definition PDSS.cpp:115
Cantera::PDSS::entropyDelp_mole
virtual double entropyDelp_mole() const
Get the difference in the standard state entropy between the current pressure and the reference press...
Definition PDSS.cpp:109
Cantera::PDSS::setMolecularWeight
void setMolecularWeight(double mw)
Set the molecular weight of the species.
Definition PDSS.cpp:171
Cantera::PDSS::cp_mole
virtual double cp_mole() const
Return the molar const pressure heat capacity in units of J kmol-1 K-1.
Definition PDSS.cpp:53
Cantera::PDSS::gibbs_mole
virtual double gibbs_mole() const
Return the molar Gibbs free energy in units of J kmol-1.
Definition PDSS.cpp:43
Cantera::PDSS::temperature
virtual double temperature() const
Return the current stored temperature.
Definition PDSS.cpp:157
Cantera::PDSS::entropy_R_ref
virtual double entropy_R_ref() const
Return the molar entropy divided by R at reference pressure.
Definition PDSS.cpp:88
Cantera::PDSS::setState_TR
virtual void setState_TR(double temp, double rho)
Set the internal temperature and density.
Definition PDSS.cpp:181
Cantera::PDSS::m_pres
double m_pres
State of the system - pressure.
Definition PDSS.h:452
Cantera::PDSS::molarVolume_ref
virtual double molarVolume_ref() const
Return the molar volume at reference pressure.
Definition PDSS.cpp:98
Cantera::PDSS::m_maxTemp
double m_maxTemp
Maximum temperature.
Definition PDSS.h:461
Cantera::PDSS::m_minTemp
double m_minTemp
Minimum temperature.
Definition PDSS.h:458
Cantera::PDSS::thermalExpansionCoeff
virtual double thermalExpansionCoeff() const
Return the volumetric thermal expansion coefficient. Units: 1/K.
Definition PDSS.cpp:132
Cantera::PDSS::enthalpy_RT
virtual double enthalpy_RT() const
Return the standard state molar enthalpy divided by RT.
Definition PDSS.cpp:23
Cantera::PDSS::critDensity
virtual double critDensity() const
critical density
Definition PDSS.cpp:147
Cantera::PDSS::enthalpy_RT_ref
virtual double enthalpy_RT_ref() const
Return the molar enthalpy divided by RT at reference pressure.
Definition PDSS.cpp:83
Cantera::PDSS::entropy_R
virtual double entropy_R() const
Return the standard state entropy divided by RT.
Definition PDSS.cpp:38
Cantera::PDSS::critTemperature
virtual double critTemperature() const
critical temperature
Definition PDSS.cpp:137
Cantera::PDSS::m_mw
double m_mw
Molecular Weight of the species.
Definition PDSS.h:464
Cantera::PDSS::cp_R
virtual double cp_R() const
Return the molar const pressure heat capacity divided by RT.
Definition PDSS.cpp:58
Cantera::PDSS::molarVolume
virtual double molarVolume() const
Return the molar volume at standard state.
Definition PDSS.cpp:63
Cantera::PDSS::intEnergy_mole
virtual double intEnergy_mole() const
Return the molar internal Energy in units of J kmol-1.
Definition PDSS.cpp:28
Cantera::PDSS::critPressure
virtual double critPressure() const
critical pressure
Definition PDSS.cpp:142
Cantera::PDSS::cpDelp_mole
virtual double cpDelp_mole() const
Get the difference in standard state heat capacity between the current pressure and the reference pre...
Definition PDSS.cpp:121
Cantera::PDSS::setPressure
virtual void setPressure(double pres)
Sets the pressure in the object.
Definition PDSS.cpp:152
Cantera::PDSS::gibbs_RT_ref
virtual double gibbs_RT_ref() const
Return the molar Gibbs free energy divided by RT at reference pressure.
Definition PDSS.cpp:78
Cantera::PDSS::setState_TP
virtual void setState_TP(double temp, double pres)
Set the internal temperature and pressure.
Definition PDSS.cpp:176
global.h
This file contains definitions for utility functions and text for modules, inputfiles and logging,...
Cantera::GasConstant
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition ct_defs.h:120
Cantera
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564
Cantera::npos
const size_t npos
index returned by functions to indicate "no position"
Definition ct_defs.h:195
Cantera::warn_deprecated
void warn_deprecated(const string &source, const AnyBase &node, const string &message)
A deprecation warning for syntax in an input file.
Definition AnyMap.cpp:1926