Cantera  2.4.0
LatticePhase.h
Go to the documentation of this file.
1 /**
2  * @file LatticePhase.h Header for a simple thermodynamics model of a bulk
3  * phase derived from ThermoPhase, assuming a lattice of solid atoms (see
4  * \ref thermoprops and class \link Cantera::LatticePhase
5  * LatticePhase\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_LATTICE_H
12 #define CT_LATTICE_H
13 
14 #include "ThermoPhase.h"
15 
16 namespace Cantera
17 {
18 
19 //! A simple thermodynamic model for a bulk phase, assuming a lattice of solid
20 //! atoms
21 /*!
22  * The bulk consists of a matrix of equivalent sites whose molar density does
23  * not vary with temperature or pressure. The thermodynamics obeys the ideal
24  * solution laws. The phase and the pure species phases which comprise the
25  * standard states of the species are assumed to have zero volume expansivity
26  * and zero isothermal compressibility.
27  *
28  * The density of matrix sites is given by the variable \f$ C_o \f$, which has
29  * SI units of kmol m-3.
30  *
31  * ## Specification of Species Standard State Properties
32  *
33  * It is assumed that the reference state thermodynamics may be obtained by a
34  * pointer to a populated species thermodynamic property manager class (see
35  * ThermoPhase::m_spthermo). However, how to relate pressure changes to the
36  * reference state thermodynamics is within this class.
37  *
38  * Pressure is defined as an independent variable in this phase. However, it has
39  * no effect on any quantities, as the molar concentration is a constant.
40  *
41  * The standard state enthalpy function is given by the following relation,
42  * which has a weak dependence on the system pressure, \f$P\f$.
43  *
44  * \f[
45  * h^o_k(T,P) =
46  * h^{ref}_k(T) + \left( \frac{P - P_{ref}}{C_o} \right)
47  * \f]
48  *
49  * For an incompressible substance, the molar internal energy is independent of
50  * pressure. Since the thermodynamic properties are specified by giving the
51  * standard-state enthalpy, the term \f$ \frac{P_{ref}}{C_o} \f$ is subtracted
52  * from the specified reference molar enthalpy to compute the standard state
53  * molar internal energy:
54  *
55  * \f[
56  * u^o_k(T,P) = h^{ref}_k(T) - \frac{P_{ref}}{C_o}
57  * \f]
58  *
59  * The standard state heat capacity, internal energy, and entropy are
60  * independent of pressure. The standard state Gibbs free energy is obtained
61  * from the enthalpy and entropy functions.
62  *
63  * The standard state molar volume is independent of temperature, pressure, and
64  * species identity:
65  *
66  * \f[
67  * V^o_k(T,P) = \frac{1.0}{C_o}
68  * \f]
69  *
70  * ## Specification of Solution Thermodynamic Properties
71  *
72  * The activity of species \f$ k \f$ defined in the phase, \f$ a_k \f$, is given
73  * by the ideal solution law:
74  *
75  * \f[
76  * a_k = X_k ,
77  * \f]
78  *
79  * where \f$ X_k \f$ is the mole fraction of species *k*. The chemical potential
80  * for species *k* is equal to
81  *
82  * \f[
83  * \mu_k(T,P) = \mu^o_k(T, P) + R T \log(X_k)
84  * \f]
85  *
86  * The partial molar entropy for species *k* is given by the following relation,
87  *
88  * \f[
89  * \tilde{s}_k(T,P) = s^o_k(T,P) - R \log(X_k) = s^{ref}_k(T) - R \log(X_k)
90  * \f]
91  *
92  * The partial molar enthalpy for species *k* is
93  *
94  * \f[
95  * \tilde{h}_k(T,P) = h^o_k(T,P) = h^{ref}_k(T) + \left( \frac{P - P_{ref}}{C_o} \right)
96  * \f]
97  *
98  * The partial molar Internal Energy for species *k* is
99  *
100  * \f[
101  * \tilde{u}_k(T,P) = u^o_k(T,P) = u^{ref}_k(T)
102  * \f]
103  *
104  * The partial molar Heat Capacity for species *k* is
105  *
106  * \f[
107  * \tilde{Cp}_k(T,P) = Cp^o_k(T,P) = Cp^{ref}_k(T)
108  * \f]
109  *
110  * The partial molar volume is independent of temperature, pressure, and species
111  * identity:
112  *
113  * \f[
114  * \tilde{V}_k(T,P) = V^o_k(T,P) = \frac{1.0}{C_o}
115  * \f]
116  *
117  * It is assumed that the reference state thermodynamics may be obtained by a
118  * pointer to a populated species thermodynamic property manager class (see
119  * ThermoPhase::m_spthermo). How to relate pressure changes to the reference
120  * state thermodynamics is resolved at this level.
121  *
122  * Pressure is defined as an independent variable in this phase. However, it
123  * only has a weak dependence on the enthalpy, and doesn't effect the molar
124  * concentration.
125  *
126  * ## %Application within Kinetics Managers
127  *
128  * \f$ C^a_k\f$ are defined such that \f$ C^a_k = a_k = X_k \f$. \f$ C^s_k \f$,
129  * the standard concentration, is defined to be equal to one. \f$ a_k \f$ are
130  * activities used in the thermodynamic functions. These activity (or
131  * generalized) concentrations are used by kinetics manager classes to compute
132  * the forward and reverse rates of elementary reactions. The activity
133  * concentration,\f$ C^a_k \f$, is given by the following expression.
134  *
135  * \f[
136  * C^a_k = C^s_k X_k = X_k
137  * \f]
138  *
139  * The standard concentration for species *k* is identically one
140  *
141  * \f[
142  * C^s_k = C^s = 1.0
143  * \f]
144  *
145  * For example, a bulk-phase binary gas reaction between species j and k,
146  * producing a new species l would have the following equation for its rate of
147  * progress variable, \f$ R^1 \f$, which has units of kmol m-3 s-1.
148  *
149  * \f[
150  * R^1 = k^1 C_j^a C_k^a = k^1 X_j X_k
151  * \f]
152  *
153  * The reverse rate constant can then be obtained from the law of microscopic
154  * reversibility and the equilibrium expression for the system.
155  *
156  * \f[
157  * \frac{X_j X_k}{ X_l} = K_a^{o,1} = \exp(\frac{\mu^o_l - \mu^o_j - \mu^o_k}{R T} )
158  * \f]
159  *
160  * \f$ K_a^{o,1} \f$ is the dimensionless form of the equilibrium constant,
161  * associated with the pressure dependent standard states \f$ \mu^o_l(T,P) \f$
162  * and their associated activities,
163  * \f$ a_l \f$, repeated here:
164  *
165  * \f[
166  * \mu_l(T,P) = \mu^o_l(T, P) + R T \log(a_l)
167  * \f]
168  *
169  * The concentration equilibrium constant, \f$ K_c \f$, may be obtained by
170  * changing over to activity concentrations. When this is done:
171  *
172  * \f[
173  * \frac{C^a_j C^a_k}{ C^a_l} = C^o K_a^{o,1} = K_c^1 =
174  * \exp(\frac{\mu^{o}_l - \mu^{o}_j - \mu^{o}_k}{R T} )
175  * \f]
176  *
177  * %Kinetics managers will calculate the concentration equilibrium constant, \f$
178  * K_c \f$, using the second and third part of the above expression as a
179  * definition for the concentration equilibrium constant.
180  *
181  * ## Instantiation of the Class
182  *
183  * The constructor for this phase is located in the default ThermoFactory for
184  * %Cantera. A new LatticePhase object may be created by the following code
185  * snippet:
186  *
187  * @code
188  * XML_Node *xc = get_XML_File("O_lattice_SiO2.xml");
189  * XML_Node * const xs = xc->findNameID("phase", "O_lattice_SiO2");
190  * ThermoPhase *tp = newPhase(*xs);
191  * LatticePhase *o_lattice = dynamic_cast <LatticPhase *>(tp);
192  * @endcode
193  *
194  * or by the following constructor:
195  *
196  * @code
197  * XML_Node *xc = get_XML_File("O_lattice_SiO2.xml");
198  * XML_Node * const xs = xc->findNameID("phase", "O_lattice_SiO2");
199  * LatticePhase *o_lattice = new LatticePhase(*xs);
200  * @endcode
201  *
202  * The XML file used in this example is listed in the next section
203  *
204  * ## XML Example
205  *
206  * An example of an XML Element named phase setting up a LatticePhase object
207  * named "O_lattice_SiO2" is given below.
208  *
209  * @code
210  * <!-- phase O_lattice_SiO2 -->
211  * <phase dim="3" id="O_lattice_SiO2">
212  * <elementArray datasrc="elements.xml"> Si H He </elementArray>
213  * <speciesArray datasrc="#species_data">
214  * O_O Vac_O
215  * </speciesArray>
216  * <reactionArray datasrc="#reaction_data"/>
217  * <thermo model="Lattice">
218  * <site_density> 73.159 </site_density>
219  * </thermo>
220  * <kinetics model="BulkKinetics"/>
221  * <transport model="None"/>
222  * </phase>
223  * @endcode
224  *
225  * The model attribute "Lattice" of the thermo XML element identifies the phase
226  * as being of the type handled by the LatticePhase object.
227  *
228  * @ingroup thermoprops
229  */
230 class LatticePhase : public ThermoPhase
231 {
232 public:
233  //! Base Empty constructor
234  LatticePhase();
235 
236  //! Full constructor for a lattice phase
237  /*!
238  * @param inputFile String name of the input file
239  * @param id string id of the phase name
240  */
241  LatticePhase(const std::string& inputFile, const std::string& id = "");
242 
243  //! Full constructor for a water phase
244  /*!
245  * @param phaseRef XML node referencing the lattice phase.
246  * @param id string id of the phase name
247  */
248  LatticePhase(XML_Node& phaseRef, const std::string& id = "");
249 
250  virtual std::string type() const {
251  return "Lattice";
252  }
253 
254  //! @name Molar Thermodynamic Properties of the Solution
255  //! @{
256 
257  //! Return the Molar Enthalpy. Units: J/kmol.
258  /*!
259  * For an ideal solution,
260  *
261  * \f[
262  * \hat h(T,P) = \sum_k X_k \hat h^0_k(T,P),
263  * \f]
264  *
265  * The standard-state pure-species Enthalpies \f$ \hat h^0_k(T,P) \f$ are
266  * computed first by the species reference state thermodynamic property
267  * manager and then a small pressure dependent term is added in.
268  *
269  * \see MultiSpeciesThermo
270  */
271  virtual doublereal enthalpy_mole() const;
272 
273  //! Molar entropy of the solution. Units: J/kmol/K
274  /*!
275  * For an ideal, constant partial molar volume solution mixture with
276  * pure species phases which exhibit zero volume expansivity:
277  * \f[
278  * \hat s(T, P, X_k) = \sum_k X_k \hat s^0_k(T) - \hat R \sum_k X_k log(X_k)
279  * \f]
280  * The reference-state pure-species entropies \f$ \hat s^0_k(T,p_{ref}) \f$
281  * are computed by the species thermodynamic property manager. The pure
282  * species entropies are independent of pressure since the volume
283  * expansivities are equal to zero.
284  *
285  * Units: J/kmol/K.
286  *
287  * @see MultiSpeciesThermo
288  */
289  virtual doublereal entropy_mole() const;
290 
291  //! Molar heat capacity at constant pressure of the solution.
292  //! Units: J/kmol/K.
293  /*!
294  * For an ideal, constant partial molar volume solution mixture with
295  * pure species phases which exhibit zero volume expansivity:
296  * \f[
297  * \hat c_p(T,P) = \sum_k X_k \hat c^0_{p,k}(T) .
298  * \f]
299  * The heat capacity is independent of pressure. The reference-state pure-
300  * species heat capacities \f$ \hat c^0_{p,k}(T) \f$ are computed by the
301  * species thermodynamic property manager.
302  *
303  * @see MultiSpeciesThermo
304  */
305  virtual doublereal cp_mole() const;
306 
307  //! Molar heat capacity at constant volume of the solution.
308  //! Units: J/kmol/K.
309  /*!
310  * For an ideal, constant partial molar volume solution mixture with
311  * pure species phases which exhibit zero volume expansivity:
312  * \f[
313  * \hat c_v(T,P) = \hat c_p(T,P)
314  * \f]
315  *
316  * The two heat capacities are equal.
317  */
318  virtual doublereal cv_mole() const;
319 
320  //@}
321  /// @name Mechanical Equation of State Properties
322  /**
323  * In this equation of state implementation, the density is a function only
324  * of the mole fractions. Therefore, it can't be an independent variable.
325  * Instead, the pressure is used as the independent variable. Functions
326  * which try to set the thermodynamic state by calling setDensity() may
327  * cause an exception to be thrown.
328  */
329  //@{
330 
331  //! Pressure. Units: Pa.
332  /*!
333  * For this incompressible system, we return the internally stored
334  * independent value of the pressure.
335  */
336  virtual doublereal pressure() const {
337  return m_Pcurrent;
338  }
339 
340  //! Set the internally stored pressure (Pa) at constant temperature and
341  //! composition
342  /*!
343  * This method sets the pressure within the object. The mass density is not
344  * a function of pressure.
345  *
346  * @param p Input Pressure (Pa)
347  */
348  virtual void setPressure(doublereal p);
349 
350  //! Calculate the density of the mixture using the partial molar volumes and
351  //! mole fractions as input
352  /*!
353  * The formula for this is
354  *
355  * \f[
356  * \rho = \frac{\sum_k{X_k W_k}}{\sum_k{X_k V_k}}
357  * \f]
358  *
359  * where \f$X_k\f$ are the mole fractions, \f$W_k\f$ are the molecular
360  * weights, and \f$V_k\f$ are the pure species molar volumes.
361  *
362  * Note, the basis behind this formula is that in an ideal solution the
363  * partial molar volumes are equal to the pure species molar volumes. We
364  * have additionally specified in this class that the pure species molar
365  * volumes are independent of temperature and pressure.
366  */
367  doublereal calcDensity();
368 
369  //@}
370  /// @name Activities, Standard States, and Activity Concentrations
371  /**
372  * The activity \f$a_k\f$ of a species in solution is related to the
373  * chemical potential by \f[ \mu_k = \mu_k^0(T) + \hat R T \log a_k. \f] The
374  * quantity \f$\mu_k^0(T,P)\f$ is the chemical potential at unit activity,
375  * which depends only on temperature and the pressure. Activity is assumed
376  * to be molality-based here.
377  */
378  //@{
379 
380  virtual void getActivityConcentrations(doublereal* c) const;
381 
382  //! Return the standard concentration for the kth species
383  /*!
384  * The standard concentration \f$ C^0_k \f$ used to normalize
385  * the activity (i.e., generalized) concentration for use
386  *
387  * For the time being, we will use the concentration of pure solvent for the
388  * the standard concentration of all species. This has the effect of making
389  * mass-action reaction rates based on the molality of species proportional
390  * to the molality of the species.
391  *
392  * @param k Optional parameter indicating the species. The default is to
393  * assume this refers to species 0.
394  * @returns the standard Concentration in units of m^3/kmol.
395  *
396  * @param k Species index
397  */
398  virtual doublereal standardConcentration(size_t k=0) const;
399  virtual doublereal logStandardConc(size_t k=0) const;
400 
401  //! Get the array of non-dimensional activity coefficients at
402  //! the current solution temperature, pressure, and solution concentration.
403  /*!
404  * For this phase, the activity coefficients are all equal to one.
405  *
406  * @param ac Output vector of activity coefficients. Length: m_kk.
407  */
408  virtual void getActivityCoefficients(doublereal* ac) const;
409 
410  //@}
411  /// @name Partial Molar Properties of the Solution
412  //@{
413 
414  //! Get the species chemical potentials. Units: J/kmol.
415  /*!
416  * This function returns a vector of chemical potentials of the species in
417  * solid solution at the current temperature, pressure and mole fraction of
418  * the solid solution.
419  *
420  * @param mu Output vector of species chemical
421  * potentials. Length: m_kk. Units: J/kmol
422  */
423  virtual void getChemPotentials(doublereal* mu) const;
424 
425  //@}
426  /// @name Partial Molar Properties of the Solution
427  //@{
428 
429  /**
430  * Returns an array of partial molar enthalpies for the species in the
431  * mixture. Units (J/kmol). For this phase, the partial molar enthalpies are
432  * equal to the pure species enthalpies
433  * \f[
434  * \bar h_k(T,P) = \hat h^{ref}_k(T) + (P - P_{ref}) \hat V^0_k
435  * \f]
436  * The reference-state pure-species enthalpies, \f$ \hat h^{ref}_k(T) \f$,
437  * at the reference pressure,\f$ P_{ref} \f$, are computed by the species
438  * thermodynamic property manager. They are polynomial functions of
439  * temperature.
440  * @see MultiSpeciesThermo
441  *
442  * @param hbar Output vector containing partial molar enthalpies.
443  * Length: m_kk.
444  */
445  virtual void getPartialMolarEnthalpies(doublereal* hbar) const;
446 
447  /**
448  * Returns an array of partial molar entropies of the species in the
449  * solution. Units: J/kmol/K. For this phase, the partial molar entropies
450  * are equal to the pure species entropies plus the ideal solution
451  * contribution.
452  * \f[
453  * \bar s_k(T,P) = \hat s^0_k(T) - R log(X_k)
454  * \f]
455  * The reference-state pure-species entropies,\f$ \hat s^{ref}_k(T) \f$, at
456  * the reference pressure, \f$ P_{ref} \f$, are computed by the species
457  * thermodynamic property manager. They are polynomial functions of
458  * temperature.
459  * @see MultiSpeciesThermo
460  *
461  * @param sbar Output vector containing partial molar entropies.
462  * Length: m_kk.
463  */
464  virtual void getPartialMolarEntropies(doublereal* sbar) const;
465 
466  /**
467  * Returns an array of partial molar Heat Capacities at constant pressure of
468  * the species in the solution. Units: J/kmol/K. For this phase, the partial
469  * molar heat capacities are equal to the standard state heat capacities.
470  *
471  * @param cpbar Output vector of partial heat capacities. Length: m_kk.
472  */
473  virtual void getPartialMolarCp(doublereal* cpbar) const;
474 
475  virtual void getPartialMolarVolumes(doublereal* vbar) const;
476  virtual void getStandardChemPotentials(doublereal* mu) const;
477  virtual void getPureGibbs(doublereal* gpure) const;
478 
479  //@}
480  /// @name Properties of the Standard State of the Species in the Solution
481  //@{
482 
483  //! Get the nondimensional Enthalpy functions for the species standard
484  //! states at their standard states at the current *T* and *P* of the
485  //! solution.
486  /*!
487  * A small pressure dependent term is added onto the reference state enthalpy
488  * to get the pressure dependence of this term.
489  *
490  * \f[
491  * h^o_k(T,P) = h^{ref}_k(T) + \left( \frac{P - P_{ref}}{C_o} \right)
492  * \f]
493  *
494  * The reference state thermodynamics is obtained by a pointer to a
495  * populated species thermodynamic property manager class (see
496  * ThermoPhase::m_spthermo). How to relate pressure changes to the reference
497  * state thermodynamics is resolved at this level.
498  *
499  * @param hrt Output vector of nondimensional standard state enthalpies.
500  * Length: m_kk.
501  */
502  virtual void getEnthalpy_RT(doublereal* hrt) const;
503 
504  //! Get the array of nondimensional Entropy functions for the species
505  //! standard states at the current *T* and *P* of the solution.
506  /*!
507  * The entropy of the standard state is defined as independent of
508  * pressure here.
509  *
510  * \f[
511  * s^o_k(T,P) = s^{ref}_k(T)
512  * \f]
513  *
514  * The reference state thermodynamics is obtained by a pointer to a
515  * populated species thermodynamic property manager class (see
516  * ThermoPhase::m_spthermo). How to relate pressure changes to the reference
517  * state thermodynamics is resolved at this level.
518  *
519  * @param sr Output vector of nondimensional standard state entropies.
520  * Length: m_kk.
521  */
522  virtual void getEntropy_R(doublereal* sr) const;
523 
524  //! Get the nondimensional Gibbs functions for the species standard states
525  //! at the current *T* and *P* of the solution.
526  /*!
527  * The standard Gibbs free energies are obtained from the enthalpy and
528  * entropy formulation.
529  *
530  * \f[
531  * g^o_k(T,P) = h^{o}_k(T,P) - T s^{o}_k(T,P)
532  * \f]
533  *
534  * @param grt Output vector of nondimensional standard state Gibbs free
535  * energies. Length: m_kk.
536  */
537  virtual void getGibbs_RT(doublereal* grt) const;
538 
539  //! Get the nondimensional Heat Capacities at constant pressure for the
540  //! species standard states at the current *T* and *P* of the solution
541  /*!
542  * The heat capacity of the standard state is independent of pressure
543  *
544  * \f[
545  * Cp^o_k(T,P) = Cp^{ref}_k(T)
546  * \f]
547  *
548  * The reference state thermodynamics is obtained by a pointer to a
549  * populated species thermodynamic property manager class (see
550  * ThermoPhase::m_spthermo). How to relate pressure changes to the reference
551  * state thermodynamics is resolved at this level.
552  *
553  * @param cpr Output vector of nondimensional standard state heat
554  * capacities. Length: m_kk.
555  */
556  virtual void getCp_R(doublereal* cpr) const;
557 
558  //! Get the molar volumes of the species standard states at the current
559  //! *T* and *P* of the solution.
560  /*!
561  * units = m^3 / kmol
562  *
563  * @param vol Output vector containing the standard state volumes.
564  * Length: m_kk.
565  */
566  virtual void getStandardVolumes(doublereal* vol) const;
567 
568  //@}
569  /// @name Thermodynamic Values for the Species Reference States
570  //@{
571 
572  const vector_fp& enthalpy_RT_ref() const;
573 
574  //! Returns a reference to the dimensionless reference state Gibbs free
575  //! energy vector.
576  /*!
577  * This function is part of the layer that checks/recalculates the reference
578  * state thermo functions.
579  */
580  const vector_fp& gibbs_RT_ref() const;
581 
582  virtual void getGibbs_RT_ref(doublereal* grt) const;
583  virtual void getGibbs_ref(doublereal* g) const;
584 
585  //! Returns a reference to the dimensionless reference state Entropy vector.
586  /*!
587  * This function is part of the layer that checks/recalculates the reference
588  * state thermo functions.
589  */
590  const vector_fp& entropy_R_ref() const;
591 
592  //! Returns a reference to the dimensionless reference state Heat Capacity
593  //! vector.
594  /*!
595  * This function is part of the layer that checks/recalculates the reference
596  * state thermo functions.
597  */
598  const vector_fp& cp_R_ref() const;
599 
600  //@}
601  /// @name Utilities for Initialization of the Object
602  //@{
603 
604  virtual bool addSpecies(shared_ptr<Species> spec);
605 
606  //! Set the density of lattice sites [kmol/m^3]
607  void setSiteDensity(double sitedens);
608 
609  //! Set the equation of state parameters from the argument list
610  /*!
611  * @deprecated To be removed after Cantera 2.4.
612  * @internal
613  * Set equation of state parameters.
614  *
615  * @param n number of parameters. Must be one
616  * @param c array of \a n coefficients
617  * c[0] = The bulk lattice density (kmol m-3)
618  */
619  virtual void setParameters(int n, doublereal* const c);
620 
621  //! Get the equation of state parameters in a vector
622  /*!
623  * @deprecated To be removed after Cantera 2.4.
624  * @internal
625  *
626  * @param n number of parameters
627  * @param c array of \a n coefficients
628  *
629  * For this phase:
630  * - n = 1
631  * - c[0] = molar density of phase [ kmol/m^3 ]
632  */
633  virtual void getParameters(int& n, doublereal* const c) const;
634 
635  //! Set equation of state parameter values from XML entries.
636  /*!
637  * This method is called by function importPhase() when processing a phase
638  * definition in an input file. It should be overloaded in subclasses to set
639  * any parameters that are specific to that particular phase
640  * model. Note, this method is called before the phase is
641  * initialized with elements and/or species.
642  *
643  * For this phase, the molar density of the phase is specified in this
644  * block, and is a required parameter.
645  *
646  * @param eosdata An XML_Node object corresponding to
647  * the "thermo" entry for this phase in the input file.
648  *
649  * eosdata points to the thermo block, and looks like this:
650  *
651  * @code
652  * <phase id="O_lattice_SiO2" >
653  * <thermo model="Lattice">
654  * <site_density units="kmol/m^3"> 73.159 </site_density>
655  * </thermo>
656  * </phase>
657  * @endcode
658  */
659  virtual void setParametersFromXML(const XML_Node& eosdata);
660  //@}
661 
662 protected:
663  virtual void compositionChanged();
664 
665  //! Reference state pressure
666  doublereal m_Pref;
667 
668  //! The current pressure
669  /*!
670  * Since the density isn't a function of pressure, but only of the mole
671  * fractions, we need to independently specify the pressure. The density
672  * variable which is inherited as part of the State class, m_dens, is always
673  * kept current whenever T, P, or X[] change.
674  */
675  doublereal m_Pcurrent;
676 
677  //! Reference state enthalpies / RT
679 
680  //! Temporary storage for the reference state heat capacities
682 
683  //! Temporary storage for the reference state Gibbs energies
685 
686  //! Temporary storage for the reference state entropies at the current
687  //! temperature
688  mutable vector_fp m_s0_R;
689 
690  //! Vector of molar volumes for each species in the solution
691  /**
692  * Species molar volumes \f$ m^3 kmol^-1 \f$
693  */
695 
696  //! Site Density of the lattice solid
697  /*!
698  * Currently, this is imposed as a function of T, P or composition
699  *
700  * units are kmol m-3
701  */
702  doublereal m_site_density;
703 
704 private:
705  //! Update the species reference state thermodynamic functions
706  /*!
707  * The polynomials for the standard state functions are only reevaluated if
708  * the temperature has changed.
709  */
710  void _updateThermo() const;
711 };
712 }
713 
714 #endif
const vector_fp & entropy_R_ref() const
Returns a reference to the dimensionless reference state Entropy vector.
virtual doublereal pressure() const
In this equation of state implementation, the density is a function only of the mole fractions...
Definition: LatticePhase.h:336
doublereal m_site_density
Site Density of the lattice solid.
Definition: LatticePhase.h:702
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the species standard states at the current T an...
doublereal m_Pref
Reference state pressure.
Definition: LatticePhase.h:666
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure of the solution.
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
doublereal calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input...
vector_fp m_g0_RT
Temporary storage for the reference state Gibbs energies.
Definition: LatticePhase.h:684
vector_fp m_s0_R
Temporary storage for the reference state entropies at the current temperature.
Definition: LatticePhase.h:688
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 logStandardConc(size_t k=0) const
Natural logarithm of the standard concentration of the kth species.
vector_fp m_h0_RT
Reference state enthalpies / RT.
Definition: LatticePhase.h:678
virtual void getParameters(int &n, doublereal *const c) const
Get the equation of state parameters in a vector.
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:97
virtual void getPureGibbs(doublereal *gpure) const
Get the Gibbs functions for the standard state of the species at the current T and P of the solution...
virtual void setParameters(int n, doublereal *const c)
Set the equation of state parameters from the argument list.
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 setPressure(doublereal p)
Set the internally stored pressure (Pa) at constant temperature and composition.
A simple thermodynamic model for a bulk phase, assuming a lattice of solid atoms. ...
Definition: LatticePhase.h:230
virtual doublereal cv_mole() const
Molar heat capacity at constant volume of the solution.
virtual void setParametersFromXML(const XML_Node &eosdata)
Set equation of state parameter values from XML entries.
const vector_fp & cp_R_ref() const
Returns a reference to the dimensionless reference state Heat Capacity vector.
virtual void getGibbs_ref(doublereal *g) const
Returns the vector of the Gibbs function of the reference state at the current temperature of the sol...
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:93
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
virtual doublereal enthalpy_mole() const
Return the Molar Enthalpy. Units: J/kmol.
void setSiteDensity(double sitedens)
Set the density of lattice sites [kmol/m^3].
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
virtual void getActivityCoefficients(doublereal *ac) const
Get the array of non-dimensional activity coefficients at the current solution temperature, pressure, and solution concentration.
doublereal m_Pcurrent
The current pressure.
Definition: LatticePhase.h:675
void _updateThermo() const
Update the species reference state thermodynamic functions.
vector_fp m_cp0_R
Temporary storage for the reference state heat capacities.
Definition: LatticePhase.h:681
virtual std::string type() const
String indicating the thermodynamic model implemented.
Definition: LatticePhase.h:250
virtual void getGibbs_RT(doublereal *grt) const
Get the nondimensional Gibbs functions for the species standard states at the current T and P of the ...
virtual void getActivityConcentrations(doublereal *c) const
The activity of a species in solution is related to the chemical potential by The quantity is the ...
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species standard states at their standard states at...
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 getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
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
vector_fp m_speciesMolarVolume
Vector of molar volumes for each species in the solution.
Definition: LatticePhase.h:694
virtual bool addSpecies(shared_ptr< Species > spec)
virtual doublereal entropy_mole() const
Molar entropy of the solution. Units: J/kmol/K.
const vector_fp & gibbs_RT_ref() const
Returns a reference to the dimensionless reference state Gibbs free energy vector.
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:8
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 getStandardChemPotentials(doublereal *mu) const
Get the array of chemical potentials at unit activity for the species at their standard states at the...
LatticePhase()
Base Empty constructor.
virtual void compositionChanged()
Apply changes to the state which are needed after the composition changes.
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.