Cantera 2.6.0

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