Cantera  2.4.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 "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 XML data
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  IdealGasPhase(XML_Node& phaseRef, const std::string& id = "");
311 
312  virtual std::string type() const {
313  return "IdealGas";
314  }
315 
316  //! @name Molar Thermodynamic Properties of the Solution
317  //! @{
318 
319  //! Return the Molar enthalpy. Units: J/kmol.
320  /*!
321  * For an ideal gas mixture,
322  * \f[
323  * \hat h(T) = \sum_k X_k \hat h^0_k(T),
324  * \f]
325  * and is a function only of temperature. The standard-state pure-species
326  * enthalpies \f$ \hat h^0_k(T) \f$ are computed by the species
327  * thermodynamic property manager.
328  *
329  * \see MultiSpeciesThermo
330  */
331  virtual doublereal enthalpy_mole() const {
332  return RT() * mean_X(enthalpy_RT_ref());
333  }
334 
335  /**
336  * Molar entropy. Units: J/kmol/K.
337  * For an ideal gas mixture,
338  * \f[
339  * \hat s(T, P) = \sum_k X_k \hat s^0_k(T) - \hat R \log (P/P^0).
340  * \f]
341  * The reference-state pure-species entropies \f$ \hat s^0_k(T) \f$ are
342  * computed by the species thermodynamic property manager.
343  * @see MultiSpeciesThermo
344  */
345  virtual doublereal entropy_mole() const;
346 
347  /**
348  * Molar heat capacity at constant pressure. Units: J/kmol/K.
349  * For an ideal gas mixture,
350  * \f[
351  * \hat c_p(t) = \sum_k \hat c^0_{p,k}(T).
352  * \f]
353  * The reference-state pure-species heat capacities \f$ \hat c^0_{p,k}(T) \f$
354  * are computed by the species thermodynamic property manager.
355  * @see MultiSpeciesThermo
356  */
357  virtual doublereal cp_mole() const;
358 
359  /**
360  * Molar heat capacity at constant volume. Units: J/kmol/K.
361  * For an ideal gas mixture,
362  * \f[ \hat c_v = \hat c_p - \hat R. \f]
363  */
364  virtual doublereal cv_mole() const;
365 
366  //! @}
367  //! @name Mechanical Equation of State
368  //! @{
369 
370  /**
371  * Pressure. Units: Pa.
372  * For an ideal gas mixture,
373  * \f[ P = n \hat R T. \f]
374  */
375  virtual doublereal pressure() const {
376  return GasConstant * molarDensity() * temperature();
377  }
378 
379  //! Set the pressure at constant temperature and composition.
380  /*!
381  * Units: Pa.
382  * This method is implemented by setting the mass density to
383  * \f[
384  * \rho = \frac{P \overline W}{\hat R T }.
385  * \f]
386  *
387  * @param p Pressure (Pa)
388  */
389  virtual void setPressure(doublereal p) {
390  setDensity(p * meanMolecularWeight() / RT());
391  }
392 
393  //! Set the density and pressure at constant composition.
394  /*!
395  * Units: kg/m^3, Pa.
396  * This method is implemented by setting the density to the input value and
397  * setting the temperature to
398  * \f[
399  * T = \frac{P \overline W}{\hat R \rho}.
400  * \f]
401  *
402  * @param rho Density (kg/m^3)
403  * @param p Pressure (Pa)
404  */
405  virtual void setState_RP(doublereal rho, doublereal p)
406  {
407  if (p <= 0) {
408  throw CanteraError("IdealGasPhase::setState_RP",
409  "pressure must be positive");
410  }
411  setDensity(rho);
413  }
414 
415  //! Returns the isothermal compressibility. Units: 1/Pa.
416  /**
417  * The isothermal compressibility is defined as
418  * \f[
419  * \kappa_T = -\frac{1}{v}\left(\frac{\partial v}{\partial P}\right)_T
420  * \f]
421  * For ideal gases it's equal to the inverse of the pressure
422  */
423  virtual doublereal isothermalCompressibility() const {
424  return 1.0 / pressure();
425  }
426 
427  //! Return the volumetric thermal expansion coefficient. Units: 1/K.
428  /*!
429  * The thermal expansion coefficient is defined as
430  * \f[
431  * \beta = \frac{1}{v}\left(\frac{\partial v}{\partial T}\right)_P
432  * \f]
433  * For ideal gases, it's equal to the inverse of the temperature.
434  */
435  virtual doublereal thermalExpansionCoeff() const {
436  return 1.0 / temperature();
437  }
438 
439  //@}
440 
441  /**
442  * @name Chemical Potentials and Activities
443  *
444  * The activity \f$a_k\f$ of a species in solution is
445  * related to the chemical potential by
446  * \f[
447  * \mu_k(T,P,X_k) = \mu_k^0(T,P)
448  * + \hat R T \log a_k.
449  * \f]
450  * The quantity \f$\mu_k^0(T,P)\f$ is the standard state chemical potential
451  * at unit activity. It may depend on the pressure and the temperature.
452  * However, it may not depend on the mole fractions of the species in the
453  * solution.
454  *
455  * The activities are related to the generalized concentrations, \f$\tilde
456  * C_k\f$, and standard concentrations, \f$C^0_k\f$, by the following
457  * formula:
458  *
459  * \f[
460  * a_k = \frac{\tilde C_k}{C^0_k}
461  * \f]
462  * The generalized concentrations are used in the kinetics classes to
463  * describe the rates of progress of reactions involving the species. Their
464  * formulation depends upon the specification of the rate constants for
465  * reaction, especially the units used in specifying the rate constants. The
466  * bridge between the thermodynamic equilibrium expressions that use a_k and
467  * the kinetics expressions which use the generalized concentrations is
468  * provided by the multiplicative factor of the standard concentrations.
469  * @{
470  */
471 
472  //! This method returns the array of generalized concentrations.
473  /*!
474  * For an ideal gas mixture, these are simply the actual concentrations.
475  *
476  * @param c Output array of generalized concentrations. The units depend
477  * upon the implementation of the reaction rate expressions within
478  * the phase.
479  */
480  virtual void getActivityConcentrations(doublereal* c) const {
482  }
483 
484  //! Returns the standard concentration \f$ C^0_k \f$, which is used to
485  //! normalize the generalized concentration.
486  /*!
487  * This is defined as the concentration by which the generalized
488  * concentration is normalized to produce the activity. In many cases, this
489  * quantity will be the same for all species in a phase. Since the activity
490  * for an ideal gas mixture is simply the mole fraction, for an ideal gas
491  * \f$ C^0_k = P/\hat R T \f$.
492  *
493  * @param k Optional parameter indicating the species. The default
494  * is to assume this refers to species 0.
495  * @return
496  * Returns the standard Concentration in units of m3 kmol-1.
497  */
498  virtual doublereal standardConcentration(size_t k = 0) const;
499 
500  //! Get the array of non-dimensional activity coefficients at the current
501  //! solution temperature, pressure, and solution concentration.
502  /*!
503  * For ideal gases, the activity coefficients are all equal to one.
504  *
505  * @param ac Output vector of activity coefficients. Length: m_kk.
506  */
507  virtual void getActivityCoefficients(doublereal* ac) const;
508 
509  //@}
510  /// @name Partial Molar Properties of the Solution
511  //@{
512 
513  virtual void getChemPotentials(doublereal* mu) const;
514  virtual void getPartialMolarEnthalpies(doublereal* hbar) const;
515  virtual void getPartialMolarEntropies(doublereal* sbar) const;
516  virtual void getPartialMolarIntEnergies(doublereal* ubar) const;
517  virtual void getPartialMolarCp(doublereal* cpbar) const;
518  virtual void getPartialMolarVolumes(doublereal* vbar) const;
519 
520  //@}
521  /// @name Properties of the Standard State of the Species in the Solution
522  //@{
523 
524  virtual void getStandardChemPotentials(doublereal* mu) const;
525  virtual void getEnthalpy_RT(doublereal* hrt) const;
526  virtual void getEntropy_R(doublereal* sr) const;
527  virtual void getGibbs_RT(doublereal* grt) const;
528  virtual void getPureGibbs(doublereal* gpure) const;
529  virtual void getIntEnergy_RT(doublereal* urt) const;
530  virtual void getCp_R(doublereal* cpr) const;
531  virtual void getStandardVolumes(doublereal* vol) const;
532 
533  //@}
534  /// @name Thermodynamic Values for the Species Reference States
535  //@{
536 
537  virtual void getEnthalpy_RT_ref(doublereal* hrt) const;
538  virtual void getGibbs_RT_ref(doublereal* grt) const;
539  virtual void getGibbs_ref(doublereal* g) const;
540  virtual void getEntropy_R_ref(doublereal* er) const;
541  virtual void getIntEnergy_RT_ref(doublereal* urt) const;
542  virtual void getCp_R_ref(doublereal* cprt) const;
543  virtual void getStandardVolumes_ref(doublereal* vol) const;
544 
545  //@}
546  /// @name NonVirtual Internal methods to Return References to Reference State Thermo
547  //@{
548 
549  //! Returns a reference to the dimensionless reference state enthalpy vector.
550  /*!
551  * This function is part of the layer that checks/recalculates the reference
552  * state thermo functions.
553  */
554  const vector_fp& enthalpy_RT_ref() const {
555  _updateThermo();
556  return m_h0_RT;
557  }
558 
559  //! Returns a reference to the dimensionless reference state Gibbs free energy vector.
560  /*!
561  * This function is part of the layer that checks/recalculates the reference
562  * state thermo functions.
563  */
564  const vector_fp& gibbs_RT_ref() const {
565  _updateThermo();
566  return m_g0_RT;
567  }
568 
569  //! Returns a reference to the dimensionless reference state Entropy vector.
570  /*!
571  * This function is part of the layer that checks/recalculates the reference
572  * state thermo functions.
573  */
574  const vector_fp& entropy_R_ref() const {
575  _updateThermo();
576  return m_s0_R;
577  }
578 
579  //! Returns a reference to the dimensionless reference state Heat Capacity vector.
580  /*!
581  * This function is part of the layer that checks/recalculates the reference
582  * state thermo functions.
583  */
584  const vector_fp& cp_R_ref() const {
585  _updateThermo();
586  return m_cp0_R;
587  }
588 
589  //@}
590 
591  virtual bool addSpecies(shared_ptr<Species> spec);
592  virtual void setToEquilState(const doublereal* lambda_RT);
593 
594 protected:
595  //! Reference state pressure
596  /*!
597  * Value of the reference state pressure in Pascals.
598  * All species must have the same reference state pressure.
599  */
600  doublereal m_p0;
601 
602  //! Temporary storage for dimensionless reference state enthalpies
604 
605  //! Temporary storage for dimensionless reference state heat capacities
607 
608  //! Temporary storage for dimensionless reference state Gibbs energies
610 
611  //! Temporary storage for dimensionless reference state entropies
612  mutable vector_fp m_s0_R;
613 
614  mutable vector_fp m_expg0_RT;
615 
616  //! Temporary array containing internally calculated partial pressures
617  mutable vector_fp m_pp;
618 
619 private:
620  //! Update the species reference state thermodynamic functions
621  /*!
622  * This method is called each time a thermodynamic property is requested,
623  * to check whether the internal species properties within the object
624  * need to be updated. Currently, this updates the species thermo
625  * polynomial values for the current value of the temperature. A check is
626  * made to see if the temperature has changed since the last evaluation.
627  * This object does not contain any persistent data that depends on the
628  * concentration, that needs to be updated. The state object modifies its
629  * concentration dependent information at the time the setMoleFractions()
630  * (or equivalent) call is made.
631  */
632  void _updateThermo() const;
633 };
634 }
635 
636 #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 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.
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:614
doublereal RT() const
Return the Gas Constant multiplied by the current temperature.
Definition: ThermoPhase.h:748
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:590
IdealGasPhase()
Default empty Constructor.
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
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: AnyMap.cpp:8
void getConcentrations(doublereal *const c) const
Get the species concentrations (kmol/m^3).
Definition: Phase.cpp:519
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...
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.