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