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