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