| Cantera 3.0.0

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