Cantera 2.6.0

PureFluidPhase.cpp
Go to the documentation of this file.
1/**
2 * @file PureFluidPhase.cpp Definitions for a ThermoPhase object for a pure
3 * fluid phase consisting of gas, liquid, mixed-gas-liquid and supercritical
4 * fluid (see \ref thermoprops and class \link Cantera::PureFluidPhase
5 * PureFluidPhase\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/xml.h"
12#include "cantera/thermo/PureFluidPhase.h"
13
14#include "cantera/tpx/Sub.h"
15#include "cantera/tpx/utils.h"
16#include "cantera/base/stringUtils.h"
17#include "cantera/base/global.h"
18
19 using std::string;
20
21 namespace Cantera
22{
23
24 PureFluidPhase::PureFluidPhase() :
25 m_subflag(-1),
26 m_mw(-1.0),
27 m_verbose(false)
28{
29}
30
31 void PureFluidPhase::initThermo()
32{
33 if (m_input.hasKey("pure-fluid-name")) {
34 setSubstance(m_input["pure-fluid-name"].asString());
35 }
36
37 if (m_tpx_name != "") {
38 m_sub.reset(tpx::newSubstance(m_tpx_name));
39 } else {
40 m_sub.reset(tpx::GetSub(m_subflag));
41 }
42
43 m_mw = m_sub->MolWt();
44 setMolecularWeight(0,m_mw);
45
46 double cp0_R, h0_RT, s0_R, p;
47 double T0 = 298.15;
48 if (T0 < m_sub->Tcrit()) {
49 m_sub->Set(tpx::PropertyPair::TX, T0, 1.0);
50 p = 0.01*m_sub->P();
51 } else {
52 p = 0.001*m_sub->Pcrit();
53 }
54 p = 0.001 * p;
55 m_sub->Set(tpx::PropertyPair::TP, T0, p);
56
57 m_spthermo.update_single(0, T0, &cp0_R, &h0_RT, &s0_R);
58 double s_R = s0_R - log(p/refPressure());
59 m_sub->setStdState(h0_RT*GasConstant*298.15/m_mw,
60 s_R*GasConstant/m_mw, T0, p);
61 debuglog("PureFluidPhase::initThermo: initialized phase "
62 +name()+"\n", m_verbose);
63}
64
65 void PureFluidPhase::getParameters(AnyMap& phaseNode) const
66{
67 ThermoPhase::getParameters(phaseNode);
68 phaseNode["pure-fluid-name"] = m_sub->name();
69}
70
71 void PureFluidPhase::setParametersFromXML(const XML_Node& eosdata)
72{
73 eosdata._require("model","PureFluid");
74 m_subflag = atoi(eosdata["fluid_type"].c_str());
75 if (m_subflag < 0) {
76 throw CanteraError("PureFluidPhase::setParametersFromXML",
77 "missing or negative substance flag");
78 }
79}
80
81std::vector<std::string> PureFluidPhase::fullStates() const
82{
83 return {"TD", "UV", "DP", "HP", "SP", "SV",
84 "ST", "TV", "PV", "UP", "VH", "TH", "SH", "TPQ"};
85}
86
87std::vector<std::string> PureFluidPhase::partialStates() const
88{
89 return {"TP", "TQ", "PQ"};
90}
91
92std::string PureFluidPhase::phaseOfMatter() const
93{
94 if (temperature() >= critTemperature() || pressure() >= critPressure()) {
95 return "supercritical";
96 } else if (m_sub->TwoPhase() == 1) {
97 return "liquid-gas-mix";
98 } else if (pressure() < m_sub->Ps()) {
99 return "gas";
100 } else {
101 return "liquid";
102 }
103}
104
105 double PureFluidPhase::minTemp(size_t k) const
106{
107 return m_sub->Tmin();
108}
109
110 double PureFluidPhase::maxTemp(size_t k) const
111{
112 return m_sub->Tmax();
113}
114
115doublereal PureFluidPhase::enthalpy_mole() const
116{
117 return m_sub->h() * m_mw;
118}
119
120doublereal PureFluidPhase::intEnergy_mole() const
121{
122 return m_sub->u() * m_mw;
123}
124
125doublereal PureFluidPhase::entropy_mole() const
126{
127 return m_sub->s() * m_mw;
128}
129
130doublereal PureFluidPhase::gibbs_mole() const
131{
132 return m_sub->g() * m_mw;
133}
134
135doublereal PureFluidPhase::cp_mole() const
136{
137 return m_sub->cp() * m_mw;
138}
139
140doublereal PureFluidPhase::cv_mole() const
141{
142 return m_sub->cv() * m_mw;
143}
144
145doublereal PureFluidPhase::pressure() const
146{
147 return m_sub->P();
148}
149
150 void PureFluidPhase::setPressure(doublereal p)
151{
152 Set(tpx::PropertyPair::TP, temperature(), p);
153 ThermoPhase::setDensity(1.0/m_sub->v());
154}
155
156 void PureFluidPhase::setTemperature(double T)
157{
158 ThermoPhase::setTemperature(T);
159 Set(tpx::PropertyPair::TV, T, m_sub->v());
160}
161
162 void PureFluidPhase::setDensity(double rho)
163{
164 ThermoPhase::setDensity(rho);
165 Set(tpx::PropertyPair::TV, m_sub->Temp(), 1.0/rho);
166}
167
168 void PureFluidPhase::Set(tpx::PropertyPair::type n, double x, double y) const
169{
170 m_sub->Set(n, x, y);
171}
172
173doublereal PureFluidPhase::isothermalCompressibility() const
174{
175 return m_sub->isothermalCompressibility();
176}
177
178doublereal PureFluidPhase::thermalExpansionCoeff() const
179{
180 return m_sub->thermalExpansionCoeff();
181}
182
183 tpx::Substance& PureFluidPhase::TPX_Substance()
184{
185 return *m_sub;
186}
187
188 void PureFluidPhase::getPartialMolarEnthalpies(doublereal* hbar) const
189{
190 hbar[0] = enthalpy_mole();
191}
192
193 void PureFluidPhase::getPartialMolarEntropies(doublereal* sbar) const
194{
195 sbar[0] = entropy_mole();
196}
197
198 void PureFluidPhase::getPartialMolarIntEnergies(doublereal* ubar) const
199{
200 ubar[0] = intEnergy_mole();
201}
202
203 void PureFluidPhase::getPartialMolarCp(doublereal* cpbar) const
204{
205 cpbar[0] = cp_mole();
206}
207
208 void PureFluidPhase::getPartialMolarVolumes(doublereal* vbar) const
209{
210 vbar[0] = 1.0 / molarDensity();
211}
212
213 Units PureFluidPhase::standardConcentrationUnits() const
214{
215 return Units(1.0);
216}
217
218 void PureFluidPhase::getActivityConcentrations(doublereal* c) const
219{
220 c[0] = 1.0;
221}
222
223doublereal PureFluidPhase::standardConcentration(size_t k) const
224{
225 return 1.0;
226}
227
228 void PureFluidPhase::getActivities(doublereal* a) const
229{
230 a[0] = 1.0;
231}
232
233 void PureFluidPhase::getStandardChemPotentials(doublereal* mu) const
234{
235 mu[0] = gibbs_mole();
236}
237
238 void PureFluidPhase::getEnthalpy_RT(doublereal* hrt) const
239{
240 hrt[0] = enthalpy_mole() / RT();
241}
242
243 void PureFluidPhase::getEntropy_R(doublereal* sr) const
244{
245 sr[0] = entropy_mole() / GasConstant;
246}
247
248 void PureFluidPhase::getGibbs_RT(doublereal* grt) const
249{
250 grt[0] = gibbs_mole() / RT();
251}
252
253 void PureFluidPhase::getEnthalpy_RT_ref(doublereal* hrt) const
254{
255 double psave = pressure();
256 double t = temperature();
257 double plow = 1.0E-8;
258 Set(tpx::PropertyPair::TP, t, plow);
259 getEnthalpy_RT(hrt);
260 Set(tpx::PropertyPair::TP, t, psave);
261
262}
263
264 void PureFluidPhase::getGibbs_RT_ref(doublereal* grt) const
265{
266 double psave = pressure();
267 double t = temperature();
268 double pref = refPressure();
269 double plow = 1.0E-8;
270 Set(tpx::PropertyPair::TP, t, plow);
271 getGibbs_RT(grt);
272 grt[0] += log(pref/plow);
273 Set(tpx::PropertyPair::TP, t, psave);
274}
275
276 void PureFluidPhase::getGibbs_ref(doublereal* g) const
277{
278 getGibbs_RT_ref(g);
279 g[0] *= RT();
280}
281
282 void PureFluidPhase::getEntropy_R_ref(doublereal* er) const
283{
284 double psave = pressure();
285 double t = temperature();
286 double pref = refPressure();
287 double plow = 1.0E-8;
288 Set(tpx::PropertyPair::TP, t, plow);
289 getEntropy_R(er);
290 er[0] -= log(pref/plow);
291 Set(tpx::PropertyPair::TP, t, psave);
292}
293
294doublereal PureFluidPhase::critTemperature() const
295{
296 return m_sub->Tcrit();
297}
298
299doublereal PureFluidPhase::critPressure() const
300{
301 return m_sub->Pcrit();
302}
303
304doublereal PureFluidPhase::critDensity() const
305{
306 return 1.0/m_sub->Vcrit();
307}
308
309doublereal PureFluidPhase::satTemperature(doublereal p) const
310{
311 return m_sub->Tsat(p);
312}
313
314/* The next several functions set the state. They run the Substance::Set
315 * function, followed by setting the state of the ThermoPhase object
316 * to the newly computed temperature and density of the Substance.
317 */
318
319 void PureFluidPhase::setState_HP(double h, double p, double tol)
320{
321 Set(tpx::PropertyPair::HP, h, p);
322 setState_TR(m_sub->Temp(), 1.0/m_sub->v());
323}
324
325 void PureFluidPhase::setState_UV(double u, double v, double tol)
326{
327 Set(tpx::PropertyPair::UV, u, v);
328 setState_TR(m_sub->Temp(), 1.0/m_sub->v());
329}
330
331 void PureFluidPhase::setState_SV(double s, double v, double tol)
332{
333 Set(tpx::PropertyPair::SV, s, v);
334 setState_TR(m_sub->Temp(), 1.0/m_sub->v());
335}
336
337 void PureFluidPhase::setState_SP(double s, double p, double tol)
338{
339 Set(tpx::PropertyPair::SP, s, p);
340 setState_TR(m_sub->Temp(), 1.0/m_sub->v());
341}
342
343 void PureFluidPhase::setState_ST(double s, double t, double tol)
344{
345 Set(tpx::PropertyPair::ST, s, t);
346 setState_TR(m_sub->Temp(), 1.0/m_sub->v());
347}
348
349 void PureFluidPhase::setState_TV(double t, double v, double tol)
350{
351 Set(tpx::PropertyPair::TV, t, v);
352 setState_TR(m_sub->Temp(), 1.0/m_sub->v());
353}
354
355 void PureFluidPhase::setState_PV(double p, double v, double tol)
356{
357 Set(tpx::PropertyPair::PV, p, v);
358 setState_TR(m_sub->Temp(), 1.0/m_sub->v());
359}
360
361 void PureFluidPhase::setState_UP(double u, double p, double tol)
362{
363 Set(tpx::PropertyPair::UP, u, p);
364 setState_TR(m_sub->Temp(), 1.0/m_sub->v());
365}
366
367 void PureFluidPhase::setState_VH(double v, double h, double tol)
368{
369 Set(tpx::PropertyPair::VH, v, h);
370 setState_TR(m_sub->Temp(), 1.0/m_sub->v());
371}
372
373 void PureFluidPhase::setState_TH(double t, double h, double tol)
374{
375 Set(tpx::PropertyPair::TH, t, h);
376 setState_TR(m_sub->Temp(), 1.0/m_sub->v());
377}
378
379 void PureFluidPhase::setState_SH(double s, double h, double tol)
380{
381 Set(tpx::PropertyPair::SH, s, h);
382 setState_TR(m_sub->Temp(), 1.0/m_sub->v());
383}
384
385doublereal PureFluidPhase::satPressure(doublereal t)
386{
387 Set(tpx::PropertyPair::TV, t, m_sub->v());
388 return m_sub->Ps();
389}
390
391doublereal PureFluidPhase::vaporFraction() const
392{
393 return m_sub->x();
394}
395
396 void PureFluidPhase::setState_Tsat(doublereal t, doublereal x)
397{
398 Set(tpx::PropertyPair::TX, t, x);
399 ThermoPhase::setTemperature(t);
400 ThermoPhase::setDensity(1.0/m_sub->v());
401}
402
403 void PureFluidPhase::setState_Psat(doublereal p, doublereal x)
404{
405 Set(tpx::PropertyPair::PX, p, x);
406 ThermoPhase::setTemperature(m_sub->Temp());
407 ThermoPhase::setDensity(1.0/m_sub->v());
408}
409
410std::string PureFluidPhase::report(bool show_thermo, doublereal threshold) const
411{
412 fmt::memory_buffer b;
413 // This is the width of the first column of names in the report.
414 int name_width = 18;
415
416 string blank_leader = fmt::format("{:{}}", "", name_width);
417
418 string one_property = fmt::format("{{:>{}}} {{:<.5g}} {{}}\n", name_width);
419
420 string two_prop_header = "{} {:^15} {:^15}\n";
421 string kg_kmol_header = fmt::format(
422 two_prop_header, blank_leader, "1 kg", "1 kmol"
423 );
424 string two_prop_sep = fmt::format(
425 "{} {:-^15} {:-^15}\n", blank_leader, "", ""
426 );
427 string two_property = fmt::format(
428 "{{:>{}}} {{:15.5g}} {{:15.5g}} {{}}\n", name_width
429 );
430
431 if (name() != "") {
432 fmt_append(b, "\n {}:\n", name());
433 }
434 fmt_append(b, "\n");
435 fmt_append(b, one_property, "temperature", temperature(), "K");
436 fmt_append(b, one_property, "pressure", pressure(), "Pa");
437 fmt_append(b, one_property, "density", density(), "kg/m^3");
438 fmt_append(b, one_property,
439 "mean mol. weight", meanMolecularWeight(), "kg/kmol");
440 fmt_append(b, "{:>{}} {:<.5g}\n",
441 "vapor fraction", name_width, vaporFraction());
442 fmt_append(b, "{:>{}} {}\n",
443 "phase of matter", name_width, phaseOfMatter());
444
445 if (show_thermo) {
446 fmt_append(b, "\n");
447 fmt_append(b, kg_kmol_header);
448 fmt_append(b, two_prop_sep);
449 fmt_append(b, two_property,
450 "enthalpy", enthalpy_mass(), enthalpy_mole(), "J");
451 fmt_append(b, two_property,
452 "internal energy", intEnergy_mass(), intEnergy_mole(), "J");
453 fmt_append(b, two_property,
454 "entropy", entropy_mass(), entropy_mole(), "J/K");
455 fmt_append(b, two_property,
456 "Gibbs function", gibbs_mass(), gibbs_mole(), "J");
457 fmt_append(b, two_property,
458 "heat capacity c_p", cp_mass(), cp_mole(), "J/K");
459 fmt_append(b, two_property,
460 "heat capacity c_v", cv_mass(), cv_mole(), "J/K");
461 }
462
463 return to_string(b);
464}
465
466}
PureFluidPhase.h
Header for a ThermoPhase class for a pure fluid phase consisting of gas, liquid, mixed-gas-liquid and...
Sub.h
Cantera::AnyMap
A map of string keys to values whose type can vary at runtime.
Definition: AnyMap.h:399
Cantera::AnyMap::hasKey
bool hasKey(const std::string &key) const
Returns true if the map contains an item named key.
Definition: AnyMap.cpp:1406
Cantera::CanteraError
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:61
Cantera::MultiSpeciesThermo::update_single
virtual void update_single(size_t k, double T, double *cp_R, double *h_RT, double *s_R) const
Get reference-state properties for a single species.
Definition: MultiSpeciesThermo.cpp:81
Cantera::Phase::molarDensity
double molarDensity() const
Molar density (kmol/m^3).
Definition: Phase.cpp:671
Cantera::Phase::name
std::string name() const
Return the name of the phase.
Definition: Phase.cpp:70
Cantera::Phase::setDensity
virtual void setDensity(const double density_)
Set the internally stored density (kg/m^3) of the phase.
Definition: Phase.cpp:687
Cantera::Phase::meanMolecularWeight
doublereal meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
Definition: Phase.h:751
Cantera::Phase::setState_TR
void setState_TR(doublereal t, doublereal rho)
Set the internally stored temperature (K) and density (kg/m^3)
Definition: Phase.cpp:462
Cantera::Phase::density
virtual double density() const
Density (kg/m^3).
Definition: Phase.h:679
Cantera::Phase::temperature
doublereal temperature() const
Temperature (K).
Definition: Phase.h:654
Cantera::Phase::setTemperature
virtual void setTemperature(double temp)
Set the internally stored temperature of the phase (K).
Definition: Phase.h:719
Cantera::Phase::setMolecularWeight
void setMolecularWeight(const int k, const double mw)
Set the molecular weight of a single species to a given value.
Definition: Phase.cpp:989
Cantera::PureFluidPhase::setState_PV
virtual void setState_PV(double p, double v, double tol=1e-9)
Set the pressure (Pa) and specific volume (m^3/kg).
Definition: PureFluidPhase.cpp:355
Cantera::PureFluidPhase::Set
void Set(tpx::PropertyPair::type n, double x, double y) const
Main call to the tpx level to set the state of the system.
Definition: PureFluidPhase.cpp:168
Cantera::PureFluidPhase::setState_HP
virtual void setState_HP(double h, double p, double tol=1e-9)
Set the internally stored specific enthalpy (J/kg) and pressure (Pa) of the phase.
Definition: PureFluidPhase.cpp:319
Cantera::PureFluidPhase::setState_UV
virtual void setState_UV(double u, double v, double tol=1e-9)
Set the specific internal energy (J/kg) and specific volume (m^3/kg).
Definition: PureFluidPhase.cpp:325
Cantera::PureFluidPhase::setState_VH
virtual void setState_VH(double v, double h, double tol=1e-9)
Set the specific volume (m^3/kg) and the specific enthalpy (J/kg)
Definition: PureFluidPhase.cpp:367
Cantera::PureFluidPhase::getGibbs_RT_ref
virtual void getGibbs_RT_ref(doublereal *grt) const
Returns the vector of nondimensional Gibbs Free Energies of the reference state at the current temper...
Definition: PureFluidPhase.cpp:264
Cantera::PureFluidPhase::m_tpx_name
std::string m_tpx_name
Name for this substance used by the TPX package.
Definition: PureFluidPhase.h:223
Cantera::PureFluidPhase::getParameters
virtual void getParameters(AnyMap &phaseNode) const
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
Definition: PureFluidPhase.cpp:65
Cantera::PureFluidPhase::getActivities
virtual void getActivities(doublereal *a) const
Get the array of non-dimensional activities at the current solution temperature, pressure,...
Definition: PureFluidPhase.cpp:228
Cantera::PureFluidPhase::report
virtual std::string report(bool show_thermo=true, doublereal threshold=1e-14) const
returns a summary of the state of the phase as a string
Definition: PureFluidPhase.cpp:410
Cantera::PureFluidPhase::getGibbs_RT
virtual void getGibbs_RT(doublereal *grt) const
Get the nondimensional Gibbs functions for the species in their standard states at the current T and ...
Definition: PureFluidPhase.cpp:248
Cantera::PureFluidPhase::pressure
virtual doublereal pressure() const
Return the thermodynamic pressure (Pa).
Definition: PureFluidPhase.cpp:145
Cantera::PureFluidPhase::getPartialMolarIntEnergies
virtual void getPartialMolarIntEnergies(doublereal *ubar) const
Return an array of partial molar internal energies for the species in the mixture.
Definition: PureFluidPhase.cpp:198
Cantera::PureFluidPhase::setState_UP
virtual void setState_UP(double u, double p, double tol=1e-9)
Set the specific internal energy (J/kg) and pressure (Pa).
Definition: PureFluidPhase.cpp:361
Cantera::PureFluidPhase::cp_mole
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
Definition: PureFluidPhase.cpp:135
Cantera::PureFluidPhase::getPartialMolarEnthalpies
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
Definition: PureFluidPhase.cpp:188
Cantera::PureFluidPhase::getPartialMolarEntropies
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
Definition: PureFluidPhase.cpp:193
Cantera::PureFluidPhase::critPressure
virtual doublereal critPressure() const
Critical pressure (Pa).
Definition: PureFluidPhase.cpp:299
Cantera::PureFluidPhase::enthalpy_mole
virtual doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
Definition: PureFluidPhase.cpp:115
Cantera::PureFluidPhase::getPartialMolarVolumes
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
Definition: PureFluidPhase.cpp:208
Cantera::PureFluidPhase::cv_mole
virtual doublereal cv_mole() const
Molar heat capacity at constant volume. Units: J/kmol/K.
Definition: PureFluidPhase.cpp:140
Cantera::PureFluidPhase::getActivityConcentrations
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
Definition: PureFluidPhase.cpp:218
Cantera::PureFluidPhase::vaporFraction
virtual doublereal vaporFraction() const
Return the fraction of vapor at the current conditions.
Definition: PureFluidPhase.cpp:391
Cantera::PureFluidPhase::setState_SH
virtual void setState_SH(double s, double h, double tol=1e-9)
Set the specific entropy (J/kg/K) and the specific enthalpy (J/kg)
Definition: PureFluidPhase.cpp:379
Cantera::PureFluidPhase::thermalExpansionCoeff
virtual doublereal thermalExpansionCoeff() const
Return the volumetric thermal expansion coefficient. Units: 1/K.
Definition: PureFluidPhase.cpp:178
Cantera::PureFluidPhase::getPartialMolarCp
virtual void getPartialMolarCp(doublereal *cpbar) const
Return an array of partial molar heat capacities for the species in the mixture.
Definition: PureFluidPhase.cpp:203
Cantera::PureFluidPhase::PureFluidPhase
PureFluidPhase()
Empty Base Constructor.
Definition: PureFluidPhase.cpp:24
Cantera::PureFluidPhase::satTemperature
virtual doublereal satTemperature(doublereal p) const
Return the saturation temperature given the pressure.
Definition: PureFluidPhase.cpp:309
Cantera::PureFluidPhase::getEntropy_R
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
Definition: PureFluidPhase.cpp:243
Cantera::PureFluidPhase::partialStates
virtual std::vector< std::string > partialStates() const
Return a vector of settable partial property sets within a phase.
Definition: PureFluidPhase.cpp:87
Cantera::PureFluidPhase::setPressure
virtual void setPressure(doublereal p)
sets the thermodynamic pressure (Pa).
Definition: PureFluidPhase.cpp:150
Cantera::PureFluidPhase::entropy_mole
virtual doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
Definition: PureFluidPhase.cpp:125
Cantera::PureFluidPhase::initThermo
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
Definition: PureFluidPhase.cpp:31
Cantera::PureFluidPhase::critTemperature
virtual doublereal critTemperature() const
Critical temperature (K).
Definition: PureFluidPhase.cpp:294
Cantera::PureFluidPhase::minTemp
virtual double minTemp(size_t k=npos) const
Minimum temperature for which the thermodynamic data for the species or phase are valid.
Definition: PureFluidPhase.cpp:105
Cantera::PureFluidPhase::setState_SP
virtual void setState_SP(double s, double p, double tol=1e-9)
Set the specific entropy (J/kg/K) and pressure (Pa).
Definition: PureFluidPhase.cpp:337
Cantera::PureFluidPhase::getEntropy_R_ref
virtual void getEntropy_R_ref(doublereal *er) const
Returns the vector of nondimensional entropies of the reference state at the current temperature of t...
Definition: PureFluidPhase.cpp:282
Cantera::PureFluidPhase::setState_Tsat
virtual void setState_Tsat(doublereal t, doublereal x)
Set the state to a saturated system at a particular temperature.
Definition: PureFluidPhase.cpp:396
Cantera::PureFluidPhase::gibbs_mole
virtual doublereal gibbs_mole() const
Molar Gibbs function. Units: J/kmol.
Definition: PureFluidPhase.cpp:130
Cantera::PureFluidPhase::standardConcentrationUnits
virtual Units standardConcentrationUnits() const
Returns the units of the "standard concentration" for this phase.
Definition: PureFluidPhase.cpp:213
Cantera::PureFluidPhase::setParametersFromXML
virtual void setParametersFromXML(const XML_Node &eosdata)
Set equation of state parameter values from XML entries.
Definition: PureFluidPhase.cpp:71
Cantera::PureFluidPhase::m_mw
doublereal m_mw
Molecular weight of the substance (kg kmol-1)
Definition: PureFluidPhase.h:226
Cantera::PureFluidPhase::setDensity
virtual void setDensity(const double rho)
Set the internally stored density (kg/m^3) of the phase.
Definition: PureFluidPhase.cpp:162
Cantera::PureFluidPhase::m_sub
std::unique_ptr< tpx::Substance > m_sub
Pointer to the underlying tpx object Substance that does the work.
Definition: PureFluidPhase.h:212
Cantera::PureFluidPhase::setSubstance
void setSubstance(const std::string &name)
Set the name of the TPX substance to use for the equation of state.
Definition: PureFluidPhase.h:59
Cantera::PureFluidPhase::getStandardChemPotentials
virtual void getStandardChemPotentials(doublereal *mu) const
Definition: PureFluidPhase.cpp:233
Cantera::PureFluidPhase::setState_Psat
virtual void setState_Psat(doublereal p, doublereal x)
Set the state to a saturated system at a particular pressure.
Definition: PureFluidPhase.cpp:403
Cantera::PureFluidPhase::maxTemp
virtual double maxTemp(size_t k=npos) const
Maximum temperature for which the thermodynamic data for the species are valid.
Definition: PureFluidPhase.cpp:110
Cantera::PureFluidPhase::satPressure
virtual doublereal satPressure(doublereal t)
Return the saturation pressure given the temperature.
Definition: PureFluidPhase.cpp:385
Cantera::PureFluidPhase::fullStates
virtual std::vector< std::string > fullStates() const
Return a vector containing full states defining a phase.
Definition: PureFluidPhase.cpp:81
Cantera::PureFluidPhase::setTemperature
virtual void setTemperature(const double T)
Set the internally stored temperature of the phase (K).
Definition: PureFluidPhase.cpp:156
Cantera::PureFluidPhase::TPX_Substance
tpx::Substance & TPX_Substance()
Returns a reference to the substance object.
Definition: PureFluidPhase.cpp:183
Cantera::PureFluidPhase::getGibbs_ref
virtual void getGibbs_ref(doublereal *g) const
Returns the vector of the Gibbs function of the reference state at the current temperature of the sol...
Definition: PureFluidPhase.cpp:276
Cantera::PureFluidPhase::getEnthalpy_RT
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
Definition: PureFluidPhase.cpp:238
Cantera::PureFluidPhase::critDensity
virtual doublereal critDensity() const
Critical density (kg/m3).
Definition: PureFluidPhase.cpp:304
Cantera::PureFluidPhase::phaseOfMatter
virtual std::string phaseOfMatter() const
String indicating the mechanical phase of the matter in this Phase.
Definition: PureFluidPhase.cpp:92
Cantera::PureFluidPhase::m_subflag
int m_subflag
Int indicating the type of the fluid.
Definition: PureFluidPhase.h:219
Cantera::PureFluidPhase::setState_TV
virtual void setState_TV(double t, double v, double tol=1e-9)
Set the temperature (K) and specific volume (m^3/kg).
Definition: PureFluidPhase.cpp:349
Cantera::PureFluidPhase::setState_SV
virtual void setState_SV(double s, double v, double tol=1e-9)
Set the specific entropy (J/kg/K) and specific volume (m^3/kg).
Definition: PureFluidPhase.cpp:331
Cantera::PureFluidPhase::intEnergy_mole
virtual doublereal intEnergy_mole() const
Molar internal energy. Units: J/kmol.
Definition: PureFluidPhase.cpp:120
Cantera::PureFluidPhase::m_verbose
bool m_verbose
flag to turn on some printing.
Definition: PureFluidPhase.h:229
Cantera::PureFluidPhase::getEnthalpy_RT_ref
virtual void getEnthalpy_RT_ref(doublereal *hrt) const
Definition: PureFluidPhase.cpp:253
Cantera::PureFluidPhase::setState_ST
virtual void setState_ST(double s, double t, double tol=1e-9)
Set the specific entropy (J/kg/K) and temperature (K).
Definition: PureFluidPhase.cpp:343
Cantera::PureFluidPhase::isothermalCompressibility
virtual doublereal isothermalCompressibility() const
Returns the isothermal compressibility. Units: 1/Pa.
Definition: PureFluidPhase.cpp:173
Cantera::PureFluidPhase::setState_TH
virtual void setState_TH(double t, double h, double tol=1e-9)
Set the temperature (K) and the specific enthalpy (J/kg)
Definition: PureFluidPhase.cpp:373
Cantera::PureFluidPhase::standardConcentration
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
Definition: PureFluidPhase.cpp:223
Cantera::ThermoPhase::entropy_mass
doublereal entropy_mass() const
Specific entropy. Units: J/kg/K.
Definition: ThermoPhase.h:758
Cantera::ThermoPhase::RT
doublereal RT() const
Return the Gas Constant multiplied by the current temperature.
Definition: ThermoPhase.h:782
Cantera::ThermoPhase::gibbs_mass
doublereal gibbs_mass() const
Specific Gibbs function. Units: J/kg.
Definition: ThermoPhase.h:763
Cantera::ThermoPhase::cp_mass
doublereal cp_mass() const
Specific heat at constant pressure. Units: J/kg/K.
Definition: ThermoPhase.h:768
Cantera::ThermoPhase::refPressure
virtual doublereal refPressure() const
Returns the reference pressure in Pa.
Definition: ThermoPhase.h:150
Cantera::ThermoPhase::cv_mass
doublereal cv_mass() const
Specific heat at constant volume. Units: J/kg/K.
Definition: ThermoPhase.h:773
Cantera::ThermoPhase::intEnergy_mass
doublereal intEnergy_mass() const
Specific internal energy. Units: J/kg.
Definition: ThermoPhase.h:753
Cantera::ThermoPhase::m_spthermo
MultiSpeciesThermo m_spthermo
Pointer to the calculation manager for species reference-state thermodynamic properties.
Definition: ThermoPhase.h:1894
Cantera::ThermoPhase::enthalpy_mass
doublereal enthalpy_mass() const
Specific enthalpy. Units: J/kg.
Definition: ThermoPhase.h:748
Cantera::ThermoPhase::m_input
AnyMap m_input
Data supplied via setParameters.
Definition: ThermoPhase.h:1898
Cantera::ThermoPhase::getParameters
virtual void getParameters(int &n, doublereal *const c) const
Get the equation of state parameters in a vector.
Definition: ThermoPhase.cpp:1193
Cantera::Units
A representation of the units associated with a dimensional quantity.
Definition: Units.h:30
Cantera::XML_Node
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:103
Cantera::XML_Node::_require
void _require(const std::string &a, const std::string &v) const
Require that the current XML node has an attribute named by the first argument, a,...
Definition: xml.cpp:577
tpx::Substance
Definition: Sub.h:38
global.h
This file contains definitions for utility functions and text for modules, inputfiles,...
Cantera
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:557
Cantera::GasConstant
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition: ct_defs.h:113
Cantera::debuglog
void debuglog(const std::string &msg, int loglevel)
Write a message to the log only if loglevel > 0.
Definition: global.h:146
stringUtils.h
Contains declarations for string manipulation functions within Cantera.
utils.h
xml.h
Classes providing support for XML data files.