Cantera  2.4.0
IdealSolidSolnPhase.h
Go to the documentation of this file.
1 /**
2  * @file IdealSolidSolnPhase.h Header file for an ideal solid solution model
3  * with incompressible thermodynamics (see \ref thermoprops and
4  * \link Cantera::IdealSolidSolnPhase IdealSolidSolnPhase\endlink).
5  *
6  * This class inherits from the Cantera class ThermoPhase and implements an
7  * ideal solid solution model with incompressible thermodynamics.
8  */
9 
10 // This file is part of Cantera. See License.txt in the top-level directory or
11 // at http://www.cantera.org/license.txt for license and copyright information.
12 
13 #ifndef CT_IDEALSOLIDSOLNPHASE_H
14 #define CT_IDEALSOLIDSOLNPHASE_H
15 
16 #include "ThermoPhase.h"
17 
18 namespace Cantera
19 {
20 
21 /**
22  * Class IdealSolidSolnPhase represents a condensed phase ideal solution
23  * compound. The phase and the pure species phases which comprise the standard
24  * states of the species are assumed to have zero volume expansivity and zero
25  * isothermal compressibility. Each species does, however, have constant but
26  * distinct partial molar volumes equal to their pure species molar volumes. The
27  * class derives from class ThermoPhase, and overloads the virtual methods
28  * defined there with ones that use expressions appropriate for ideal solution
29  * mixtures.
30  *
31  * The generalized concentrations can have three different forms depending on
32  * the value of the member attribute #m_formGC, which is supplied in the
33  * constructor and in the XML file. The value and form of the generalized
34  * concentration will affect reaction rate constants involving species in this
35  * phase.
36  *
37  * @ingroup thermoprops
38  */
40 {
41 public:
42  /**
43  * Constructor for IdealSolidSolnPhase.
44  * The generalized concentrations can have three different forms
45  * depending on the value of the member attribute #m_formGC, which
46  * is supplied in the constructor or read from the XML data file.
47  *
48  * @param formCG This parameter initializes the #m_formGC variable.
49  */
50  IdealSolidSolnPhase(int formCG=0);
51 
52  //! Construct and initialize an IdealSolidSolnPhase ThermoPhase object
53  //! directly from an ASCII input file
54  /*!
55  * This constructor will also fully initialize the object.
56  * The generalized concentrations can have three different forms
57  * depending on the value of the member attribute #m_formGC, which
58  * is supplied in the constructor or read from the XML data file.
59  *
60  * @param infile File name for the XML datafile containing information
61  * for this phase
62  * @param id The name of this phase. This is used to look up
63  * the phase in the XML datafile.
64  * @param formCG This parameter initializes the #m_formGC variable.
65  */
66  IdealSolidSolnPhase(const std::string& infile, const std::string& id="", int formCG=0);
67 
68  //! Construct and initialize an IdealSolidSolnPhase ThermoPhase object
69  //! directly from an XML database
70  /*!
71  * The generalized concentrations can have three different forms
72  * depending on the value of the member attribute #m_formGC, which
73  * is supplied in the constructor and/or read from the data file.
74  *
75  * @param root XML tree containing a description of the phase.
76  * The tree must be positioned at the XML element
77  * named phase with id, "id", on input to this routine.
78  * @param id The name of this phase. This is used to look up
79  * the phase in the XML datafile.
80  * @param formCG This parameter initializes the #m_formGC variable.
81  */
82  IdealSolidSolnPhase(XML_Node& root, const std::string& id="", int formCG=0);
83 
84  virtual std::string type() const {
85  return "IdealSolidSoln";
86  }
87 
88  //! @name Molar Thermodynamic Properties of the Solution
89  //! @{
90 
91  /**
92  * Molar enthalpy of the solution. Units: J/kmol. For an ideal, constant
93  * partial molar volume solution mixture with pure species phases which
94  * exhibit zero volume expansivity and zero isothermal compressibility:
95  * \f[
96  * \hat h(T,P) = \sum_k X_k \hat h^0_k(T) + (P - P_{ref}) (\sum_k X_k \hat V^0_k)
97  * \f]
98  * The reference-state pure-species enthalpies at the reference pressure Pref
99  * \f$ \hat h^0_k(T) \f$, are computed by the species thermodynamic
100  * property manager. They are polynomial functions of temperature.
101  * @see MultiSpeciesThermo
102  */
103  virtual doublereal enthalpy_mole() const;
104 
105  /**
106  * Molar entropy of the solution. Units: J/kmol/K. For an ideal, constant
107  * partial molar volume solution mixture with pure species phases which
108  * exhibit zero volume expansivity:
109  * \f[
110  * \hat s(T, P, X_k) = \sum_k X_k \hat s^0_k(T) - \hat R \sum_k X_k log(X_k)
111  * \f]
112  * The reference-state pure-species entropies
113  * \f$ \hat s^0_k(T,p_{ref}) \f$ are computed by the species thermodynamic
114  * property manager. The pure species entropies are independent of
115  * pressure since the volume expansivities are equal to zero.
116  * @see MultiSpeciesThermo
117  */
118  virtual doublereal entropy_mole() const;
119 
120  /**
121  * Molar Gibbs free energy of the solution. Units: J/kmol. For an ideal,
122  * constant partial molar volume solution mixture with pure species phases
123  * which exhibit zero volume expansivity:
124  * \f[
125  * \hat g(T, P) = \sum_k X_k \hat g^0_k(T,P) + \hat R T \sum_k X_k log(X_k)
126  * \f]
127  * The reference-state pure-species Gibbs free energies
128  * \f$ \hat g^0_k(T) \f$ are computed by the species thermodynamic
129  * property manager, while the standard state Gibbs free energies
130  * \f$ \hat g^0_k(T,P) \f$ are computed by the member function, gibbs_RT().
131  * @see MultiSpeciesThermo
132  */
133  virtual doublereal gibbs_mole() const;
134 
135  /**
136  * Molar heat capacity at constant pressure of the solution.
137  * Units: J/kmol/K.
138  * For an ideal, constant partial molar volume solution mixture with
139  * pure species phases which exhibit zero volume expansivity:
140  * \f[
141  * \hat c_p(T,P) = \sum_k X_k \hat c^0_{p,k}(T) .
142  * \f]
143  * The heat capacity is independent of pressure. The reference-state pure-
144  * species heat capacities \f$ \hat c^0_{p,k}(T) \f$ are computed by the
145  * species thermodynamic property manager.
146  * @see MultiSpeciesThermo
147  */
148  virtual doublereal cp_mole() const;
149 
150  /**
151  * Molar heat capacity at constant volume of the solution. Units: J/kmol/K.
152  * For an ideal, constant partial molar volume solution mixture with pure
153  * species phases which exhibit zero volume expansivity:
154  * \f[ \hat c_v(T,P) = \hat c_p(T,P) \f]
155  * The two heat capacities are equal.
156  */
157  virtual doublereal cv_mole() const {
158  return cp_mole();
159  }
160 
161  //@}
162  /** @name Mechanical Equation of State Properties
163  *
164  * In this equation of state implementation, the density is a function only
165  * of the mole fractions. Therefore, it can't be an independent variable.
166  * Instead, the pressure is used as the independent variable. Functions
167  * which try to set the thermodynamic state by calling setDensity() may
168  * cause an exception to be thrown.
169  */
170  //@{
171 
172  /**
173  * Pressure. Units: Pa. For this incompressible system, we return the
174  * internally stored independent value of the pressure.
175  */
176  virtual doublereal pressure() const {
177  return m_Pcurrent;
178  }
179 
180  /**
181  * Set the pressure at constant temperature. Units: Pa. This method sets a
182  * constant within the object. The mass density is not a function of
183  * pressure.
184  *
185  * @param p Input Pressure (Pa)
186  */
187  virtual void setPressure(doublereal p);
188 
189  /**
190  * Calculate the density of the mixture using the partial molar volumes and
191  * mole fractions as input
192  *
193  * The formula for this is
194  *
195  * \f[
196  * \rho = \frac{\sum_k{X_k W_k}}{\sum_k{X_k V_k}}
197  * \f]
198  *
199  * where \f$X_k\f$ are the mole fractions, \f$W_k\f$ are the molecular
200  * weights, and \f$V_k\f$ are the pure species molar volumes.
201  *
202  * Note, the basis behind this formula is that in an ideal solution the
203  * partial molar volumes are equal to the pure species molar volumes. We
204  * have additionally specified in this class that the pure species molar
205  * volumes are independent of temperature and pressure.
206  */
207  void calcDensity();
208 
209  /**
210  * Overridden setDensity() function is necessary because the density is not
211  * an independent variable.
212  *
213  * This function will now throw an error condition
214  *
215  * @internal May have to adjust the strategy here to make the eos for these
216  * materials slightly compressible, in order to create a condition where
217  * the density is a function of the pressure.
218  *
219  * @param rho Input density
220  */
221  virtual void setDensity(const doublereal rho);
222 
223  /**
224  * Overridden setMolarDensity() function is necessary because the density
225  * is not an independent variable.
226  *
227  * This function will now throw an error condition.
228  *
229  * @param rho Input Density
230  */
231  virtual void setMolarDensity(const doublereal rho);
232 
233  //@}
234 
235  /**
236  * @name Chemical Potentials and Activities
237  *
238  * The activity \f$a_k\f$ of a species in solution is related to the
239  * chemical potential by
240  * \f[
241  * \mu_k(T,P,X_k) = \mu_k^0(T,P)
242  * + \hat R T \log a_k.
243  * \f]
244  * The quantity \f$\mu_k^0(T,P)\f$ is the standard state chemical potential
245  * at unit activity. It may depend on the pressure and the temperature.
246  * However, it may not depend on the mole fractions of the species in the
247  * solid solution.
248  *
249  * The activities are related to the generalized concentrations, \f$\tilde
250  * C_k\f$, and standard concentrations, \f$C^0_k\f$, by the following
251  * formula:
252  *
253  * \f[
254  * a_k = \frac{\tilde C_k}{C^0_k}
255  * \f]
256  * The generalized concentrations are used in the kinetics classes to
257  * describe the rates of progress of reactions involving the species. Their
258  * formulation depends upon the specification of the rate constants for
259  * reaction, especially the units used in specifying the rate constants. The
260  * bridge between the thermodynamic equilibrium expressions that use a_k and
261  * the kinetics expressions which use the generalized concentrations is
262  * provided by the multiplicative factor of the standard concentrations.
263  * @{
264  */
265 
266  /**
267  * This method returns the array of generalized concentrations. The
268  * generalized concentrations are used in the evaluation of the rates of
269  * progress for reactions involving species in this phase. The generalized
270  * concentration divided by the standard concentration is also equal to the
271  * activity of species.
272  *
273  * For this implementation the activity is defined to be the mole fraction
274  * of the species. The generalized concentration is defined to be equal to
275  * the mole fraction divided by the partial molar volume. The generalized
276  * concentrations for species in this phase therefore have units of
277  * kmol/m^3. Rate constants must reflect this fact.
278  *
279  * On a general note, the following must be true. For an ideal solution, the
280  * generalized concentration must consist of the mole fraction multiplied by
281  * a constant. The constant may be fairly arbitrarily chosen, with
282  * differences adsorbed into the reaction rate expression. 1/V_N, 1/V_k, or
283  * 1 are equally good, as long as the standard concentration is adjusted
284  * accordingly. However, it must be a constant (and not the concentration,
285  * btw, which is a function of the mole fractions) in order for the ideal
286  * solution properties to hold at the same time having the standard
287  * concentration to be independent of the mole fractions.
288  *
289  * In this implementation the form of the generalized concentrations
290  * depend upon the member attribute, #m_formGC.
291  *
292  * HKM Note: We have absorbed the pressure dependence of the pure species
293  * state into the thermodynamics functions. Therefore the standard
294  * state on which the activities are based depend on both temperature
295  * and pressure. If we hadn't, it would have appeared in this
296  * function in a very awkward exp[] format.
297  *
298  * @param c Pointer to array of doubles of length m_kk, which on exit
299  * will contain the generalized concentrations.
300  */
301  virtual void getActivityConcentrations(doublereal* c) const;
302 
303  /**
304  * The standard concentration \f$ C^0_k \f$ used to normalize the
305  * generalized concentration. In many cases, this quantity will be the
306  * same for all species in a phase. However, for this case, we will return
307  * a distinct concentration for each species. This is the inverse of the
308  * species molar volume. Units for the standard concentration are kmol/m^3.
309  *
310  * @param k Species number: this is a require parameter, a change from the
311  * ThermoPhase base class, where it was an optional parameter.
312  */
313  virtual doublereal standardConcentration(size_t k) const;
314 
315  //! Get the array of species activity coefficients
316  /*!
317  * @param ac output vector of activity coefficients. Length: m_kk
318  */
319  virtual void getActivityCoefficients(doublereal* ac) const;
320 
321  /**
322  * Get the species chemical potentials. Units: J/kmol.
323  *
324  * This function returns a vector of chemical potentials of the
325  * species in solution.
326  * \f[
327  * \mu_k = \mu^{ref}_k(T) + V_k * (p - p_o) + R T ln(X_k)
328  * \f]
329  * or another way to phrase this is
330  * \f[
331  * \mu_k = \mu^o_k(T,p) + R T ln(X_k)
332  * \f]
333  * where \f$ \mu^o_k(T,p) = \mu^{ref}_k(T) + V_k * (p - p_o)\f$
334  *
335  * @param mu Output vector of chemical potentials.
336  */
337  virtual void getChemPotentials(doublereal* mu) const;
338 
339  /**
340  * Get the array of non-dimensional species solution
341  * chemical potentials at the current T and P
342  * \f$\mu_k / \hat R T \f$.
343  * \f[
344  * \mu^0_k(T,P) = \mu^{ref}_k(T) + (P - P_{ref}) * V_k + RT ln(X_k)
345  * \f]
346  * where \f$V_k\f$ is the molar volume of pure species *k*.
347  * \f$ \mu^{ref}_k(T)\f$ is the chemical potential of pure
348  * species *k* at the reference pressure, \f$P_{ref}\f$.
349  *
350  * @param mu Output vector of dimensionless chemical potentials.
351  * Length = m_kk.
352  */
353  virtual void getChemPotentials_RT(doublereal* mu) const;
354 
355  //@}
356  /// @name Partial Molar Properties of the Solution
357  //@{
358 
359  //! Returns an array of partial molar enthalpies for the species in the
360  //! mixture.
361  /*!
362  * Units (J/kmol). For this phase, the partial molar enthalpies are equal to
363  * the pure species enthalpies
364  * \f[
365  * \bar h_k(T,P) = \hat h^{ref}_k(T) + (P - P_{ref}) \hat V^0_k
366  * \f]
367  * The reference-state pure-species enthalpies, \f$ \hat h^{ref}_k(T) \f$,
368  * at the reference pressure,\f$ P_{ref} \f$, are computed by the species
369  * thermodynamic property manager. They are polynomial functions of
370  * temperature.
371  * @see MultiSpeciesThermo
372  *
373  * @param hbar Output vector containing partial molar enthalpies.
374  * Length: m_kk.
375  */
376  virtual void getPartialMolarEnthalpies(doublereal* hbar) const;
377 
378  /**
379  * Returns an array of partial molar entropies of the species in the
380  * solution. Units: J/kmol/K. For this phase, the partial molar entropies
381  * are equal to the pure species entropies plus the ideal solution
382  * contribution.
383  * \f[
384  * \bar s_k(T,P) = \hat s^0_k(T) - R log(X_k)
385  * \f]
386  * The reference-state pure-species entropies,\f$ \hat s^{ref}_k(T) \f$, at
387  * the reference pressure, \f$ P_{ref} \f$, are computed by the species
388  * thermodynamic property manager. They are polynomial functions of
389  * temperature.
390  * @see MultiSpeciesThermo
391  *
392  * @param sbar Output vector containing partial molar entropies.
393  * Length: m_kk.
394  */
395  virtual void getPartialMolarEntropies(doublereal* sbar) const;
396 
397  /**
398  * Returns an array of partial molar Heat Capacities at constant pressure of
399  * the species in the solution. Units: J/kmol/K. For this phase, the partial
400  * molar heat capacities are equal to the standard state heat capacities.
401  *
402  * @param cpbar Output vector of partial heat capacities. Length: m_kk.
403  */
404  virtual void getPartialMolarCp(doublereal* cpbar) const;
405 
406  /**
407  * returns an array of partial molar volumes of the species
408  * in the solution. Units: m^3 kmol-1.
409  *
410  * For this solution, the partial molar volumes are equal to the
411  * constant species molar volumes.
412  *
413  * @param vbar Output vector of partial molar volumes. Length: m_kk.
414  */
415  virtual void getPartialMolarVolumes(doublereal* vbar) const;
416 
417  //@}
418  /// @name Properties of the Standard State of the Species in the Solution
419  //@{
420 
421  /**
422  * Get the standard state chemical potentials of the species. This is the
423  * array of chemical potentials at unit activity \f$ \mu^0_k(T,P) \f$. We
424  * define these here as the chemical potentials of the pure species at the
425  * temperature and pressure of the solution. This function is used in the
426  * evaluation of the equilibrium constant Kc. Therefore, Kc will also depend
427  * on T and P. This is the norm for liquid and solid systems.
428  *
429  * units = J / kmol
430  *
431  * @param mu0 Output vector of standard state chemical potentials.
432  * Length: m_kk.
433  */
434  virtual void getStandardChemPotentials(doublereal* mu0) const {
435  getPureGibbs(mu0);
436  }
437 
438  //! Get the array of nondimensional Enthalpy functions for the standard
439  //! state species at the current *T* and *P* of the solution.
440  /*!
441  * We assume an incompressible constant partial molar volume here:
442  * \f[
443  * h^0_k(T,P) = h^{ref}_k(T) + (P - P_{ref}) * V_k
444  * \f]
445  * where \f$V_k\f$ is the molar volume of pure species *k*.
446  * \f$ h^{ref}_k(T)\f$ is the enthalpy of the pure species *k* at the
447  * reference pressure, \f$P_{ref}\f$.
448  *
449  * @param hrt Vector of length m_kk, which on return hrt[k] will contain the
450  * nondimensional standard state enthalpy of species k.
451  */
452  virtual void getEnthalpy_RT(doublereal* hrt) const;
453 
454  //! Get the nondimensional Entropies for the species standard states at the
455  //! current T and P of the solution.
456  /*!
457  * Note, this is equal to the reference state entropies due to the zero
458  * volume expansivity: i.e., (dS/dP)_T = (dV/dT)_P = 0.0
459  *
460  * @param sr Vector of length m_kk, which on return sr[k] will contain the
461  * nondimensional standard state entropy for species k.
462  */
463  virtual void getEntropy_R(doublereal* sr) const;
464 
465  /**
466  * Get the nondimensional Gibbs function for the species standard states at
467  * the current T and P of the solution.
468  *
469  * \f[
470  * \mu^0_k(T,P) = \mu^{ref}_k(T) + (P - P_{ref}) * V_k
471  * \f]
472  * where \f$V_k\f$ is the molar volume of pure species *k*.
473  * \f$ \mu^{ref}_k(T)\f$ is the chemical potential of pure species *k*
474  * at the reference pressure, \f$P_{ref}\f$.
475  *
476  * @param grt Vector of length m_kk, which on return sr[k] will contain the
477  * nondimensional standard state Gibbs function for species k.
478  */
479  virtual void getGibbs_RT(doublereal* grt) const;
480 
481  /**
482  * Get the Gibbs functions for the pure species at the current *T* and *P*
483  * of the solution. We assume an incompressible constant partial molar
484  * volume here:
485  * \f[
486  * \mu^0_k(T,P) = \mu^{ref}_k(T) + (P - P_{ref}) * V_k
487  * \f]
488  * where \f$V_k\f$ is the molar volume of pure species *k*.
489  * \f$ \mu^{ref}_k(T)\f$ is the chemical potential of pure species *k* at
490  * the reference pressure, \f$P_{ref}\f$.
491  *
492  * @param gpure Output vector of Gibbs functions for species. Length: m_kk.
493  */
494  virtual void getPureGibbs(doublereal* gpure) const;
495 
496  virtual void getIntEnergy_RT(doublereal* urt) const;
497 
498  /**
499  * Get the nondimensional heat capacity at constant pressure function for
500  * the species standard states at the current T and P of the solution.
501  * \f[
502  * Cp^0_k(T,P) = Cp^{ref}_k(T)
503  * \f]
504  * where \f$V_k\f$ is the molar volume of pure species *k*.
505  * \f$ Cp^{ref}_k(T)\f$ is the constant pressure heat capacity of species
506  * *k* at the reference pressure, \f$p_{ref}\f$.
507  *
508  * @param cpr Vector of length m_kk, which on return cpr[k] will contain the
509  * nondimensional constant pressure heat capacity for species k.
510  */
511  virtual void getCp_R(doublereal* cpr) const;
512 
513  virtual void getStandardVolumes(doublereal* vol) const;
514 
515  //@}
516  /// @name Thermodynamic Values for the Species Reference States
517  //@{
518 
519  virtual void getEnthalpy_RT_ref(doublereal* hrt) const;
520  virtual void getGibbs_RT_ref(doublereal* grt) const;
521  virtual void getGibbs_ref(doublereal* g) const;
522  virtual void getEntropy_R_ref(doublereal* er) const;
523  virtual void getIntEnergy_RT_ref(doublereal* urt) const;
524  virtual void getCp_R_ref(doublereal* cprt) const;
525 
526  /**
527  * Returns a reference to the vector of nondimensional enthalpies of the
528  * reference state at the current temperature. Real reason for its existence
529  * is that it also checks to see if a recalculation of the reference
530  * thermodynamics functions needs to be done.
531  */
532  const vector_fp& enthalpy_RT_ref() const;
533 
534  /**
535  * Returns a reference to the vector of nondimensional enthalpies of the
536  * reference state at the current temperature. Real reason for its existence
537  * is that it also checks to see if a recalculation of the reference
538  * thermodynamics functions needs to be done.
539  */
540  const vector_fp& gibbs_RT_ref() const {
541  _updateThermo();
542  return m_g0_RT;
543  }
544 
545  /**
546  * Returns a reference to the vector of nondimensional enthalpies of the
547  * reference state at the current temperature. Real reason for its existence
548  * is that it also checks to see if a recalculation of the reference
549  * thermodynamics functions needs to be done.
550  */
551  const vector_fp& entropy_R_ref() const;
552 
553  /**
554  * Returns a reference to the vector of nondimensional enthalpies of the
555  * reference state at the current temperature. Real reason for its existence
556  * is that it also checks to see if a recalculation of the reference
557  * thermodynamics functions needs to be done.
558  */
559  const vector_fp& cp_R_ref() const {
560  _updateThermo();
561  return m_cp0_R;
562  }
563 
564  virtual void setPotentialEnergy(int k, doublereal pe) {
565  m_pe[k] = pe;
566  _updateThermo();
567  }
568 
569  virtual doublereal potentialEnergy(int k) const {
570  return m_pe[k];
571  }
572 
573  //@}
574  /// @name Utility Functions
575  //@{
576 
577  virtual bool addSpecies(shared_ptr<Species> spec);
578  virtual void initThermoXML(XML_Node& phaseNode, const std::string& id);
579  virtual void setToEquilState(const doublereal* lambda_RT);
580 
581  //! Set the form for the standard and generalized concentrations
582  /*!
583  * Must be one of 'unity', 'molar_volume', or 'solvent_volume'.
584  * The default is 'unity'.
585  *
586  * | m_formGC | GeneralizedConc | StandardConc |
587  * | ----------- | --------------- | ------------ |
588  * | unity | X_k | 1.0 |
589  * | molar_volume | X_k / V_k | 1.0 / V_k |
590  * | solvent_volume | X_k / V_N | 1.0 / V_N |
591  *
592  * The value and form of the generalized concentration will affect
593  * reaction rate constants involving species in this phase.
594  */
595  void setStandardConcentrationModel(const std::string& model);
596 
597  /**
598  * Report the molar volume of species k
599  *
600  * units - \f$ m^3 kmol^-1 \f$
601  *
602  * @param k species index
603  */
604  double speciesMolarVolume(int k) const;
605 
606  /**
607  * Fill in a return vector containing the species molar volumes.
608  *
609  * units - \f$ m^3 kmol^-1 \f$
610  *
611  * @param smv output vector containing species molar volumes.
612  * Length: m_kk.
613  */
614  void getSpeciesMolarVolumes(doublereal* smv) const;
615 
616  //@}
617 
618 protected:
619  virtual void compositionChanged();
620 
621  /**
622  * The standard concentrations can have one of three different forms:
623  * 0 = 'unity', 1 = 'molar_volume', 2 = 'solvent_volume'. See
624  * setStandardConcentrationModel().
625  */
626  int m_formGC;
627 
628  /**
629  * Value of the reference pressure for all species in this phase. The T
630  * dependent polynomials are evaluated at the reference pressure. Note,
631  * because this is a single value, all species are required to have the same
632  * reference pressure.
633  */
634  doublereal m_Pref;
635 
636  /**
637  * m_Pcurrent = The current pressure
638  * Since the density isn't a function of pressure, but only of the
639  * mole fractions, we need to independently specify the pressure.
640  * The density variable which is inherited as part of the State class,
641  * m_dens, is always kept current whenever T, P, or X[] change.
642  */
643  doublereal m_Pcurrent;
644 
645  //! Vector of molar volumes for each species in the solution
646  /**
647  * Species molar volumes \f$ m^3 kmol^-1 \f$
648  */
650 
651  //! Vector containing the species reference enthalpies at T = m_tlast
653 
654  //! Vector containing the species reference constant pressure heat
655  //! capacities at T = m_tlast
657 
658  //! Vector containing the species reference Gibbs functions at T = m_tlast
660 
661  //! Vector containing the species reference entropies at T = m_tlast
662  mutable vector_fp m_s0_R;
663 
664  //! Vector containing the species reference exp(-G/RT) functions at
665  //! T = m_tlast
667 
668  //! Vector of potential energies for the species.
669  mutable vector_fp m_pe;
670 
671  //! Temporary array used in equilibrium calculations
672  mutable vector_fp m_pp;
673 
674 private:
675  /// @name Utility Functions
676  //@{
677  /**
678  * This function gets called for every call to functions in this class. It
679  * checks to see whether the temperature has changed and thus the reference
680  * thermodynamics functions for all of the species must be recalculated. If
681  * the temperature has changed, the species thermo manager is called to
682  * recalculate G, Cp, H, and S at the current temperature.
683  */
684  void _updateThermo() const;
685 
686  //@}
687 };
688 }
689 
690 #endif
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 initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure of the solution.
vector_fp m_pp
Temporary array used in equilibrium calculations.
virtual void getPartialMolarVolumes(doublereal *vbar) const
returns an array of partial molar volumes of the species in the solution.
virtual void getIntEnergy_RT(doublereal *urt) const
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
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 getChemPotentials(doublereal *mu) const
Get the species chemical potentials.
void calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input...
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:97
const vector_fp & gibbs_RT_ref() const
Returns a reference to the vector of nondimensional enthalpies of the reference state at the current ...
virtual void setPressure(doublereal p)
Set the pressure at constant temperature.
virtual doublereal cv_mole() const
Molar heat capacity at constant volume of the solution.
vector_fp m_speciesMolarVolume
Vector of molar volumes for each species in the solution.
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:93
virtual void getGibbs_RT(doublereal *grt) const
Get the nondimensional Gibbs function for the species standard states at the current T and P of the s...
double speciesMolarVolume(int k) const
Report the molar volume of species k.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
int m_formGC
The standard concentrations can have one of three different forms: 0 = &#39;unity&#39;, 1 = &#39;molar_volume&#39;...
doublereal m_Pcurrent
m_Pcurrent = The current pressure Since the density isn&#39;t a function of pressure, but only of the mol...
const vector_fp & cp_R_ref() const
Returns a reference to the vector of nondimensional enthalpies of the reference state at the current ...
virtual void getActivityCoefficients(doublereal *ac) const
Get the array of species activity coefficients.
virtual doublereal gibbs_mole() const
Molar Gibbs free energy of the solution.
doublereal m_Pref
Value of the reference pressure for all species in this phase.
virtual void getStandardChemPotentials(doublereal *mu0) const
Get the standard state chemical potentials of the species.
virtual doublereal standardConcentration(size_t k) const
The standard concentration used to normalize the generalized concentration.
virtual void getActivityConcentrations(doublereal *c) const
This method returns the array of generalized concentrations.
virtual void compositionChanged()
Apply changes to the state which are needed after the composition changes.
virtual void getIntEnergy_RT_ref(doublereal *urt) const
Returns the vector of nondimensional internal Energies of the reference state at the current temperat...
vector_fp m_expg0_RT
Vector containing the species reference exp(-G/RT) functions at T = m_tlast.
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
const vector_fp & enthalpy_RT_ref() const
Returns a reference to the vector of nondimensional enthalpies of the reference state at the current ...
virtual void getEntropy_R(doublereal *sr) const
Get the nondimensional Entropies for the species standard states at the current T and P of the soluti...
virtual void setToEquilState(const doublereal *lambda_RT)
This method is used by the ChemEquil equilibrium solver.
virtual bool addSpecies(shared_ptr< Species > spec)
virtual void getEnthalpy_RT_ref(doublereal *hrt) const
Returns the vector of nondimensional enthalpies of the reference state at the current temperature of ...
virtual void getGibbs_RT_ref(doublereal *grt) const
Returns the vector of nondimensional Gibbs Free Energies of the reference state at the current temper...
vector_fp m_cp0_R
Vector containing the species reference constant pressure heat capacities at T = m_tlast.
virtual void setMolarDensity(const doublereal rho)
Overridden setMolarDensity() function is necessary because the density is not an independent variable...
virtual std::string type() const
String indicating the thermodynamic model implemented.
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 void getChemPotentials_RT(doublereal *mu) const
Get the array of non-dimensional species solution chemical potentials at the current T and P ...
Class IdealSolidSolnPhase represents a condensed phase ideal solution compound.
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
const vector_fp & entropy_R_ref() const
Returns a reference to the vector of nondimensional enthalpies of the reference state at the current ...
void _updateThermo() const
This function gets called for every call to functions in this class.
virtual void setDensity(const doublereal rho)
Overridden setDensity() function is necessary because the density is not an independent variable...
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...
vector_fp m_h0_RT
Vector containing the species reference enthalpies at T = m_tlast.
virtual void getPureGibbs(doublereal *gpure) const
Get the Gibbs functions for the pure species at the current T and P of the solution.
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional heat capacity at constant pressure function for the species standard states at...
vector_fp m_pe
Vector of potential energies for the species.
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:8
void getSpeciesMolarVolumes(doublereal *smv) const
Fill in a return vector containing the species molar volumes.
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 doublereal pressure() const
Pressure.
virtual void getPartialMolarCp(doublereal *cpbar) const
Returns an array of partial molar Heat Capacities at constant pressure of the species in the solution...
virtual doublereal enthalpy_mole() const
Molar enthalpy of the solution.
void setStandardConcentrationModel(const std::string &model)
Set the form for the standard and generalized concentrations.
IdealSolidSolnPhase(int formCG=0)
Constructor for IdealSolidSolnPhase.
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the array of nondimensional Enthalpy functions for the standard state species at the current T an...
virtual doublereal entropy_mole() const
Molar entropy of the solution.
vector_fp m_s0_R
Vector containing the species reference entropies at T = m_tlast.
vector_fp m_g0_RT
Vector containing the species reference Gibbs functions at T = m_tlast.