Cantera  2.5.1
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"
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  */
75 {
76 public:
77  //! @name Constructors and Duplicators for MixtureFugacityTP
78  //! @{
79 
80  //! Constructor.
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 Partial Molar Properties of the Solution
124  //@{
125 
126  //! Get the array of non-dimensional species chemical potentials
127  //! These are partial molar Gibbs free energies.
128  /*!
129  * \f$ \mu_k / \hat R T \f$.
130  * Units: unitless
131  *
132  * We close the loop on this function, here, calling getChemPotentials() and
133  * then dividing by RT. No need for child classes to handle.
134  *
135  * @param mu Output vector of non-dimensional species chemical potentials
136  * Length: m_kk.
137  */
138  virtual void getChemPotentials_RT(doublereal* mu) const;
139 
140  //@}
141  /*!
142  * @name Properties of the Standard State of the Species in the Solution
143  *
144  * Within MixtureFugacityTP, these properties are calculated via a common
145  * routine, _updateStandardStateThermo(), which must be overloaded in
146  * inherited objects. The values are cached within this object, and are not
147  * recalculated unless the temperature or pressure changes.
148  */
149  //@{
150 
151  //! Get the array of chemical potentials at unit activity.
152  /*!
153  * These are the standard state chemical potentials \f$ \mu^0_k(T,P)
154  * \f$. The values are evaluated at the current temperature and pressure.
155  *
156  * For all objects with the Mixture Fugacity approximation, we define the
157  * standard state as an ideal gas at the current temperature and pressure
158  * of the solution.
159  *
160  * @param mu Output vector of standard state chemical potentials.
161  * length = m_kk. units are J / kmol.
162  */
163  virtual void getStandardChemPotentials(doublereal* mu) const;
164 
165  //! Get the nondimensional Enthalpy functions for the species at their
166  //! standard states at the current *T* and *P* of the solution.
167  /*!
168  * For all objects with the Mixture Fugacity approximation, we define the
169  * standard state as an ideal gas at the current temperature and pressure
170  * of the solution.
171  *
172  * @param hrt Output vector of standard state enthalpies.
173  * length = m_kk. units are unitless.
174  */
175  virtual void getEnthalpy_RT(doublereal* hrt) const;
176 
177  //! Get the array of nondimensional Enthalpy functions for the standard
178  //! state species at the current *T* and *P* of the solution.
179  /*!
180  * For all objects with the Mixture Fugacity approximation, we define the
181  * standard state as an ideal gas at the current temperature and pressure of
182  * the solution.
183  *
184  * @param sr Output vector of nondimensional standard state entropies.
185  * length = m_kk.
186  */
187  virtual void getEntropy_R(doublereal* sr) const;
188 
189  //! Get the nondimensional Gibbs functions for the species at their standard
190  //! states of solution at the current T and P of the solution.
191  /*!
192  * For all objects with the Mixture Fugacity approximation, we define the
193  * standard state as an ideal gas at the current temperature and pressure
194  * of the solution.
195  *
196  * @param grt Output vector of nondimensional standard state Gibbs free
197  * energies. length = m_kk.
198  */
199  virtual void getGibbs_RT(doublereal* grt) const;
200 
201  //! Get the pure Gibbs free energies of each species. Species are assumed to
202  //! be in their standard states.
203  /*!
204  * This is the same as getStandardChemPotentials().
205  *
206  * @param[out] gpure Array of standard state Gibbs free energies. length =
207  * m_kk. units are J/kmol.
208  */
209  virtual void getPureGibbs(doublereal* gpure) const;
210 
211  //! Returns the vector of nondimensional internal Energies of the standard
212  //! state at the current temperature and pressure of the solution for each
213  //! species.
214  /*!
215  * For all objects with the Mixture Fugacity approximation, we define the
216  * standard state as an ideal gas at the current temperature and pressure
217  * of the solution.
218  *
219  * \f[
220  * u^{ss}_k(T,P) = h^{ss}_k(T) - P * V^{ss}_k
221  * \f]
222  *
223  * @param urt Output vector of nondimensional standard state internal
224  * energies. length = m_kk.
225  */
226  virtual void getIntEnergy_RT(doublereal* urt) const;
227 
228  //! Get the nondimensional Heat Capacities at constant pressure for the
229  //! standard state of the species at the current T and P.
230  /*!
231  * For all objects with the Mixture Fugacity approximation, we define the
232  * standard state as an ideal gas at the current temperature and pressure of
233  * the solution.
234  *
235  * @param cpr Output vector containing the the nondimensional Heat
236  * Capacities at constant pressure for the standard state of
237  * the species. Length: m_kk.
238  */
239  virtual void getCp_R(doublereal* cpr) const;
240 
241  //! Get the molar volumes of each species in their standard states at the
242  //! current *T* and *P* of the solution.
243  /*!
244  * For all objects with the Mixture Fugacity approximation, we define the
245  * standard state as an ideal gas at the current temperature and pressure of
246  * the solution.
247  *
248  * units = m^3 / kmol
249  *
250  * @param vol Output vector of species volumes. length = m_kk.
251  * units = m^3 / kmol
252  */
253  virtual void getStandardVolumes(doublereal* vol) const;
254  // @}
255 
256  //! Set the temperature of the phase
257  /*!
258  * Currently this passes down to setState_TP(). It does not make sense to
259  * calculate the standard state without first setting T and P.
260  *
261  * @param temp Temperature (kelvin)
262  */
263  virtual void setTemperature(const doublereal temp);
264 
265  //! Set the internally stored pressure (Pa) at constant temperature and
266  //! composition
267  /*!
268  * Currently this passes down to setState_TP(). It does not make sense to
269  * calculate the standard state without first setting T and P.
270  *
271  * @param p input Pressure (Pa)
272  */
273  virtual void setPressure(doublereal p);
274 
275 protected:
276  /**
277  * Calculate the density of the mixture using the partial molar volumes and
278  * mole fractions as input
279  *
280  * The formula for this is
281  *
282  * \f[
283  * \rho = \frac{\sum_k{X_k W_k}}{\sum_k{X_k V_k}}
284  * \f]
285  *
286  * where \f$X_k\f$ are the mole fractions, \f$W_k\f$ are the molecular
287  * weights, and \f$V_k\f$ are the pure species molar volumes.
288  *
289  * Note, the basis behind this formula is that in an ideal solution the
290  * partial molar volumes are equal to the pure species molar volumes. We
291  * have additionally specified in this class that the pure species molar
292  * volumes are independent of temperature and pressure.
293  */
294  virtual void calcDensity();
295 
296 public:
297  virtual void setState_TP(doublereal T, doublereal pres);
298  virtual void setState_TR(doublereal T, doublereal rho);
299  virtual void setState_TPX(doublereal t, doublereal p, const doublereal* x);
300 
301 protected:
302  virtual void compositionChanged();
303  void setMoleFractions_NoState(const doublereal* const x);
304 
305 protected:
306  //! Updates the reference state thermodynamic functions at the current T of
307  //! the solution.
308  /*!
309  * This function must be called for every call to functions in this class.
310  * It checks to see whether the temperature has changed and thus the ss
311  * thermodynamics functions for all of the species must be recalculated.
312  *
313  * This function is responsible for updating the following internal members:
314  *
315  * - m_h0_RT;
316  * - m_cp0_R;
317  * - m_g0_RT;
318  * - m_s0_R;
319  */
320  virtual void _updateReferenceStateThermo() const;
321 public:
322 
323  /// @name Thermodynamic Values for the Species Reference States
324  /*!
325  * There are also temporary variables for holding the species reference-
326  * state values of Cp, H, S, and V at the last temperature and reference
327  * pressure called. These functions are not recalculated if a new call is
328  * made using the previous temperature. All calculations are done within the
329  * routine _updateRefStateThermo().
330  */
331  //@{
332 
333  virtual void getEnthalpy_RT_ref(doublereal* hrt) const;
334  virtual void getGibbs_RT_ref(doublereal* grt) const;
335 
336 protected:
337  //! Returns the vector of nondimensional Gibbs free energies of the
338  //! reference state at the current temperature of the solution and the
339  //! reference pressure for the species.
340  /*!
341  * @return Output vector contains the nondimensional Gibbs free energies
342  * of the reference state of the species
343  * length = m_kk, units = dimensionless.
344  */
345  const vector_fp& gibbs_RT_ref() const;
346 
347 public:
348  virtual void getGibbs_ref(doublereal* g) const;
349  virtual void getEntropy_R_ref(doublereal* er) const;
350  virtual void getCp_R_ref(doublereal* cprt) const;
351  virtual void getStandardVolumes_ref(doublereal* vol) const;
352 
353  //@}
354  //! @name Initialization Methods - For Internal use
355  /*!
356  * The following methods are used in the process of constructing
357  * the phase and setting its parameters from a specification in an
358  * input file. They are not normally used in application programs.
359  * To see how they are used, see importPhase().
360  */
361  //@{
362 
363  virtual bool addSpecies(shared_ptr<Species> spec);
364  virtual void setStateFromXML(const XML_Node& state);
365 
366 protected:
367  //! @name Special Functions for fugacity classes
368  //! @{
369 
370  //! Calculate the value of z
371  /*!
372  * \f[
373  * z = \frac{P v}{R T}
374  * \f]
375  *
376  * returns the value of z
377  */
378  doublereal z() const;
379 
380  //! Calculate the deviation terms for the total entropy of the mixture from
381  //! the ideal gas mixture
382  /*
383  * Here we use the current state conditions
384  *
385  * @returns the change in entropy in units of J kmol-1 K-1.
386  */
387  virtual doublereal sresid() const;
388 
389  //! Calculate the deviation terms for the total enthalpy of the mixture from
390  //! the ideal gas mixture
391  /*
392  * Here we use the current state conditions
393  *
394  * @returns the change in entropy in units of J kmol-1.
395  */
396  virtual doublereal hresid() const;
397 
398  //! Estimate for the saturation pressure
399  /*!
400  * Note: this is only used as a starting guess for later routines that
401  * actually calculate an accurate value for the saturation pressure.
402  *
403  * @param TKelvin temperature in kelvin
404  * @return the estimated saturation pressure at the given temperature
405  */
406  virtual doublereal psatEst(doublereal TKelvin) const;
407 
408 public:
409  //! Estimate for the molar volume of the liquid
410  /*!
411  * Note: this is only used as a starting guess for later routines that
412  * actually calculate an accurate value for the liquid molar volume. This
413  * routine doesn't change the state of the system.
414  *
415  * @param TKelvin temperature in kelvin
416  * @param pres Pressure in Pa. This is used as an initial guess. If the
417  * routine needs to change the pressure to find a stable
418  * liquid state, the new pressure is returned in this
419  * variable.
420  * @returns the estimate of the liquid volume. If the liquid can't be
421  * found, this routine returns -1.
422  */
423  virtual doublereal liquidVolEst(doublereal TKelvin, doublereal& pres) const;
424 
425  //! Calculates the density given the temperature and the pressure and a
426  //! guess at the density.
427  /*!
428  * Note, below T_c, this is a multivalued function. We do not cross the
429  * vapor dome in this. This is protected because it is called during
430  * setState_TP() routines. Infinite loops would result if it were not
431  * protected.
432  *
433  * -> why is this not const?
434  *
435  * @param TKelvin Temperature in Kelvin
436  * @param pressure Pressure in Pascals (Newton/m**2)
437  * @param phaseRequested int representing the phase whose density we are
438  * requesting. If we put a gas or liquid phase here, we will attempt to
439  * find a volume in that part of the volume space, only, in this
440  * routine. A value of FLUID_UNDEFINED means that we will accept
441  * anything.
442  * @param rhoguess Guessed density of the fluid. A value of -1.0 indicates
443  * that there is no guessed density
444  * @return We return the density of the fluid at the requested phase. If
445  * we have not found any acceptable density we return a -1. If we
446  * have found an acceptable density at a different phase, we
447  * return a -2.
448  */
449  virtual doublereal densityCalc(doublereal TKelvin, doublereal pressure, int phaseRequested,
450  doublereal rhoguess);
451 
452 protected:
453  //! Utility routine in the calculation of the saturation pressure
454  /*!
455  * @param TKelvin temperature (kelvin)
456  * @param pres pressure (Pascal)
457  * @param[out] densLiq density of liquid
458  * @param[out] densGas density of gas
459  * @param[out] liqGRT deltaG/RT of liquid
460  * @param[out] gasGRT deltaG/RT of gas
461  */
462  int corr0(doublereal TKelvin, doublereal pres, doublereal& densLiq,
463  doublereal& densGas, doublereal& liqGRT, doublereal& gasGRT);
464 
465 public:
466  //! Returns the Phase State flag for the current state of the object
467  /*!
468  * @param checkState If true, this function does a complete check to see
469  * where in parameters space we are
470  *
471  * There are three values:
472  * - WATER_GAS below the critical temperature but below the critical density
473  * - WATER_LIQUID below the critical temperature but above the critical density
474  * - WATER_SUPERCRIT above the critical temperature
475  */
476  int phaseState(bool checkState = false) const;
477 
478  //! Return the value of the density at the liquid spinodal point (on the
479  //! liquid side) for the current temperature.
480  /*!
481  * @returns the density with units of kg m-3
482  */
483  virtual doublereal densSpinodalLiquid() const;
484 
485  //! Return the value of the density at the gas spinodal point (on the gas
486  //! side) for the current temperature.
487  /*!
488  * @returns the density with units of kg m-3
489  */
490  virtual doublereal densSpinodalGas() const;
491 
492 public:
493  //! Calculate the saturation pressure at the current mixture content for the
494  //! given temperature
495  /*!
496  * @param TKelvin (input) Temperature (Kelvin)
497  * @param molarVolGas (return) Molar volume of the gas
498  * @param molarVolLiquid (return) Molar volume of the liquid
499  * @returns the saturation pressure at the given temperature
500  */
501  doublereal calculatePsat(doublereal TKelvin, doublereal& molarVolGas,
502  doublereal& molarVolLiquid);
503 
504 public:
505  //! Calculate the saturation pressure at the current mixture content for the
506  //! given temperature
507  /*!
508  * @param TKelvin Temperature (Kelvin)
509  * @return The saturation pressure at the given temperature
510  */
511  virtual doublereal satPressure(doublereal TKelvin);
512 
513 protected:
514  //! Calculate the pressure given the temperature and the molar volume
515  /*!
516  * @param TKelvin temperature in kelvin
517  * @param molarVol molar volume ( m3/kmol)
518  * @returns the pressure.
519  */
520  virtual doublereal pressureCalc(doublereal TKelvin, doublereal molarVol) const;
521 
522  //! Calculate the pressure and the pressure derivative given the temperature
523  //! and the molar volume
524  /*!
525  * Temperature and mole number are held constant
526  *
527  * @param TKelvin temperature in kelvin
528  * @param molarVol molar volume ( m3/kmol)
529  * @param presCalc Returns the pressure.
530  * @returns the derivative of the pressure wrt the molar volume
531  */
532  virtual doublereal dpdVCalc(doublereal TKelvin, doublereal molarVol, doublereal& presCalc) const;
533 
534  virtual void updateMixingExpressions();
535 
536  //@}
537 
538 protected:
539  virtual void invalidateCache();
540 
541  //! Storage for the current values of the mole fractions of the species
542  /*!
543  * This vector is kept up-to-date when some the setState functions are called.
544  */
546 
547  //! Current state of the fluid
548  /*!
549  * There are three possible states of the fluid:
550  * - FLUID_GAS
551  * - FLUID_LIQUID
552  * - FLUID_SUPERCRIT
553  */
554  int iState_;
555 
556  //! Force the system to be on a particular side of the spinodal curve
558 
559  //! The last temperature at which the reference state thermodynamic
560  //! properties were calculated at.
561  mutable doublereal m_Tlast_ref;
562 
563  //! Temporary storage for dimensionless reference state enthalpies
565 
566  //! Temporary storage for dimensionless reference state heat capacities
568 
569  //! Temporary storage for dimensionless reference state Gibbs energies
571 
572  //! Temporary storage for dimensionless reference state entropies
573  mutable vector_fp m_s0_R;
574 };
575 }
576 
577 #endif
Header file for class ThermoPhase, the base class for phases with thermodynamic properties,...
This is a filter class for ThermoPhase that implements some preparatory steps for efficiently handlin...
virtual void setStateFromXML(const XML_Node &state)
Set the initial state of the phase to the conditions specified in the state XML element.
int iState_
Current state of the fluid.
vector_fp m_g0_RT
Temporary storage for dimensionless reference state Gibbs energies.
virtual int reportSolnBranchActual() const
Report the solution branch which the solution is actually on.
vector_fp m_cp0_R
Temporary storage for dimensionless reference state heat capacities.
virtual bool addSpecies(shared_ptr< Species > spec)
virtual void getGibbs_RT_ref(doublereal *grt) const
Returns the vector of nondimensional Gibbs Free Energies of the reference state at the current temper...
virtual void getGibbs_RT(doublereal *grt) const
Get the nondimensional Gibbs functions for the species at their standard states of solution at the cu...
virtual doublereal hresid() const
Calculate the deviation terms for the total enthalpy of the mixture from the ideal gas mixture.
doublereal z() const
Calculate the value of z.
vector_fp m_h0_RT
Temporary storage for dimensionless reference state enthalpies.
virtual doublereal satPressure(doublereal TKelvin)
Calculate the saturation pressure at the current mixture content for the given temperature.
virtual void setState_TP(doublereal T, doublereal pres)
Set the temperature (K) and pressure (Pa)
virtual void getdlnActCoeffdlnN_diag(doublereal *dlnActCoeffdlnN_diag) const
Get the array of log species mole number derivatives of the log activity coefficients.
virtual void _updateReferenceStateThermo() const
Updates the reference state thermodynamic functions at the current T of the solution.
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...
vector_fp m_s0_R
Temporary storage for dimensionless reference state entropies.
virtual void setState_TPX(doublereal t, doublereal p, const doublereal *x)
Set the temperature (K), pressure (Pa), and mole fractions.
virtual doublereal dpdVCalc(doublereal TKelvin, doublereal molarVol, doublereal &presCalc) const
Calculate the pressure and the pressure derivative given the temperature and the molar volume.
virtual doublereal sresid() const
Calculate the deviation terms for the total entropy of the mixture from the ideal gas mixture.
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the standard state of the species at ...
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Enthalpy functions for the standard state species at the current T an...
virtual void setPressure(doublereal p)
Set the internally stored pressure (Pa) at constant temperature and composition.
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.
virtual doublereal psatEst(doublereal TKelvin) const
Estimate for the saturation pressure.
virtual doublereal liquidVolEst(doublereal TKelvin, doublereal &pres) const
Estimate for the molar volume of the liquid.
const vector_fp & gibbs_RT_ref() const
Returns the vector of nondimensional Gibbs free energies of the reference state at the current temper...
virtual int standardStateConvention() const
This method returns the convention used in specification of the standard state, of which there are cu...
virtual void getEntropy_R_ref(doublereal *er) const
Returns the vector of nondimensional entropies of the reference state at the current temperature of t...
virtual doublereal densSpinodalGas() const
Return the value of the density at the gas spinodal point (on the gas side) for the current temperatu...
virtual std::string type() const
String indicating the thermodynamic model implemented.
virtual void getIntEnergy_RT(doublereal *urt) const
Returns the vector of nondimensional internal Energies of the standard state at the current temperatu...
virtual void setTemperature(const doublereal temp)
Set the temperature of the phase.
virtual void getCp_R_ref(doublereal *cprt) const
Returns the vector of nondimensional constant pressure heat capacities of the reference state at the ...
virtual doublereal pressureCalc(doublereal TKelvin, doublereal molarVol) const
Calculate the pressure given the temperature and the molar volume.
vector_fp moleFractions_
Storage for the current values of the mole fractions of the species.
doublereal m_Tlast_ref
The last temperature at which the reference state thermodynamic properties were calculated at.
doublereal calculatePsat(doublereal TKelvin, doublereal &molarVolGas, doublereal &molarVolLiquid)
Calculate the saturation pressure at the current mixture content for the given temperature.
virtual void getStandardChemPotentials(doublereal *mu) const
Get the array of chemical potentials at unit activity.
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.
int forcedState_
Force the system to be on a particular side of the spinodal curve.
virtual int forcedSolutionBranch() const
Report the solution branch which the solution is restricted to.
virtual void compositionChanged()
Apply changes to the state which are needed after the composition changes.
virtual void getChemPotentials_RT(doublereal *mu) const
Get the array of non-dimensional species chemical potentials These are partial molar Gibbs free energ...
virtual void setForcedSolutionBranch(int solnBranch)
Set the solution branch to force the ThermoPhase to exist on one branch or another.
int corr0(doublereal TKelvin, doublereal pres, doublereal &densLiq, doublereal &densGas, doublereal &liqGRT, doublereal &gasGRT)
Utility routine in the calculation of the saturation pressure.
virtual doublereal densSpinodalLiquid() const
Return the value of the density at the liquid spinodal point (on the liquid side) for the current tem...
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...
virtual void invalidateCache()
Invalidate any cached values which are normally updated only when a change in state is detected.
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
virtual void getPureGibbs(doublereal *gpure) const
Get the pure Gibbs free energies of each species.
int phaseState(bool checkState=false) const
Returns the Phase State flag for the current state of the object.
virtual void getEnthalpy_RT_ref(doublereal *hrt) const
virtual void calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
An error indicating that an unimplemented function has been called.
Definition: ctexceptions.h:187
virtual double pressure() const
Return the thermodynamic pressure (Pa).
Definition: Phase.h:679
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:102
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:104
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:180
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:264