| Cantera 3.0.0

Loading...
Searching...
No Matches
MixtureFugacityTP.h
Go to the documentation of this file.
1/**
2 * @file MixtureFugacityTP.h
3 * Header file for a derived class of ThermoPhase that handles
4 * non-ideal mixtures based on the fugacity models (see @ref thermoprops and
5 * class @link Cantera::MixtureFugacityTP MixtureFugacityTP@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#ifndef CT_MIXTUREFUGACITYTP_H
12#define CT_MIXTUREFUGACITYTP_H
13
14#include "ThermoPhase.h"
15
16 namespace Cantera
17{
18//! Various states of the Fugacity object. In general there can be multiple liquid
19//! objects for a single phase identified with each species.
20
21#define FLUID_UNSTABLE -4
22#define FLUID_UNDEFINED -3
23#define FLUID_SUPERCRIT -2
24#define FLUID_GAS -1
25#define FLUID_LIQUID_0 0
26#define FLUID_LIQUID_1 1
27#define FLUID_LIQUID_2 2
28#define FLUID_LIQUID_3 3
29#define FLUID_LIQUID_4 4
30#define FLUID_LIQUID_5 5
31#define FLUID_LIQUID_6 6
32#define FLUID_LIQUID_7 7
33#define FLUID_LIQUID_8 8
34#define FLUID_LIQUID_9 9
35
36/**
37 * @ingroup thermoprops
38 *
39 * This is a filter class for ThermoPhase that implements some preparatory steps
40 * for efficiently handling mixture of gases that whose standard states are
41 * defined as ideal gases, but which describe also non-ideal solutions. In
42 * addition a multicomponent liquid phase below the critical temperature of the
43 * mixture is also allowed. The main subclass is currently a mixture Redlich-
44 * Kwong class.
45 *
46 * Several concepts are introduced. The first concept is there are temporary
47 * variables for holding the species standard state values of Cp, H, S, G, and V
48 * at the last temperature and pressure called. These functions are not
49 * recalculated if a new call is made using the previous temperature and
50 * pressure.
51 *
52 * The other concept is that the current state of the mixture is tracked. The
53 * state variable is either GAS, LIQUID, or SUPERCRIT fluid. Additionally, the
54 * variable LiquidContent is used and may vary between 0 and 1.
55 *
56 * Typically, only one liquid phase is allowed to be formed within these
57 * classes. Additionally, there is an inherent contradiction between three phase
58 * models and the ThermoPhase class. The ThermoPhase class is really only meant
59 * to represent a single instantiation of a phase. The three phase models may be
60 * in equilibrium with multiple phases of the fluid in equilibrium with each
61 * other. This has yet to be resolved.
62 *
63 * This class is usually used for non-ideal gases.
64 */
65 class MixtureFugacityTP : public ThermoPhase
66{
67 public:
68 //! @name Constructors and Duplicators for MixtureFugacityTP
69 //! @{
70
71 //! Constructor.
72 MixtureFugacityTP() = default;
73
74 //! @}
75 //! @name Utilities
76 //! @{
77
78 string type() const override {
79 return "MixtureFugacity";
80 }
81
82 int standardStateConvention() const override;
83
84 //! Set the solution branch to force the ThermoPhase to exist on one branch
85 //! or another
86 /*!
87 * @param solnBranch Branch that the solution is restricted to. the value
88 * -1 means gas. The value -2 means unrestricted. Values of zero or
89 * greater refer to species dominated condensed phases.
90 */
91 void setForcedSolutionBranch(int solnBranch);
92
93 //! Report the solution branch which the solution is restricted to
94 /*!
95 * @return Branch that the solution is restricted to. the value -1 means
96 * gas. The value -2 means unrestricted. Values of zero or greater
97 * refer to species dominated condensed phases.
98 */
99 int forcedSolutionBranch() const;
100
101 //! Report the solution branch which the solution is actually on
102 /*!
103 * @return Branch that the solution is restricted to. the value -1 means
104 * gas. The value -2 means superfluid.. Values of zero or greater refer
105 * to species dominated condensed phases.
106 */
107 int reportSolnBranchActual() const;
108
109 //! @}
110 //! @name Molar Thermodynamic properties
111 //! @{
112
113 double enthalpy_mole() const override;
114 double entropy_mole() const override;
115
116 //! @}
117 //! @name Partial Molar Properties of the Solution
118 //! @{
119
120 //! Get the array of non-dimensional species chemical potentials
121 //! These are partial molar Gibbs free energies.
122 /*!
123 * @f$ \mu_k / \hat R T @f$.
124 * Units: unitless
125 *
126 * We close the loop on this function, here, calling getChemPotentials() and
127 * then dividing by RT. No need for child classes to handle.
128 *
129 * @param mu Output vector of non-dimensional species chemical potentials
130 * Length: m_kk.
131 * @deprecated To be removed after %Cantera 3.0. Use getChemPotentials() instead.
132 */
133 void getChemPotentials_RT(double* mu) const override;
134
135 //! @}
136 //! @name Properties of the Standard State of the Species in the Solution
137 //!
138 //! Within MixtureFugacityTP, these properties are calculated via a common
139 //! routine, _updateStandardStateThermo(), which must be overloaded in
140 //! inherited objects. The values are cached within this object, and are not
141 //! recalculated unless the temperature or pressure changes.
142 //! @{
143
144 //! Get the array of chemical potentials at unit activity.
145 /*!
146 * These are the standard state chemical potentials @f$ \mu^0_k(T,P)
147 * @f$. The values are evaluated at the current temperature and pressure.
148 *
149 * For all objects with the Mixture Fugacity approximation, we define the
150 * standard state as an ideal gas at the current temperature and pressure
151 * of the solution.
152 *
153 * @param mu Output vector of standard state chemical potentials.
154 * length = m_kk. units are J / kmol.
155 */
156 void getStandardChemPotentials(double* mu) const override;
157
158 //! Get the nondimensional Enthalpy functions for the species at their
159 //! standard states at the current *T* and *P* of the solution.
160 /*!
161 * For all objects with the Mixture Fugacity approximation, we define the
162 * standard state as an ideal gas at the current temperature and pressure
163 * of the solution.
164 *
165 * @param hrt Output vector of standard state enthalpies.
166 * length = m_kk. units are unitless.
167 */
168 void getEnthalpy_RT(double* hrt) const override;
169
170 //! Get the array of nondimensional Enthalpy functions for the standard
171 //! state species at the current *T* and *P* of the solution.
172 /*!
173 * For all objects with the Mixture Fugacity approximation, we define the
174 * standard state as an ideal gas at the current temperature and pressure of
175 * the solution.
176 *
177 * @param sr Output vector of nondimensional standard state entropies.
178 * length = m_kk.
179 */
180 void getEntropy_R(double* sr) const override;
181
182 //! Get the nondimensional Gibbs functions for the species at their standard
183 //! states of solution at the current T and P of the solution.
184 /*!
185 * For all objects with the Mixture Fugacity approximation, we define the
186 * standard state as an ideal gas at the current temperature and pressure
187 * of the solution.
188 *
189 * @param grt Output vector of nondimensional standard state Gibbs free
190 * energies. length = m_kk.
191 */
192 void getGibbs_RT(double* grt) const override;
193
194 //! Get the pure Gibbs free energies of each species. Species are assumed to
195 //! be in their standard states.
196 /*!
197 * This is the same as getStandardChemPotentials().
198 *
199 * @param[out] gpure Array of standard state Gibbs free energies. length =
200 * m_kk. units are J/kmol.
201 */
202 void getPureGibbs(double* gpure) const override;
203
204 //! Returns the vector of nondimensional internal Energies of the standard
205 //! state at the current temperature and pressure of the solution for each
206 //! species.
207 /*!
208 * For all objects with the Mixture Fugacity approximation, we define the
209 * standard state as an ideal gas at the current temperature and pressure
210 * of the solution.
211 *
212 * @f[
213 * u^{ss}_k(T,P) = h^{ss}_k(T) - P * V^{ss}_k
214 * @f]
215 *
216 * @param urt Output vector of nondimensional standard state internal
217 * energies. length = m_kk.
218 */
219 void getIntEnergy_RT(double* urt) const override;
220
221 //! Get the nondimensional Heat Capacities at constant pressure for the
222 //! standard state of the species at the current T and P.
223 /*!
224 * For all objects with the Mixture Fugacity approximation, we define the
225 * standard state as an ideal gas at the current temperature and pressure of
226 * the solution.
227 *
228 * @param cpr Output vector containing the the nondimensional Heat
229 * Capacities at constant pressure for the standard state of
230 * the species. Length: m_kk.
231 */
232 void getCp_R(double* cpr) const override;
233
234 //! Get the molar volumes of each species in their standard states at the
235 //! current *T* and *P* of the solution.
236 /*!
237 * For all objects with the Mixture Fugacity approximation, we define the
238 * standard state as an ideal gas at the current temperature and pressure of
239 * the solution.
240 *
241 * units = m^3 / kmol
242 *
243 * @param vol Output vector of species volumes. length = m_kk.
244 * units = m^3 / kmol
245 */
246 void getStandardVolumes(double* vol) const override;
247 //! @}
248
249 //! Set the temperature of the phase
250 /*!
251 * Currently this passes down to setState_TP(). It does not make sense to
252 * calculate the standard state without first setting T and P.
253 *
254 * @param temp Temperature (kelvin)
255 */
256 void setTemperature(const double temp) override;
257
258 //! Set the internally stored pressure (Pa) at constant temperature and
259 //! composition
260 /*!
261 * Currently this passes down to setState_TP(). It does not make sense to
262 * calculate the standard state without first setting T and P.
263 *
264 * @param p input Pressure (Pa)
265 */
266 void setPressure(double p) override;
267
268 protected:
269 void compositionChanged() override;
270
271 //! Updates the reference state thermodynamic functions at the current T of
272 //! the solution.
273 /*!
274 * This function must be called for every call to functions in this class.
275 * It checks to see whether the temperature has changed and thus the ss
276 * thermodynamics functions for all of the species must be recalculated.
277 *
278 * This function is responsible for updating the following internal members:
279 *
280 * - m_h0_RT;
281 * - m_cp0_R;
282 * - m_g0_RT;
283 * - m_s0_R;
284 */
285 virtual void _updateReferenceStateThermo() const;
286
287 //! Temporary storage - length = m_kk.
288 mutable vector<double> m_tmpV;
289 public:
290
291 //! @name Thermodynamic Values for the Species Reference States
292 //!
293 //! There are also temporary variables for holding the species reference-
294 //! state values of Cp, H, S, and V at the last temperature and reference
295 //! pressure called. These functions are not recalculated if a new call is
296 //! made using the previous temperature. All calculations are done within the
297 //! routine _updateRefStateThermo().
298 //! @{
299
300 void getEnthalpy_RT_ref(double* hrt) const override;
301 void getGibbs_RT_ref(double* grt) const override;
302
303 protected:
304 //! Returns the vector of nondimensional Gibbs free energies of the
305 //! reference state at the current temperature of the solution and the
306 //! reference pressure for the species.
307 /*!
308 * @return Output vector contains the nondimensional Gibbs free energies
309 * of the reference state of the species
310 * length = m_kk, units = dimensionless.
311 */
312 const vector<double>& gibbs_RT_ref() const;
313
314 public:
315 void getGibbs_ref(double* g) const override;
316 void getEntropy_R_ref(double* er) const override;
317 void getCp_R_ref(double* cprt) const override;
318 void getStandardVolumes_ref(double* vol) const override;
319
320 //! @}
321 //! @name Initialization Methods - For Internal use
322 //!
323 //! The following methods are used in the process of constructing
324 //! the phase and setting its parameters from a specification in an
325 //! input file. They are not normally used in application programs.
326 //! To see how they are used, see importPhase().
327 //! @{
328 bool addSpecies(shared_ptr<Species> spec) override;
329 //! @}
330
331 protected:
332 //! @name Special Functions for fugacity classes
333 //! @{
334
335 //! Calculate the value of z
336 /*!
337 * @f[
338 * z = \frac{P v}{R T}
339 * @f]
340 *
341 * returns the value of z
342 */
343 double z() const;
344
345 //! Calculate the deviation terms for the total entropy of the mixture from
346 //! the ideal gas mixture
347 /**
348 * Here we use the current state conditions
349 *
350 * @returns the change in entropy in units of J kmol-1 K-1.
351 */
352 virtual double sresid() const;
353
354 //! Calculate the deviation terms for the total enthalpy of the mixture from
355 //! the ideal gas mixture
356 /**
357 * Here we use the current state conditions
358 *
359 * @returns the change in entropy in units of J kmol-1.
360 */
361 virtual double hresid() const;
362
363 //! Estimate for the saturation pressure
364 /*!
365 * Note: this is only used as a starting guess for later routines that
366 * actually calculate an accurate value for the saturation pressure.
367 *
368 * @param TKelvin temperature in kelvin
369 * @return the estimated saturation pressure at the given temperature
370 */
371 virtual double psatEst(double TKelvin) const;
372
373 public:
374 //! Estimate for the molar volume of the liquid
375 /*!
376 * Note: this is only used as a starting guess for later routines that
377 * actually calculate an accurate value for the liquid molar volume. This
378 * routine doesn't change the state of the system.
379 *
380 * @param TKelvin temperature in kelvin
381 * @param pres Pressure in Pa. This is used as an initial guess. If the
382 * routine needs to change the pressure to find a stable
383 * liquid state, the new pressure is returned in this
384 * variable.
385 * @returns the estimate of the liquid volume. If the liquid can't be
386 * found, this routine returns -1.
387 */
388 virtual double liquidVolEst(double TKelvin, double& pres) const;
389
390 //! Calculates the density given the temperature and the pressure and a
391 //! guess at the density.
392 /*!
393 * Note, below T_c, this is a multivalued function. We do not cross the
394 * vapor dome in this. This is protected because it is called during
395 * setState_TP() routines. Infinite loops would result if it were not
396 * protected.
397 *
398 * @param TKelvin Temperature in Kelvin
399 * @param pressure Pressure in Pascals (Newton/m**2)
400 * @param phaseRequested int representing the phase whose density we are
401 * requesting. If we put a gas or liquid phase here, we will attempt to
402 * find a volume in that part of the volume space, only, in this
403 * routine. A value of FLUID_UNDEFINED means that we will accept
404 * anything.
405 * @param rhoguess Guessed density of the fluid. A value of -1.0 indicates
406 * that there is no guessed density
407 * @return We return the density of the fluid at the requested phase. If
408 * we have not found any acceptable density we return a -1. If we
409 * have found an acceptable density at a different phase, we
410 * return a -2.
411 */
412 virtual double densityCalc(double TKelvin, double pressure, int phaseRequested,
413 double rhoguess);
414
415 protected:
416 //! Utility routine in the calculation of the saturation pressure
417 /*!
418 * @param TKelvin temperature (kelvin)
419 * @param pres pressure (Pascal)
420 * @param[out] densLiq density of liquid
421 * @param[out] densGas density of gas
422 * @param[out] liqGRT deltaG/RT of liquid
423 * @param[out] gasGRT deltaG/RT of gas
424 */
425 int corr0(double TKelvin, double pres, double& densLiq,
426 double& densGas, double& liqGRT, double& gasGRT);
427
428 public:
429 //! Returns the Phase State flag for the current state of the object
430 /*!
431 * @param checkState If true, this function does a complete check to see
432 * where in parameters space we are
433 *
434 * There are three values:
435 * - WATER_GAS below the critical temperature but below the critical density
436 * - WATER_LIQUID below the critical temperature but above the critical density
437 * - WATER_SUPERCRIT above the critical temperature
438 */
439 int phaseState(bool checkState = false) const;
440
441 //! Return the value of the density at the liquid spinodal point (on the
442 //! liquid side) for the current temperature.
443 /*!
444 * @returns the density with units of kg m-3
445 */
446 virtual double densSpinodalLiquid() const;
447
448 //! Return the value of the density at the gas spinodal point (on the gas
449 //! side) for the current temperature.
450 /*!
451 * @returns the density with units of kg m-3
452 */
453 virtual double densSpinodalGas() const;
454
455 public:
456 //! Calculate the saturation pressure at the current mixture content for the
457 //! given temperature
458 /*!
459 * @param TKelvin (input) Temperature (Kelvin)
460 * @param molarVolGas (return) Molar volume of the gas
461 * @param molarVolLiquid (return) Molar volume of the liquid
462 * @returns the saturation pressure at the given temperature
463 */
464 double calculatePsat(double TKelvin, double& molarVolGas, double& molarVolLiquid);
465
466 public:
467 //! Calculate the saturation pressure at the current mixture content for the
468 //! given temperature
469 /*!
470 * @param TKelvin Temperature (Kelvin)
471 * @return The saturation pressure at the given temperature
472 */
473 double satPressure(double TKelvin) override;
474 void getActivityConcentrations(double* c) const override;
475
476 protected:
477 //! Calculate the pressure and the pressure derivative given the temperature
478 //! and the molar volume
479 /*!
480 * Temperature and mole number are held constant
481 *
482 * @param TKelvin temperature in kelvin
483 * @param molarVol molar volume ( m3/kmol)
484 * @param presCalc Returns the pressure.
485 * @returns the derivative of the pressure wrt the molar volume
486 */
487 virtual double dpdVCalc(double TKelvin, double molarVol, double& presCalc) const;
488
489 virtual void updateMixingExpressions();
490
491 //! @}
492 //! @name Critical State Properties.
493 //! @{
494
495 double critTemperature() const override;
496 double critPressure() const override;
497 double critVolume() const override;
498 double critCompressibility() const override;
499 double critDensity() const override;
500 virtual void calcCriticalConditions(double& pc, double& tc, double& vc) const;
501
502 //! Solve the cubic equation of state
503 /*!
504 *
505 * Returns the number of solutions found. For the gas phase solution, it returns
506 * a positive number (1 or 2). If it only finds the liquid branch solution,
507 * it will return -1 or -2 instead of 1 or 2.
508 * If it returns 0, then there is an error.
509 * The cubic equation is solved using Nickalls' method @cite nickalls1993.
510 *
511 * @param T temperature (kelvin)
512 * @param pres pressure (Pa)
513 * @param a "a" parameter in the non-ideal EoS [Pa-m^6/kmol^2]
514 * @param b "b" parameter in the non-ideal EoS [m^3/kmol]
515 * @param aAlpha a*alpha (temperature dependent function for P-R EoS, 1 for R-K EoS)
516 * @param Vroot Roots of the cubic equation for molar volume (m3/kmol)
517 * @param an constant used in cubic equation
518 * @param bn constant used in cubic equation
519 * @param cn constant used in cubic equation
520 * @param dn constant used in cubic equation
521 * @param tc Critical temperature (kelvin)
522 * @param vc Critical volume
523 * @returns the number of solutions found
524 */
525 int solveCubic(double T, double pres, double a, double b,
526 double aAlpha, double Vroot[3], double an,
527 double bn, double cn, double dn, double tc, double vc) const;
528
529 //! @}
530
531 //! Storage for the current values of the mole fractions of the species
532 /*!
533 * This vector is kept up-to-date when some the setState functions are called.
534 */
535 vector<double> moleFractions_;
536
537 //! Current state of the fluid
538 /*!
539 * There are three possible states of the fluid:
540 * - FLUID_GAS
541 * - FLUID_LIQUID
542 * - FLUID_SUPERCRIT
543 */
544 int iState_ = FLUID_GAS;
545
546 //! Force the system to be on a particular side of the spinodal curve
547 int forcedState_ = FLUID_UNDEFINED;
548
549 //! Temporary storage for dimensionless reference state enthalpies
550 mutable vector<double> m_h0_RT;
551
552 //! Temporary storage for dimensionless reference state heat capacities
553 mutable vector<double> m_cp0_R;
554
555 //! Temporary storage for dimensionless reference state Gibbs energies
556 mutable vector<double> m_g0_RT;
557
558 //! Temporary storage for dimensionless reference state entropies
559 mutable vector<double> m_s0_R;
560};
561}
562
563#endif
ThermoPhase.h
Header file for class ThermoPhase, the base class for phases with thermodynamic properties,...
Cantera::MixtureFugacityTP
This is a filter class for ThermoPhase that implements some preparatory steps for efficiently handlin...
Definition MixtureFugacityTP.h:66
Cantera::MixtureFugacityTP::iState_
int iState_
Current state of the fluid.
Definition MixtureFugacityTP.h:544
Cantera::MixtureFugacityTP::reportSolnBranchActual
int reportSolnBranchActual() const
Report the solution branch which the solution is actually on.
Definition MixtureFugacityTP.cpp:36
Cantera::MixtureFugacityTP::enthalpy_mole
double enthalpy_mole() const override
Molar enthalpy. Units: J/kmol.
Definition MixtureFugacityTP.cpp:42
Cantera::MixtureFugacityTP::standardStateConvention
int standardStateConvention() const override
This method returns the convention used in specification of the standard state, of which there are cu...
Definition MixtureFugacityTP.cpp:21
Cantera::MixtureFugacityTP::MixtureFugacityTP
MixtureFugacityTP()=default
Constructor.
Cantera::MixtureFugacityTP::m_g0_RT
vector< double > m_g0_RT
Temporary storage for dimensionless reference state Gibbs energies.
Definition MixtureFugacityTP.h:556
Cantera::MixtureFugacityTP::critPressure
double critPressure() const override
Critical pressure (Pa).
Definition MixtureFugacityTP.cpp:763
Cantera::MixtureFugacityTP::critDensity
double critDensity() const override
Critical density (kg/m3).
Definition MixtureFugacityTP.cpp:784
Cantera::MixtureFugacityTP::getEntropy_R
void getEntropy_R(double *sr) const override
Get the array of nondimensional Enthalpy functions for the standard state species at the current T an...
Definition MixtureFugacityTP.cpp:86
Cantera::MixtureFugacityTP::m_h0_RT
vector< double > m_h0_RT
Temporary storage for dimensionless reference state enthalpies.
Definition MixtureFugacityTP.h:550
Cantera::MixtureFugacityTP::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 MixtureFugacityTP.cpp:145
Cantera::MixtureFugacityTP::getStandardChemPotentials
void getStandardChemPotentials(double *mu) const override
Get the array of chemical potentials at unit activity.
Definition MixtureFugacityTP.cpp:72
Cantera::MixtureFugacityTP::critTemperature
double critTemperature() const override
Critical temperature (K).
Definition MixtureFugacityTP.cpp:756
Cantera::MixtureFugacityTP::getCp_R
void getCp_R(double *cpr) const override
Get the nondimensional Heat Capacities at constant pressure for the standard state of the species at ...
Definition MixtureFugacityTP.cpp:121
Cantera::MixtureFugacityTP::densSpinodalLiquid
virtual double densSpinodalLiquid() const
Return the value of the density at the liquid spinodal point (on the liquid side) for the current tem...
Definition MixtureFugacityTP.cpp:522
Cantera::MixtureFugacityTP::_updateReferenceStateThermo
virtual void _updateReferenceStateThermo() const
Updates the reference state thermodynamic functions at the current T of the solution.
Definition MixtureFugacityTP.cpp:734
Cantera::MixtureFugacityTP::type
string type() const override
String indicating the thermodynamic model implemented.
Definition MixtureFugacityTP.h:78
Cantera::MixtureFugacityTP::satPressure
double satPressure(double TKelvin) override
Calculate the saturation pressure at the current mixture content for the given temperature.
Definition MixtureFugacityTP.cpp:532
Cantera::MixtureFugacityTP::m_tmpV
vector< double > m_tmpV
Temporary storage - length = m_kk.
Definition MixtureFugacityTP.h:288
Cantera::MixtureFugacityTP::getActivityConcentrations
void getActivityConcentrations(double *c) const override
This method returns an array of generalized concentrations.
Definition MixtureFugacityTP.cpp:271
Cantera::MixtureFugacityTP::solveCubic
int solveCubic(double T, double pres, double a, double b, double aAlpha, double Vroot[3], double an, double bn, double cn, double dn, double tc, double vc) const
Solve the cubic equation of state.
Definition MixtureFugacityTP.cpp:797
Cantera::MixtureFugacityTP::critCompressibility
double critCompressibility() const override
Critical compressibility (unitless).
Definition MixtureFugacityTP.cpp:777
Cantera::MixtureFugacityTP::setPressure
void setPressure(double p) override
Set the internally stored pressure (Pa) at constant temperature and composition.
Definition MixtureFugacityTP.cpp:200
Cantera::MixtureFugacityTP::gibbs_RT_ref
const vector< double > & gibbs_RT_ref() const
Returns the vector of nondimensional Gibbs free energies of the reference state at the current temper...
Definition MixtureFugacityTP.cpp:151
Cantera::MixtureFugacityTP::getStandardVolumes_ref
void getStandardVolumes_ref(double *vol) const override
Get the molar volumes of the species reference states at the current T and P_ref of the solution.
Definition MixtureFugacityTP.cpp:166
Cantera::MixtureFugacityTP::densSpinodalGas
virtual double densSpinodalGas() const
Return the value of the density at the gas spinodal point (on the gas side) for the current temperatu...
Definition MixtureFugacityTP.cpp:527
Cantera::MixtureFugacityTP::getPureGibbs
void getPureGibbs(double *gpure) const override
Get the pure Gibbs free energies of each species.
Definition MixtureFugacityTP.cpp:104
Cantera::MixtureFugacityTP::calculatePsat
double calculatePsat(double TKelvin, double &molarVolGas, double &molarVolLiquid)
Calculate the saturation pressure at the current mixture content for the given temperature.
Definition MixtureFugacityTP.cpp:539
Cantera::MixtureFugacityTP::moleFractions_
vector< double > moleFractions_
Storage for the current values of the mole fractions of the species.
Definition MixtureFugacityTP.h:535
Cantera::MixtureFugacityTP::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 MixtureFugacityTP.cpp:81
Cantera::MixtureFugacityTP::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 MixtureFugacityTP.cpp:156
Cantera::MixtureFugacityTP::setTemperature
void setTemperature(const double temp) override
Set the temperature of the phase.
Definition MixtureFugacityTP.cpp:191
Cantera::MixtureFugacityTP::m_s0_R
vector< double > m_s0_R
Temporary storage for dimensionless reference state entropies.
Definition MixtureFugacityTP.h:559
Cantera::MixtureFugacityTP::dpdVCalc
virtual double dpdVCalc(double TKelvin, double molarVol, double &presCalc) const
Calculate the pressure and the pressure derivative given the temperature and the molar volume.
Definition MixtureFugacityTP.cpp:729
Cantera::MixtureFugacityTP::getGibbs_RT
void getGibbs_RT(double *grt) const override
Get the nondimensional Gibbs functions for the species at their standard states of solution at the cu...
Definition MixtureFugacityTP.cpp:95
Cantera::MixtureFugacityTP::entropy_mole
double entropy_mole() const override
Molar entropy. Units: J/kmol/K.
Definition MixtureFugacityTP.cpp:50
Cantera::MixtureFugacityTP::densityCalc
virtual double densityCalc(double TKelvin, double pressure, int phaseRequested, double rhoguess)
Calculates the density given the temperature and the pressure and a guess at the density.
Definition MixtureFugacityTP.cpp:311
Cantera::MixtureFugacityTP::critVolume
double critVolume() const override
Critical volume (m3/kmol).
Definition MixtureFugacityTP.cpp:770
Cantera::MixtureFugacityTP::psatEst
virtual double psatEst(double TKelvin) const
Estimate for the saturation pressure.
Definition MixtureFugacityTP.cpp:295
Cantera::MixtureFugacityTP::getCp_R_ref
void getCp_R_ref(double *cprt) const override
Returns the vector of nondimensional constant pressure heat capacities of the reference state at the ...
Definition MixtureFugacityTP.cpp:161
Cantera::MixtureFugacityTP::getStandardVolumes
void getStandardVolumes(double *vol) const override
Get the molar volumes of each species in their standard states at the current T and P of the solution...
Definition MixtureFugacityTP.cpp:126
Cantera::MixtureFugacityTP::sresid
virtual double sresid() const
Calculate the deviation terms for the total entropy of the mixture from the ideal gas mixture.
Definition MixtureFugacityTP.cpp:285
Cantera::MixtureFugacityTP::getIntEnergy_RT
void getIntEnergy_RT(double *urt) const override
Returns the vector of nondimensional internal Energies of the standard state at the current temperatu...
Definition MixtureFugacityTP.cpp:113
Cantera::MixtureFugacityTP::forcedState_
int forcedState_
Force the system to be on a particular side of the spinodal curve.
Definition MixtureFugacityTP.h:547
Cantera::MixtureFugacityTP::liquidVolEst
virtual double liquidVolEst(double TKelvin, double &pres) const
Estimate for the molar volume of the liquid.
Definition MixtureFugacityTP.cpp:306
Cantera::MixtureFugacityTP::forcedSolutionBranch
int forcedSolutionBranch() const
Report the solution branch which the solution is restricted to.
Definition MixtureFugacityTP.cpp:31
Cantera::MixtureFugacityTP::compositionChanged
void compositionChanged() override
Apply changes to the state which are needed after the composition changes.
Definition MixtureFugacityTP.cpp:264
Cantera::MixtureFugacityTP::m_cp0_R
vector< double > m_cp0_R
Temporary storage for dimensionless reference state heat capacities.
Definition MixtureFugacityTP.h:553
Cantera::MixtureFugacityTP::corr0
int corr0(double TKelvin, double pres, double &densLiq, double &densGas, double &liqGRT, double &gasGRT)
Utility routine in the calculation of the saturation pressure.
Definition MixtureFugacityTP.cpp:452
Cantera::MixtureFugacityTP::setForcedSolutionBranch
void setForcedSolutionBranch(int solnBranch)
Set the solution branch to force the ThermoPhase to exist on one branch or another.
Definition MixtureFugacityTP.cpp:26
Cantera::MixtureFugacityTP::addSpecies
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
Definition MixtureFugacityTP.cpp:173
Cantera::MixtureFugacityTP::hresid
virtual double hresid() const
Calculate the deviation terms for the total enthalpy of the mixture from the ideal gas mixture.
Definition MixtureFugacityTP.cpp:290
Cantera::MixtureFugacityTP::getChemPotentials_RT
void getChemPotentials_RT(double *mu) const override
Get the array of non-dimensional species chemical potentials These are partial molar Gibbs free energ...
Definition MixtureFugacityTP.cpp:60
Cantera::MixtureFugacityTP::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 MixtureFugacityTP.cpp:140
Cantera::MixtureFugacityTP::z
double z() const
Calculate the value of z.
Definition MixtureFugacityTP.cpp:280
Cantera::MixtureFugacityTP::phaseState
int phaseState(bool checkState=false) const
Returns the Phase State flag for the current state of the object.
Definition MixtureFugacityTP.cpp:481
Cantera::MixtureFugacityTP::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 MixtureFugacityTP.cpp:135
Cantera::Phase::pressure
virtual double pressure() const
Return the thermodynamic pressure (Pa).
Definition Phase.h:680
Cantera::ThermoPhase
Base class for a phase with thermodynamic properties.
Definition ThermoPhase.h:390
Cantera
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564