Cantera  2.5.1
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 https://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  * @deprecated The XML input format is deprecated and will be removed in
249  * Cantera 3.0.
250  */
251  LatticePhase(XML_Node& phaseRef, const std::string& id = "");
252 
253  virtual std::string type() const {
254  return "Lattice";
255  }
256 
257  virtual bool isCompressible() const {
258  return false;
259  }
260 
261  std::map<std::string, size_t> nativeState() const {
262  return { {"T", 0}, {"P", 1}, {"X", 2} };
263  }
264 
265  //! @name Molar Thermodynamic Properties of the Solution
266  //! @{
267 
268  //! Return the Molar Enthalpy. Units: J/kmol.
269  /*!
270  * For an ideal solution,
271  *
272  * \f[
273  * \hat h(T,P) = \sum_k X_k \hat h^0_k(T,P),
274  * \f]
275  *
276  * The standard-state pure-species Enthalpies \f$ \hat h^0_k(T,P) \f$ are
277  * computed first by the species reference state thermodynamic property
278  * manager and then a small pressure dependent term is added in.
279  *
280  * \see MultiSpeciesThermo
281  */
282  virtual doublereal enthalpy_mole() const;
283 
284  //! Molar entropy of the solution. Units: J/kmol/K
285  /*!
286  * For an ideal, constant partial molar volume solution mixture with
287  * pure species phases which exhibit zero volume expansivity:
288  * \f[
289  * \hat s(T, P, X_k) = \sum_k X_k \hat s^0_k(T) - \hat R \sum_k X_k log(X_k)
290  * \f]
291  * The reference-state pure-species entropies \f$ \hat s^0_k(T,p_{ref}) \f$
292  * are computed by the species thermodynamic property manager. The pure
293  * species entropies are independent of pressure since the volume
294  * expansivities are equal to zero.
295  *
296  * Units: J/kmol/K.
297  *
298  * @see MultiSpeciesThermo
299  */
300  virtual doublereal entropy_mole() const;
301 
302  //! Molar heat capacity at constant pressure of the solution.
303  //! Units: J/kmol/K.
304  /*!
305  * For an ideal, constant partial molar volume solution mixture with
306  * pure species phases which exhibit zero volume expansivity:
307  * \f[
308  * \hat c_p(T,P) = \sum_k X_k \hat c^0_{p,k}(T) .
309  * \f]
310  * The heat capacity is independent of pressure. The reference-state pure-
311  * species heat capacities \f$ \hat c^0_{p,k}(T) \f$ are computed by the
312  * species thermodynamic property manager.
313  *
314  * @see MultiSpeciesThermo
315  */
316  virtual doublereal cp_mole() const;
317 
318  //! Molar heat capacity at constant volume of the solution.
319  //! Units: J/kmol/K.
320  /*!
321  * For an ideal, constant partial molar volume solution mixture with
322  * pure species phases which exhibit zero volume expansivity:
323  * \f[
324  * \hat c_v(T,P) = \hat c_p(T,P)
325  * \f]
326  *
327  * The two heat capacities are equal.
328  */
329  virtual doublereal cv_mole() const;
330 
331  //@}
332  /// @name Mechanical Equation of State Properties
333  /**
334  * In this equation of state implementation, the density is a function only
335  * of the mole fractions. Therefore, it can't be an independent variable.
336  * Instead, the pressure is used as the independent variable. Functions
337  * which try to set the thermodynamic state by calling setDensity() may
338  * cause an exception to be thrown.
339  */
340  //@{
341 
342  //! Pressure. Units: Pa.
343  /*!
344  * For this incompressible system, we return the internally stored
345  * independent value of the pressure.
346  */
347  virtual doublereal pressure() const {
348  return m_Pcurrent;
349  }
350 
351  //! Set the internally stored pressure (Pa) at constant temperature and
352  //! composition
353  /*!
354  * This method sets the pressure within the object. The mass density is not
355  * a function of pressure.
356  *
357  * @param p Input Pressure (Pa)
358  */
359  virtual void setPressure(doublereal p);
360 
361  //! Calculate the density of the mixture using the partial molar volumes and
362  //! mole fractions as input
363  /*!
364  * The formula for this is
365  *
366  * \f[
367  * \rho = \frac{\sum_k{X_k W_k}}{\sum_k{X_k V_k}}
368  * \f]
369  *
370  * where \f$X_k\f$ are the mole fractions, \f$W_k\f$ are the molecular
371  * weights, and \f$V_k\f$ are the pure species molar volumes.
372  *
373  * Note, the basis behind this formula is that in an ideal solution the
374  * partial molar volumes are equal to the pure species molar volumes. We
375  * have additionally specified in this class that the pure species molar
376  * volumes are independent of temperature and pressure.
377  */
378  doublereal calcDensity();
379 
380  //@}
381  /// @name Activities, Standard States, and Activity Concentrations
382  /**
383  * The activity \f$a_k\f$ of a species in solution is related to the
384  * chemical potential by \f[ \mu_k = \mu_k^0(T) + \hat R T \log a_k. \f] The
385  * quantity \f$\mu_k^0(T,P)\f$ is the chemical potential at unit activity,
386  * which depends only on temperature and the pressure. Activity is assumed
387  * to be molality-based here.
388  */
389  //@{
390 
391  virtual Units standardConcentrationUnits() const;
392  virtual void getActivityConcentrations(doublereal* c) const;
393 
394  //! Return the standard concentration for the kth species
395  /*!
396  * The standard concentration \f$ C^0_k \f$ used to normalize
397  * the activity (i.e., generalized) concentration for use
398  *
399  * For the time being, we will use the concentration of pure solvent for the
400  * the standard concentration of all species. This has the effect of making
401  * mass-action reaction rates based on the molality of species proportional
402  * to the molality of the species.
403  *
404  * @param k Optional parameter indicating the species. The default is to
405  * assume this refers to species 0.
406  * @returns the standard Concentration in units of m^3/kmol.
407  *
408  * @param k Species index
409  */
410  virtual doublereal standardConcentration(size_t k=0) const;
411  virtual doublereal logStandardConc(size_t k=0) const;
412 
413  //! Get the array of non-dimensional activity coefficients at
414  //! the current solution temperature, pressure, and solution concentration.
415  /*!
416  * For this phase, the activity coefficients are all equal to one.
417  *
418  * @param ac Output vector of activity coefficients. Length: m_kk.
419  */
420  virtual void getActivityCoefficients(doublereal* ac) const;
421 
422  //@}
423  /// @name Partial Molar Properties of the Solution
424  //@{
425 
426  //! Get the species chemical potentials. Units: J/kmol.
427  /*!
428  * This function returns a vector of chemical potentials of the species in
429  * solid solution at the current temperature, pressure and mole fraction of
430  * the solid solution.
431  *
432  * @param mu Output vector of species chemical
433  * potentials. Length: m_kk. Units: J/kmol
434  */
435  virtual void getChemPotentials(doublereal* mu) const;
436 
437  //@}
438  /// @name Partial Molar Properties of the Solution
439  //@{
440 
441  /**
442  * Returns an array of partial molar enthalpies for the species in the
443  * mixture. Units (J/kmol). For this phase, the partial molar enthalpies are
444  * equal to the pure species enthalpies
445  * \f[
446  * \bar h_k(T,P) = \hat h^{ref}_k(T) + (P - P_{ref}) \hat V^0_k
447  * \f]
448  * The reference-state pure-species enthalpies, \f$ \hat h^{ref}_k(T) \f$,
449  * at the reference pressure,\f$ P_{ref} \f$, are computed by the species
450  * thermodynamic property manager. They are polynomial functions of
451  * temperature.
452  * @see MultiSpeciesThermo
453  *
454  * @param hbar Output vector containing partial molar enthalpies.
455  * Length: m_kk.
456  */
457  virtual void getPartialMolarEnthalpies(doublereal* hbar) const;
458 
459  /**
460  * Returns an array of partial molar entropies of the species in the
461  * solution. Units: J/kmol/K. For this phase, the partial molar entropies
462  * are equal to the pure species entropies plus the ideal solution
463  * contribution.
464  * \f[
465  * \bar s_k(T,P) = \hat s^0_k(T) - R log(X_k)
466  * \f]
467  * The reference-state pure-species entropies,\f$ \hat s^{ref}_k(T) \f$, at
468  * the reference pressure, \f$ P_{ref} \f$, are computed by the species
469  * thermodynamic property manager. They are polynomial functions of
470  * temperature.
471  * @see MultiSpeciesThermo
472  *
473  * @param sbar Output vector containing partial molar entropies.
474  * Length: m_kk.
475  */
476  virtual void getPartialMolarEntropies(doublereal* sbar) const;
477 
478  /**
479  * Returns an array of partial molar Heat Capacities at constant pressure of
480  * the species in the solution. Units: J/kmol/K. For this phase, the partial
481  * molar heat capacities are equal to the standard state heat capacities.
482  *
483  * @param cpbar Output vector of partial heat capacities. Length: m_kk.
484  */
485  virtual void getPartialMolarCp(doublereal* cpbar) const;
486 
487  virtual void getPartialMolarVolumes(doublereal* vbar) const;
488  virtual void getStandardChemPotentials(doublereal* mu) const;
489  virtual void getPureGibbs(doublereal* gpure) const;
490 
491  //@}
492  /// @name Properties of the Standard State of the Species in the Solution
493  //@{
494 
495  //! Get the nondimensional Enthalpy functions for the species standard
496  //! states at their standard states at the current *T* and *P* of the
497  //! solution.
498  /*!
499  * A small pressure dependent term is added onto the reference state enthalpy
500  * to get the pressure dependence of this term.
501  *
502  * \f[
503  * h^o_k(T,P) = h^{ref}_k(T) + \left( \frac{P - P_{ref}}{C_o} \right)
504  * \f]
505  *
506  * The reference state thermodynamics is obtained by a pointer to a
507  * populated species thermodynamic property manager class (see
508  * ThermoPhase::m_spthermo). How to relate pressure changes to the reference
509  * state thermodynamics is resolved at this level.
510  *
511  * @param hrt Output vector of nondimensional standard state enthalpies.
512  * Length: m_kk.
513  */
514  virtual void getEnthalpy_RT(doublereal* hrt) const;
515 
516  //! Get the array of nondimensional Entropy functions for the species
517  //! standard states at the current *T* and *P* of the solution.
518  /*!
519  * The entropy of the standard state is defined as independent of
520  * pressure here.
521  *
522  * \f[
523  * s^o_k(T,P) = s^{ref}_k(T)
524  * \f]
525  *
526  * The reference state thermodynamics is obtained by a pointer to a
527  * populated species thermodynamic property manager class (see
528  * ThermoPhase::m_spthermo). How to relate pressure changes to the reference
529  * state thermodynamics is resolved at this level.
530  *
531  * @param sr Output vector of nondimensional standard state entropies.
532  * Length: m_kk.
533  */
534  virtual void getEntropy_R(doublereal* sr) const;
535 
536  //! Get the nondimensional Gibbs functions for the species standard states
537  //! at the current *T* and *P* of the solution.
538  /*!
539  * The standard Gibbs free energies are obtained from the enthalpy and
540  * entropy formulation.
541  *
542  * \f[
543  * g^o_k(T,P) = h^{o}_k(T,P) - T s^{o}_k(T,P)
544  * \f]
545  *
546  * @param grt Output vector of nondimensional standard state Gibbs free
547  * energies. Length: m_kk.
548  */
549  virtual void getGibbs_RT(doublereal* grt) const;
550 
551  //! Get the nondimensional Heat Capacities at constant pressure for the
552  //! species standard states at the current *T* and *P* of the solution
553  /*!
554  * The heat capacity of the standard state is independent of pressure
555  *
556  * \f[
557  * Cp^o_k(T,P) = Cp^{ref}_k(T)
558  * \f]
559  *
560  * The reference state thermodynamics is obtained by a pointer to a
561  * populated species thermodynamic property manager class (see
562  * ThermoPhase::m_spthermo). How to relate pressure changes to the reference
563  * state thermodynamics is resolved at this level.
564  *
565  * @param cpr Output vector of nondimensional standard state heat
566  * capacities. Length: m_kk.
567  */
568  virtual void getCp_R(doublereal* cpr) const;
569 
570  //! Get the molar volumes of the species standard states at the current
571  //! *T* and *P* of the solution.
572  /*!
573  * units = m^3 / kmol
574  *
575  * @param vol Output vector containing the standard state volumes.
576  * Length: m_kk.
577  */
578  virtual void getStandardVolumes(doublereal* vol) const;
579 
580  //@}
581  /// @name Thermodynamic Values for the Species Reference States
582  //@{
583 
584  const vector_fp& enthalpy_RT_ref() const;
585 
586  //! Returns a reference to the dimensionless reference state Gibbs free
587  //! energy vector.
588  /*!
589  * This function is part of the layer that checks/recalculates the reference
590  * state thermo functions.
591  */
592  const vector_fp& gibbs_RT_ref() const;
593 
594  virtual void getGibbs_RT_ref(doublereal* grt) const;
595  virtual void getGibbs_ref(doublereal* g) const;
596 
597  //! Returns a reference to the dimensionless reference state Entropy vector.
598  /*!
599  * This function is part of the layer that checks/recalculates the reference
600  * state thermo functions.
601  */
602  const vector_fp& entropy_R_ref() const;
603 
604  //! Returns a reference to the dimensionless reference state Heat Capacity
605  //! vector.
606  /*!
607  * This function is part of the layer that checks/recalculates the reference
608  * state thermo functions.
609  */
610  const vector_fp& cp_R_ref() const;
611 
612  //@}
613  /// @name Utilities for Initialization of the Object
614  //@{
615 
616  virtual bool addSpecies(shared_ptr<Species> spec);
617 
618  //! Set the density of lattice sites [kmol/m^3]
619  void setSiteDensity(double sitedens);
620 
621  virtual void initThermo();
622 
623  //! Set equation of state parameter values from XML entries.
624  /*!
625  * This method is called by function importPhase() when processing a phase
626  * definition in an input file. It should be overloaded in subclasses to set
627  * any parameters that are specific to that particular phase
628  * model. Note, this method is called before the phase is
629  * initialized with elements and/or species.
630  *
631  * For this phase, the molar density of the phase is specified in this
632  * block, and is a required parameter.
633  *
634  * @param eosdata An XML_Node object corresponding to
635  * the "thermo" entry for this phase in the input file.
636  *
637  * eosdata points to the thermo block, and looks like this:
638  *
639  * @code
640  * <phase id="O_lattice_SiO2" >
641  * <thermo model="Lattice">
642  * <site_density units="kmol/m^3"> 73.159 </site_density>
643  * </thermo>
644  * </phase>
645  * @endcode
646  *
647  * @deprecated The XML input format is deprecated and will be removed in
648  * Cantera 3.0.
649  */
650  virtual void setParametersFromXML(const XML_Node& eosdata);
651  //@}
652 
653 protected:
654  virtual void compositionChanged();
655 
656  //! Reference state pressure
657  doublereal m_Pref;
658 
659  //! The current pressure
660  /*!
661  * Since the density isn't a function of pressure, but only of the mole
662  * fractions, we need to independently specify the pressure. The density
663  * variable which is inherited as part of the State class, m_dens, is always
664  * kept current whenever T, P, or X[] change.
665  */
666  doublereal m_Pcurrent;
667 
668  //! Reference state enthalpies / RT
670 
671  //! Temporary storage for the reference state heat capacities
673 
674  //! Temporary storage for the reference state Gibbs energies
676 
677  //! Temporary storage for the reference state entropies at the current
678  //! temperature
679  mutable vector_fp m_s0_R;
680 
681  //! Vector of molar volumes for each species in the solution
682  /**
683  * Species molar volumes \f$ m^3 kmol^-1 \f$
684  */
686 
687  //! Site Density of the lattice solid
688  /*!
689  * Currently, this is imposed as a function of T, P or composition
690  *
691  * units are kmol m-3
692  */
693  doublereal m_site_density;
694 
695 private:
696  //! Update the species reference state thermodynamic functions
697  /*!
698  * The polynomials for the standard state functions are only reevaluated if
699  * the temperature has changed.
700  */
701  void _updateThermo() const;
702 };
703 }
704 
705 #endif
Header file for class ThermoPhase, the base class for phases with thermodynamic properties,...
A simple thermodynamic model for a bulk phase, assuming a lattice of solid atoms.
Definition: LatticePhase.h:231
vector_fp m_g0_RT
Temporary storage for the reference state Gibbs energies.
Definition: LatticePhase.h:675
vector_fp m_cp0_R
Temporary storage for the reference state heat capacities.
Definition: LatticePhase.h:672
virtual bool addSpecies(shared_ptr< Species > spec)
virtual void getGibbs_RT_ref(doublereal *grt) const
Returns the vector of nondimensional Gibbs Free Energies of the reference state at the current temper...
std::map< std::string, size_t > nativeState() const
Return a map of properties defining the native state of a substance.
Definition: LatticePhase.h:261
virtual void getActivityCoefficients(doublereal *ac) const
Get the array of non-dimensional activity coefficients at the current solution temperature,...
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 doublereal cp_mole() const
Molar heat capacity at constant pressure of the solution.
vector_fp m_h0_RT
Reference state enthalpies / RT.
Definition: LatticePhase.h:669
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
virtual doublereal enthalpy_mole() const
Return the Molar Enthalpy. Units: J/kmol.
virtual doublereal logStandardConc(size_t k=0) const
Natural logarithm of the standard concentration of the kth species.
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
doublereal calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
virtual void getStandardVolumes(doublereal *vol) const
Get the molar volumes of the species standard states at the current T and P of the solution.
vector_fp m_s0_R
Temporary storage for the reference state entropies at the current temperature.
Definition: LatticePhase.h:679
virtual doublereal cv_mole() const
Molar heat capacity at constant volume of the solution.
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
const vector_fp & cp_R_ref() const
Returns a reference to the dimensionless reference state Heat Capacity vector.
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
virtual void getPartialMolarCp(doublereal *cpbar) const
Returns an array of partial molar Heat Capacities at constant pressure of the species in the solution...
LatticePhase()
Base Empty constructor.
virtual bool isCompressible() const
Return whether phase represents a compressible substance.
Definition: LatticePhase.h:257
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the species standard states at the current T an...
virtual void setPressure(doublereal p)
Set the internally stored pressure (Pa) at constant temperature and composition.
vector_fp m_speciesMolarVolume
Vector of molar volumes for each species in the solution.
Definition: LatticePhase.h:685
virtual doublereal entropy_mole() const
Molar entropy of the solution. Units: J/kmol/K.
const vector_fp & entropy_R_ref() const
Returns a reference to the dimensionless reference state Entropy vector.
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
const vector_fp & gibbs_RT_ref() const
Returns a reference to the dimensionless reference state Gibbs free energy vector.
void setSiteDensity(double sitedens)
Set the density of lattice sites [kmol/m^3].
virtual std::string type() const
String indicating the thermodynamic model implemented.
Definition: LatticePhase.h:253
doublereal m_Pcurrent
The current pressure.
Definition: LatticePhase.h:666
virtual doublereal pressure() const
In this equation of state implementation, the density is a function only of the mole fractions.
Definition: LatticePhase.h:347
virtual Units standardConcentrationUnits() const
The activity of a species in solution is related to the chemical potential by.
virtual void setParametersFromXML(const XML_Node &eosdata)
Set equation of state parameter values from XML entries.
virtual void getStandardChemPotentials(doublereal *mu) const
Get the array of chemical potentials at unit activity for the species at their standard states at the...
virtual void compositionChanged()
Apply changes to the state which are needed after the composition changes.
void _updateThermo() const
Update the species reference state thermodynamic functions.
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
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...
doublereal m_Pref
Reference state pressure.
Definition: LatticePhase.h:657
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species standard states at their standard states at...
doublereal m_site_density
Site Density of the lattice solid.
Definition: LatticePhase.h:693
virtual void getPureGibbs(doublereal *gpure) const
Get the Gibbs functions for the standard state of the species at the current T and P of the solution.
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:102
A representation of the units associated with a dimensional quantity.
Definition: Units.h:30
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:104
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:180
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:264