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