Cantera  3.1.0a1
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 
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::pressure() const
104 {
105  return m_pres;
106 }
107 
109 {
110  throw NotImplementedError("PDSS::thermalExpansionCoeff");
111 }
112 
113 double PDSS::critTemperature() const
114 {
115  throw NotImplementedError("PDSS::critTemperature");
116 }
117 
118 double PDSS::critPressure() const
119 {
120  throw NotImplementedError("PDSS::critPressure");
121 }
122 
123 double PDSS::critDensity() const
124 {
125  throw NotImplementedError("PDSS::critDensity");
126 }
127 
128 void PDSS::setPressure(double pres)
129 {
130  m_pres = pres;
131 }
132 
133 double PDSS::temperature() const
134 {
135  return m_temp;
136 }
137 
138 void PDSS::setTemperature(double temp)
139 {
140  m_temp = temp;
141 }
142 
143 double PDSS::molecularWeight() const
144 {
145  return m_mw;
146 }
148 {
149  m_mw = mw;
150 }
151 
152 void PDSS::setState_TP(double temp, double pres)
153 {
154  throw NotImplementedError("PDSS::setState_TP");
155 }
156 
157 double PDSS::satPressure(double t)
158 {
159  throw NotImplementedError("PDSS::satPressure");
160 }
161 
162 // PDSS_Molar methods
163 
165 {
166  return enthalpy_mole() / (GasConstant * temperature());
167 }
168 
169 double PDSS_Molar::entropy_R() const
170 {
171  return entropy_mole() / GasConstant;
172 }
173 
174 double PDSS_Molar::gibbs_RT() const
175 {
176  return gibbs_mole() / (GasConstant * temperature());
177 }
178 
179 double PDSS_Molar::cp_R() const
180 {
181  return cp_mole() / GasConstant;
182 }
183 
184 // PDSS_Nondimensional methods
185 
186 PDSS_Nondimensional::PDSS_Nondimensional()
187  : m_h0_RT(0.0)
188  , m_cp0_R(0.0)
189  , m_s0_R(0.0)
190  , m_g0_RT(0.0)
191  , m_V0(0.0)
192  , m_hss_RT(0.0)
193  , m_cpss_R(0.0)
194  , m_sss_R(0.0)
195  , m_gss_RT(0.0)
196  , m_Vss(0.0)
197 {
198 }
199 
201 {
202  return enthalpy_RT() * GasConstant * temperature();
203 }
204 
206 {
207  return entropy_R() * GasConstant;
208 }
209 
211 {
212  return gibbs_RT() * GasConstant * temperature();
213 }
214 
216 {
217  return cp_R() * GasConstant;
218 }
219 
221 {
222  return m_g0_RT;
223 }
224 
226 {
227  return m_h0_RT;
228 }
229 
231 {
232  return m_s0_R;
233 }
234 
236 {
237  return m_cp0_R;
238 }
239 
241 {
242  return m_V0;
243 }
244 
246 {
247  return m_hss_RT;
248 }
249 
251 {
252  return m_sss_R;
253 }
254 
256 {
257  return m_gss_RT;
258 }
259 
261 {
262  return m_cpss_R;
263 }
264 
266 {
267  return m_Vss;
268 }
269 
271 {
272  return m_mw / m_Vss;
273 }
274 
275 }
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.
Definition: ctexceptions.h:195
double cp_R() const override
Return the molar const pressure heat capacity divided by RT.
Definition: PDSS.cpp:179
double entropy_R() const override
Return the standard state entropy divided by RT.
Definition: PDSS.cpp:169
double enthalpy_RT() const override
Return the standard state molar enthalpy divided by RT.
Definition: PDSS.cpp:164
double gibbs_RT() const override
Return the molar Gibbs free energy divided by RT.
Definition: PDSS.cpp:174
double molarVolume() const override
Return the molar volume at standard state.
Definition: PDSS.cpp:265
double enthalpy_mole() const override
Return the molar enthalpy in units of J kmol-1.
Definition: PDSS.cpp:200
double m_sss_R
Standard state entropy divided by R.
Definition: PDSS.h:465
double gibbs_RT_ref() const override
Return the molar Gibbs free energy divided by RT at reference pressure.
Definition: PDSS.cpp:220
double cp_R() const override
Return the molar const pressure heat capacity divided by RT.
Definition: PDSS.cpp:260
double m_cpss_R
Standard state heat capacity divided by R.
Definition: PDSS.h:464
double entropy_R_ref() const override
Return the molar entropy divided by R at reference pressure.
Definition: PDSS.cpp:230
double enthalpy_RT_ref() const override
Return the molar enthalpy divided by RT at reference pressure.
Definition: PDSS.cpp:225
double m_h0_RT
Reference state enthalpy divided by RT.
Definition: PDSS.h:458
double m_g0_RT
Reference state Gibbs free energy divided by RT.
Definition: PDSS.h:461
double m_s0_R
Reference state entropy divided by R.
Definition: PDSS.h:460
double entropy_mole() const override
Return the molar entropy in units of J kmol-1 K-1.
Definition: PDSS.cpp:205
double m_gss_RT
Standard state Gibbs free energy divided by RT.
Definition: PDSS.h:466
double entropy_R() const override
Return the standard state entropy divided by RT.
Definition: PDSS.cpp:250
double m_cp0_R
Reference state heat capacity divided by R.
Definition: PDSS.h:459
double cp_mole() const override
Return the molar const pressure heat capacity in units of J kmol-1 K-1.
Definition: PDSS.cpp:215
double enthalpy_RT() const override
Return the standard state molar enthalpy divided by RT.
Definition: PDSS.cpp:245
double m_Vss
Standard State molar volume (m^3/kmol)
Definition: PDSS.h:467
double density() const override
Return the standard state density at standard state.
Definition: PDSS.cpp:270
double gibbs_mole() const override
Return the molar Gibbs free energy in units of J kmol-1.
Definition: PDSS.cpp:210
double m_hss_RT
Standard state enthalpy divided by RT.
Definition: PDSS.h:463
double molarVolume_ref() const override
Return the molar volume at reference pressure.
Definition: PDSS.cpp:240
double gibbs_RT() const override
Return the molar Gibbs free energy divided by RT.
Definition: PDSS.cpp:255
double m_V0
Reference state molar volume (m^3/kmol)
Definition: PDSS.h:462
double cp_R_ref() const override
Return the molar heat capacity divided by R at reference pressure.
Definition: PDSS.cpp:235
virtual double satPressure(double T)
saturation pressure
Definition: PDSS.cpp:157
double molecularWeight() const
Return the molecular weight of the species in units of kg kmol-1.
Definition: PDSS.cpp:143
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 setTemperature(double temp)
Set the internal temperature.
Definition: PDSS.cpp:138
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
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:398
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:103
void setMolecularWeight(double mw)
Set the molecular weight of the species.
Definition: PDSS.cpp:147
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:133
virtual double entropy_R_ref() const
Return the molar entropy divided by R at reference pressure.
Definition: PDSS.cpp:88
double m_pres
State of the system - pressure.
Definition: PDSS.h:401
virtual double molarVolume_ref() const
Return the molar volume at reference pressure.
Definition: PDSS.cpp:98
virtual double thermalExpansionCoeff() const
Return the volumetric thermal expansion coefficient. Units: 1/K.
Definition: PDSS.cpp:108
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:123
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:113
double m_mw
Molecular Weight of the species.
Definition: PDSS.h:413
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:118
virtual void setPressure(double pres)
Sets the pressure in the object.
Definition: PDSS.cpp:128
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:152
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