Cantera  2.5.1
IdealGasPhase.h
Go to the documentation of this file.
1 /**
2  * @file IdealGasPhase.h
3  * ThermoPhase object for the ideal gas equation of
4  * state - workhorse for %Cantera (see \ref thermoprops
5  * and class \link Cantera::IdealGasPhase IdealGasPhase\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_IDEALGASPHASE_H
12 #define CT_IDEALGASPHASE_H
13 
14 #include "ThermoPhase.h"
15 
16 namespace Cantera
17 {
18 
19 //! Class IdealGasPhase represents low-density gases that obey the ideal gas
20 //! equation of state.
21 /*!
22  *
23  * IdealGasPhase derives from class ThermoPhase, and overloads the virtual
24  * methods defined there with ones that use expressions appropriate for ideal
25  * gas mixtures.
26  *
27  * The independent unknowns are density, mass fraction, and temperature. the
28  * #setPressure() function will calculate the density consistent with the
29  * current mass fraction vector and temperature and the desired pressure, and
30  * then set the density.
31  *
32  * ## Specification of Species Standard State Properties
33  *
34  * It is assumed that the reference state thermodynamics may be obtained by a
35  * pointer to a populated species thermodynamic property manager class in the
36  * base class, ThermoPhase::m_spthermo (see the base class \link
37  * Cantera::MultiSpeciesThermo MultiSpeciesThermo \endlink for a description of
38  * the specification of reference state species thermodynamics functions). The
39  * reference state, where the pressure is fixed at a single pressure, is a key
40  * species property calculation for the Ideal Gas Equation of state.
41  *
42  * This class is optimized for speed of execution. All calls to thermodynamic
43  * functions first call internal routines (aka #enthalpy_RT_ref()) which return
44  * references the reference state thermodynamics functions. Within these
45  * internal reference state functions, the function #_updateThermo() is called,
46  * that first checks to see whether the temperature has changed. If it has, it
47  * updates the internal reference state thermo functions by calling the
48  * MultiSpeciesThermo object.
49  *
50  * Functions for the calculation of standard state properties for species at
51  * arbitrary pressure are provided in IdealGasPhase. However, they are all
52  * derived from their reference state counterparts.
53  *
54  * The standard state enthalpy is independent of pressure:
55  *
56  * \f[
57  * h^o_k(T,P) = h^{ref}_k(T)
58  * \f]
59  *
60  * The standard state constant-pressure heat capacity is independent of pressure:
61  *
62  * \f[
63  * Cp^o_k(T,P) = Cp^{ref}_k(T)
64  * \f]
65  *
66  * The standard state entropy depends in the following fashion on pressure:
67  *
68  * \f[
69  * S^o_k(T,P) = S^{ref}_k(T) - R \ln(\frac{P}{P_{ref}})
70  * \f]
71  * The standard state Gibbs free energy is obtained from the enthalpy and entropy
72  * functions:
73  *
74  * \f[
75  * \mu^o_k(T,P) = h^o_k(T,P) - S^o_k(T,P) T
76  * \f]
77  *
78  * \f[
79  * \mu^o_k(T,P) = \mu^{ref}_k(T) + R T \ln( \frac{P}{P_{ref}})
80  * \f]
81  *
82  * where
83  * \f[
84  * \mu^{ref}_k(T) = h^{ref}_k(T) - T S^{ref}_k(T)
85  * \f]
86  *
87  * The standard state internal energy is obtained from the enthalpy function also
88  *
89  * \f[
90  * u^o_k(T,P) = h^o_k(T) - R T
91  * \f]
92  *
93  * The molar volume of a species is given by the ideal gas law
94  *
95  * \f[
96  * V^o_k(T,P) = \frac{R T}{P}
97  * \f]
98  *
99  * where R is the molar gas constant. For a complete list of physical constants
100  * used within %Cantera, see \ref physConstants .
101  *
102  * ## Specification of Solution Thermodynamic Properties
103  *
104  * The activity of a species defined in the phase is given by the ideal gas law:
105  * \f[
106  * a_k = X_k
107  * \f]
108  * where \f$ X_k \f$ is the mole fraction of species *k*. The chemical potential
109  * for species *k* is equal to
110  *
111  * \f[
112  * \mu_k(T,P) = \mu^o_k(T, P) + R T \log(X_k)
113  * \f]
114  *
115  * In terms of the reference state, the above can be rewritten
116  *
117  * \f[
118  * \mu_k(T,P) = \mu^{ref}_k(T, P) + R T \log(\frac{P X_k}{P_{ref}})
119  * \f]
120  *
121  * The partial molar entropy for species *k* is given by the following relation,
122  *
123  * \f[
124  * \tilde{s}_k(T,P) = s^o_k(T,P) - R \log(X_k) = s^{ref}_k(T) - R \log(\frac{P X_k}{P_{ref}})
125  * \f]
126  *
127  * The partial molar enthalpy for species *k* is
128  *
129  * \f[
130  * \tilde{h}_k(T,P) = h^o_k(T,P) = h^{ref}_k(T)
131  * \f]
132  *
133  * The partial molar Internal Energy for species *k* is
134  *
135  * \f[
136  * \tilde{u}_k(T,P) = u^o_k(T,P) = u^{ref}_k(T)
137  * \f]
138  *
139  * The partial molar Heat Capacity for species *k* is
140  *
141  * \f[
142  * \tilde{Cp}_k(T,P) = Cp^o_k(T,P) = Cp^{ref}_k(T)
143  * \f]
144  *
145  * ## %Application within Kinetics Managers
146  *
147  * \f$ C^a_k\f$ are defined such that \f$ a_k = C^a_k / C^s_k, \f$ where \f$
148  * C^s_k \f$ is a standard concentration defined below and \f$ a_k \f$ are
149  * activities used in the thermodynamic functions. These activity (or
150  * generalized) concentrations are used by kinetics manager classes to compute
151  * the forward and reverse rates of elementary reactions. The activity
152  * concentration,\f$ C^a_k \f$,is given by the following expression.
153  *
154  * \f[
155  * C^a_k = C^s_k X_k = \frac{P}{R T} X_k
156  * \f]
157  *
158  * The standard concentration for species *k* is independent of *k* and equal to
159  *
160  * \f[
161  * C^s_k = C^s = \frac{P}{R T}
162  * \f]
163  *
164  * For example, a bulk-phase binary gas reaction between species j and k,
165  * producing a new gas species l would have the following equation for its rate
166  * of progress variable, \f$ R^1 \f$, which has units of kmol m-3 s-1.
167  *
168  * \f[
169  * R^1 = k^1 C_j^a C_k^a = k^1 (C^s a_j) (C^s a_k)
170  * \f]
171  * where
172  * \f[
173  * C_j^a = C^s a_j \quad \mbox{and} \quad C_k^a = C^s a_k
174  * \f]
175  *
176  * \f$ C_j^a \f$ is the activity concentration of species j, and
177  * \f$ C_k^a \f$ is the activity concentration of species k. \f$ C^s \f$ is the
178  * standard concentration. \f$ a_j \f$ is the activity of species j which is
179  * equal to the mole fraction of j.
180  *
181  * The reverse rate constant can then be obtained from the law of microscopic
182  * reversibility and the equilibrium expression for the system.
183  *
184  * \f[
185  * \frac{a_j a_k}{ a_l} = K_a^{o,1} = \exp(\frac{\mu^o_l - \mu^o_j - \mu^o_k}{R T} )
186  * \f]
187  *
188  * \f$ K_a^{o,1} \f$ is the dimensionless form of the equilibrium constant,
189  * associated with the pressure dependent standard states \f$ \mu^o_l(T,P) \f$
190  * and their associated activities, \f$ a_l \f$, repeated here:
191  *
192  * \f[
193  * \mu_l(T,P) = \mu^o_l(T, P) + R T \log(a_l)
194  * \f]
195  *
196  * We can switch over to expressing the equilibrium constant in terms of the
197  * reference state chemical potentials
198  *
199  * \f[
200  * K_a^{o,1} = \exp(\frac{\mu^{ref}_l - \mu^{ref}_j - \mu^{ref}_k}{R T} ) * \frac{P_{ref}}{P}
201  * \f]
202  *
203  * The concentration equilibrium constant, \f$ K_c \f$, may be obtained by
204  * changing over to activity concentrations. When this is done:
205  *
206  * \f[
207  * \frac{C^a_j C^a_k}{ C^a_l} = C^o K_a^{o,1} = K_c^1 =
208  * \exp(\frac{\mu^{ref}_l - \mu^{ref}_j - \mu^{ref}_k}{R T} ) * \frac{P_{ref}}{RT}
209  * \f]
210  *
211  * %Kinetics managers will calculate the concentration equilibrium constant,
212  * \f$ K_c \f$, using the second and third part of the above expression as a
213  * definition for the concentration equilibrium constant.
214  *
215  * For completeness, the pressure equilibrium constant may be obtained as well
216  *
217  * \f[
218  * \frac{P_j P_k}{ P_l P_{ref}} = K_p^1 =
219  * \exp\left(\frac{\mu^{ref}_l - \mu^{ref}_j - \mu^{ref}_k}{R T} \right)
220  * \f]
221  *
222  * \f$ K_p \f$ is the simplest form of the equilibrium constant for ideal gases.
223  * However, it isn't necessarily the simplest form of the equilibrium constant
224  * for other types of phases; \f$ K_c \f$ is used instead because it is
225  * completely general.
226  *
227  * The reverse rate of progress may be written down as
228  * \f[
229  * R^{-1} = k^{-1} C_l^a = k^{-1} (C^o a_l)
230  * \f]
231  *
232  * where we can use the concept of microscopic reversibility to write the
233  * reverse rate constant in terms of the forward rate constant and the
234  * concentration equilibrium constant, \f$ K_c \f$.
235  *
236  * \f[
237  * k^{-1} = k^1 K^1_c
238  * \f]
239  *
240  * \f$k^{-1} \f$ has units of s-1.
241  *
242  * ## Instantiation of the Class
243  *
244  * The constructor for this phase is located in the default ThermoFactory for
245  * %Cantera. A new IdealGasPhase may be created by the following code snippet:
246  *
247  * @code
248  * XML_Node *xc = get_XML_File("silane.xml");
249  * XML_Node * const xs = xc->findNameID("phase", "silane");
250  * ThermoPhase *silane_tp = newPhase(*xs);
251  * IdealGasPhase *silaneGas = dynamic_cast <IdealGasPhase *>(silane_tp);
252  * @endcode
253  *
254  * or by the following constructor:
255  *
256  * @code
257  * XML_Node *xc = get_XML_File("silane.xml");
258  * XML_Node * const xs = xc->findNameID("phase", "silane");
259  * IdealGasPhase *silaneGas = new IdealGasPhase(*xs);
260  * @endcode
261  *
262  * ## XML Example
263  *
264  * An example of an XML Element named phase setting up a IdealGasPhase
265  * object named silane is given below.
266  *
267  * @code
268  * <!-- phase silane -->
269  * <phase dim="3" id="silane">
270  * <elementArray datasrc="elements.xml"> Si H He </elementArray>
271  * <speciesArray datasrc="#species_data">
272  * H2 H HE SIH4 SI SIH SIH2 SIH3 H3SISIH SI2H6
273  * H2SISIH2 SI3H8 SI2 SI3
274  * </speciesArray>
275  * <reactionArray datasrc="#reaction_data"/>
276  * <thermo model="IdealGas"/>
277  * <kinetics model="GasKinetics"/>
278  * <transport model="None"/>
279  * </phase>
280  * @endcode
281  *
282  * The model attribute "IdealGas" of the thermo XML element identifies the phase
283  * as being of the type handled by the IdealGasPhase object.
284  *
285  * @ingroup thermoprops
286  */
288 {
289 public:
290  //! Default empty Constructor
291  IdealGasPhase();
292 
293  //! Construct and initialize an IdealGasPhase ThermoPhase object
294  //! directly from an ASCII input file
295  /*!
296  * @param inputFile Name of the input file containing the phase definition
297  * to set up the object
298  * @param id ID of the phase in the input file. Defaults to the
299  * empty string.
300  */
301  IdealGasPhase(const std::string& inputFile, const std::string& id = "");
302 
303  //! Construct and initialize an IdealGasPhase ThermoPhase object
304  //! directly from an XML database
305  /*!
306  * @param phaseRef XML phase node containing the description of the phase
307  * @param id id attribute containing the name of the phase.
308  * (default is the empty string)
309  *
310  * @deprecated The XML input format is deprecated and will be removed in
311  * Cantera 3.0.
312  */
313  IdealGasPhase(XML_Node& phaseRef, const std::string& id = "");
314 
315  virtual std::string type() const {
316  return "IdealGas";
317  }
318 
319  //! String indicating the mechanical phase of the matter in this Phase.
320  /*!
321  * For the `IdealGasPhase`, this string is always `gas`.
322  */
323  virtual std::string phaseOfMatter() const {
324  return "gas";
325  }
326 
327  //! @name Molar Thermodynamic Properties of the Solution
328  //! @{
329 
330  //! Return the Molar enthalpy. Units: J/kmol.
331  /*!
332  * For an ideal gas mixture,
333  * \f[
334  * \hat h(T) = \sum_k X_k \hat h^0_k(T),
335  * \f]
336  * and is a function only of temperature. The standard-state pure-species
337  * enthalpies \f$ \hat h^0_k(T) \f$ are computed by the species
338  * thermodynamic property manager.
339  *
340  * \see MultiSpeciesThermo
341  */
342  virtual doublereal enthalpy_mole() const {
343  return RT() * mean_X(enthalpy_RT_ref());
344  }
345 
346  /**
347  * Molar entropy. Units: J/kmol/K.
348  * For an ideal gas mixture,
349  * \f[
350  * \hat s(T, P) = \sum_k X_k \hat s^0_k(T) - \hat R \log (P/P^0).
351  * \f]
352  * The reference-state pure-species entropies \f$ \hat s^0_k(T) \f$ are
353  * computed by the species thermodynamic property manager.
354  * @see MultiSpeciesThermo
355  */
356  virtual doublereal entropy_mole() const;
357 
358  /**
359  * Molar heat capacity at constant pressure. Units: J/kmol/K.
360  * For an ideal gas mixture,
361  * \f[
362  * \hat c_p(t) = \sum_k \hat c^0_{p,k}(T).
363  * \f]
364  * The reference-state pure-species heat capacities \f$ \hat c^0_{p,k}(T) \f$
365  * are computed by the species thermodynamic property manager.
366  * @see MultiSpeciesThermo
367  */
368  virtual doublereal cp_mole() const;
369 
370  /**
371  * Molar heat capacity at constant volume. Units: J/kmol/K.
372  * For an ideal gas mixture,
373  * \f[ \hat c_v = \hat c_p - \hat R. \f]
374  */
375  virtual doublereal cv_mole() const;
376 
377  //! @}
378  //! @name Mechanical Equation of State
379  //! @{
380 
381  /**
382  * Pressure. Units: Pa.
383  * For an ideal gas mixture,
384  * \f[ P = n \hat R T. \f]
385  */
386  virtual doublereal pressure() const {
387  return GasConstant * molarDensity() * temperature();
388  }
389 
390  //! Set the pressure at constant temperature and composition.
391  /*!
392  * Units: Pa.
393  * This method is implemented by setting the mass density to
394  * \f[
395  * \rho = \frac{P \overline W}{\hat R T }.
396  * \f]
397  *
398  * @param p Pressure (Pa)
399  */
400  virtual void setPressure(doublereal p) {
401  setDensity(p * meanMolecularWeight() / RT());
402  }
403 
404  //! Set the density and pressure at constant composition.
405  /*!
406  * Units: kg/m^3, Pa.
407  * This method is implemented by setting the density to the input value and
408  * setting the temperature to
409  * \f[
410  * T = \frac{P \overline W}{\hat R \rho}.
411  * \f]
412  *
413  * @param rho Density (kg/m^3)
414  * @param p Pressure (Pa)
415  */
416  virtual void setState_RP(doublereal rho, doublereal p)
417  {
418  if (p <= 0) {
419  throw CanteraError("IdealGasPhase::setState_RP",
420  "pressure must be positive");
421  }
422  setDensity(rho);
424  }
425 
426  //! Returns the isothermal compressibility. Units: 1/Pa.
427  /**
428  * The isothermal compressibility is defined as
429  * \f[
430  * \kappa_T = -\frac{1}{v}\left(\frac{\partial v}{\partial P}\right)_T
431  * \f]
432  * For ideal gases it's equal to the inverse of the pressure
433  */
434  virtual doublereal isothermalCompressibility() const {
435  return 1.0 / pressure();
436  }
437 
438  //! Return the volumetric thermal expansion coefficient. Units: 1/K.
439  /*!
440  * The thermal expansion coefficient is defined as
441  * \f[
442  * \beta = \frac{1}{v}\left(\frac{\partial v}{\partial T}\right)_P
443  * \f]
444  * For ideal gases, it's equal to the inverse of the temperature.
445  */
446  virtual doublereal thermalExpansionCoeff() const {
447  return 1.0 / temperature();
448  }
449 
450  //@}
451 
452  /**
453  * @name Chemical Potentials and Activities
454  *
455  * The activity \f$a_k\f$ of a species in solution is
456  * related to the chemical potential by
457  * \f[
458  * \mu_k(T,P,X_k) = \mu_k^0(T,P)
459  * + \hat R T \log a_k.
460  * \f]
461  * The quantity \f$\mu_k^0(T,P)\f$ is the standard state chemical potential
462  * at unit activity. It may depend on the pressure and the temperature.
463  * However, it may not depend on the mole fractions of the species in the
464  * solution.
465  *
466  * The activities are related to the generalized concentrations, \f$\tilde
467  * C_k\f$, and standard concentrations, \f$C^0_k\f$, by the following
468  * formula:
469  *
470  * \f[
471  * a_k = \frac{\tilde C_k}{C^0_k}
472  * \f]
473  * The generalized concentrations are used in the kinetics classes to
474  * describe the rates of progress of reactions involving the species. Their
475  * formulation depends upon the specification of the rate constants for
476  * reaction, especially the units used in specifying the rate constants. The
477  * bridge between the thermodynamic equilibrium expressions that use a_k and
478  * the kinetics expressions which use the generalized concentrations is
479  * provided by the multiplicative factor of the standard concentrations.
480  * @{
481  */
482 
483  //! This method returns the array of generalized concentrations.
484  /*!
485  * For an ideal gas mixture, these are simply the actual concentrations.
486  *
487  * @param c Output array of generalized concentrations. The units depend
488  * upon the implementation of the reaction rate expressions within
489  * the phase.
490  */
491  virtual void getActivityConcentrations(doublereal* c) const {
493  }
494 
495  //! Returns the standard concentration \f$ C^0_k \f$, which is used to
496  //! normalize the generalized concentration.
497  /*!
498  * This is defined as the concentration by which the generalized
499  * concentration is normalized to produce the activity. In many cases, this
500  * quantity will be the same for all species in a phase. Since the activity
501  * for an ideal gas mixture is simply the mole fraction, for an ideal gas
502  * \f$ C^0_k = P/\hat R T \f$.
503  *
504  * @param k Optional parameter indicating the species. The default
505  * is to assume this refers to species 0.
506  * @return
507  * Returns the standard Concentration in units of m3 kmol-1.
508  */
509  virtual doublereal standardConcentration(size_t k = 0) const;
510 
511  //! Get the array of non-dimensional activity coefficients at the current
512  //! solution temperature, pressure, and solution concentration.
513  /*!
514  * For ideal gases, the activity coefficients are all equal to one.
515  *
516  * @param ac Output vector of activity coefficients. Length: m_kk.
517  */
518  virtual void getActivityCoefficients(doublereal* ac) const;
519 
520  //@}
521  /// @name Partial Molar Properties of the Solution
522  //@{
523 
524  virtual void getChemPotentials(doublereal* mu) const;
525  virtual void getPartialMolarEnthalpies(doublereal* hbar) const;
526  virtual void getPartialMolarEntropies(doublereal* sbar) const;
527  virtual void getPartialMolarIntEnergies(doublereal* ubar) const;
528  virtual void getPartialMolarCp(doublereal* cpbar) const;
529  virtual void getPartialMolarVolumes(doublereal* vbar) const;
530 
531  //@}
532  /// @name Properties of the Standard State of the Species in the Solution
533  //@{
534 
535  virtual void getStandardChemPotentials(doublereal* mu) const;
536  virtual void getEnthalpy_RT(doublereal* hrt) const;
537  virtual void getEntropy_R(doublereal* sr) const;
538  virtual void getGibbs_RT(doublereal* grt) const;
539  virtual void getPureGibbs(doublereal* gpure) const;
540  virtual void getIntEnergy_RT(doublereal* urt) const;
541  virtual void getCp_R(doublereal* cpr) const;
542  virtual void getStandardVolumes(doublereal* vol) const;
543 
544  //@}
545  /// @name Thermodynamic Values for the Species Reference States
546  //@{
547 
548  virtual void getEnthalpy_RT_ref(doublereal* hrt) const;
549  virtual void getGibbs_RT_ref(doublereal* grt) const;
550  virtual void getGibbs_ref(doublereal* g) const;
551  virtual void getEntropy_R_ref(doublereal* er) const;
552  virtual void getIntEnergy_RT_ref(doublereal* urt) const;
553  virtual void getCp_R_ref(doublereal* cprt) const;
554  virtual void getStandardVolumes_ref(doublereal* vol) const;
555 
556  //@}
557  /// @name NonVirtual Internal methods to Return References to Reference State Thermo
558  //@{
559 
560  //! Returns a reference to the dimensionless reference state enthalpy vector.
561  /*!
562  * This function is part of the layer that checks/recalculates the reference
563  * state thermo functions.
564  */
565  const vector_fp& enthalpy_RT_ref() const {
566  _updateThermo();
567  return m_h0_RT;
568  }
569 
570  //! Returns a reference to the dimensionless reference state Gibbs free energy vector.
571  /*!
572  * This function is part of the layer that checks/recalculates the reference
573  * state thermo functions.
574  */
575  const vector_fp& gibbs_RT_ref() const {
576  _updateThermo();
577  return m_g0_RT;
578  }
579 
580  //! Returns a reference to the dimensionless reference state Entropy vector.
581  /*!
582  * This function is part of the layer that checks/recalculates the reference
583  * state thermo functions.
584  */
585  const vector_fp& entropy_R_ref() const {
586  _updateThermo();
587  return m_s0_R;
588  }
589 
590  //! Returns a reference to the dimensionless reference state Heat Capacity vector.
591  /*!
592  * This function is part of the layer that checks/recalculates the reference
593  * state thermo functions.
594  */
595  const vector_fp& cp_R_ref() const {
596  _updateThermo();
597  return m_cp0_R;
598  }
599 
600  //@}
601 
602  virtual bool addSpecies(shared_ptr<Species> spec);
603  virtual void setToEquilState(const doublereal* mu_RT);
604 
605 protected:
606  //! Reference state pressure
607  /*!
608  * Value of the reference state pressure in Pascals.
609  * All species must have the same reference state pressure.
610  */
611  doublereal m_p0;
612 
613  //! Temporary storage for dimensionless reference state enthalpies
615 
616  //! Temporary storage for dimensionless reference state heat capacities
618 
619  //! Temporary storage for dimensionless reference state Gibbs energies
621 
622  //! Temporary storage for dimensionless reference state entropies
623  mutable vector_fp m_s0_R;
624 
625  mutable vector_fp m_expg0_RT;
626 
627  //! Temporary array containing internally calculated partial pressures
628  mutable vector_fp m_pp;
629 
630 private:
631  //! Update the species reference state thermodynamic functions
632  /*!
633  * This method is called each time a thermodynamic property is requested,
634  * to check whether the internal species properties within the object
635  * need to be updated. Currently, this updates the species thermo
636  * polynomial values for the current value of the temperature. A check is
637  * made to see if the temperature has changed since the last evaluation.
638  * This object does not contain any persistent data that depends on the
639  * concentration, that needs to be updated. The state object modifies its
640  * concentration dependent information at the time the setMoleFractions()
641  * (or equivalent) call is made.
642  */
643  void _updateThermo() const;
644 };
645 
646 }
647 
648 #endif
Header file for class ThermoPhase, the base class for phases with thermodynamic properties,...
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:61
Class IdealGasPhase represents low-density gases that obey the ideal gas equation of state.
vector_fp m_g0_RT
Temporary storage for dimensionless reference state Gibbs energies.
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 getActivityCoefficients(doublereal *ac) const
Get the array of non-dimensional activity coefficients at the current solution temperature,...
virtual doublereal isothermalCompressibility() const
Returns the isothermal compressibility. Units: 1/Pa.
virtual void getGibbs_RT(doublereal *grt) const
Get the nondimensional Gibbs functions for the species in their standard states at the current T and ...
virtual void getPartialMolarIntEnergies(doublereal *ubar) const
Return an array of partial molar internal energies for the species in the mixture.
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure.
const vector_fp & enthalpy_RT_ref() const
Returns a reference to the dimensionless reference state enthalpy vector.
vector_fp m_h0_RT
Temporary storage for dimensionless reference state enthalpies.
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
virtual void setToEquilState(const doublereal *mu_RT)
This method is used by the ChemEquil equilibrium solver.
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
vector_fp m_pp
Temporary array containing internally calculated partial pressures.
virtual void getStandardVolumes(doublereal *vol) const
Get the molar volumes of the species standard states at the current T and P of the solution.
vector_fp m_s0_R
Temporary storage for dimensionless reference state entropies.
virtual doublereal cv_mole() const
Molar heat capacity at constant volume.
const vector_fp & gibbs_RT_ref() const
Returns a reference to the dimensionless reference state Gibbs free energy vector.
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
virtual void getPartialMolarCp(doublereal *cpbar) const
Return an array of partial molar heat capacities for the species in the mixture.
virtual std::string phaseOfMatter() const
String indicating the mechanical phase of the matter in this Phase.
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
virtual doublereal entropy_mole() const
Molar entropy.
virtual void getActivityConcentrations(doublereal *c) const
This method returns the array of generalized concentrations.
const vector_fp & entropy_R_ref() const
Returns a reference to the dimensionless reference state Entropy vector.
IdealGasPhase()
Default empty Constructor.
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 std::string type() const
String indicating the thermodynamic model implemented.
virtual void getIntEnergy_RT_ref(doublereal *urt) const
Returns the vector of nondimensional internal Energies of the reference state at the current temperat...
virtual void setState_RP(doublereal rho, doublereal p)
Set the density and pressure at constant composition.
virtual void getIntEnergy_RT(doublereal *urt) const
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
virtual doublereal pressure() const
Pressure.
virtual void getCp_R_ref(doublereal *cprt) const
Returns the vector of nondimensional constant pressure heat capacities of the reference state at the ...
doublereal m_p0
Reference state pressure.
virtual void getStandardChemPotentials(doublereal *mu) const
Get the array of chemical potentials at unit activity for the species at their standard states at the...
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 doublereal enthalpy_mole() const
Return the Molar enthalpy. Units: J/kmol.
virtual doublereal thermalExpansionCoeff() const
Return the volumetric thermal expansion coefficient. Units: 1/K.
void _updateThermo() const
Update the species reference state thermodynamic functions.
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
const vector_fp & cp_R_ref() const
Returns a reference to the dimensionless reference state Heat Capacity vector.
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 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 Gibbs functions for the standard state of the species at the current T and P of the solution.
virtual void setPressure(doublereal p)
Set the pressure at constant temperature and composition.
virtual void getEnthalpy_RT_ref(doublereal *hrt) const
Returns the vector of nondimensional enthalpies of the reference state at the current temperature of ...
virtual doublereal standardConcentration(size_t k=0) const
Returns the standard concentration , which is used to normalize the generalized concentration.
void getConcentrations(double *const c) const
Get the species concentrations (kmol/m^3).
Definition: Phase.cpp:625
double molarDensity() const
Molar density (kmol/m^3).
Definition: Phase.cpp:700
doublereal mean_X(const doublereal *const Q) const
Evaluate the mole-fraction-weighted mean of an array Q.
Definition: Phase.cpp:746
virtual void setDensity(const double density_)
Set the internally stored density (kg/m^3) of the phase.
Definition: Phase.cpp:716
doublereal meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
Definition: Phase.h:748
doublereal temperature() const
Temperature (K).
Definition: Phase.h:667
virtual void setTemperature(const doublereal temp)
Set the internally stored temperature of the phase (K).
Definition: Phase.h:724
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:102
doublereal RT() const
Return the Gas Constant multiplied by the current temperature.
Definition: ThermoPhase.h:776
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
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition: ct_defs.h:109
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:264