Cantera  2.1.2
LatticeSolidPhase.h
Go to the documentation of this file.
1 /**
2  * @file LatticeSolidPhase.h
3  * Header for a simple thermodynamics model of a bulk solid phase
4  * derived from ThermoPhase,
5  * assuming an ideal solution model based on a lattice of solid atoms
6  * (see \ref thermoprops and class \link Cantera::LatticeSolidPhase LatticeSolidPhase\endlink).
7  */
8 
9 // Copyright 2005 California Institute of Technology
10 
11 #ifndef CT_LATTICESOLID_H
12 #define CT_LATTICESOLID_H
13 
14 #include "cantera/base/config.h"
15 #include "cantera/base/ct_defs.h"
16 #include "mix_defs.h"
17 #include "ThermoPhase.h"
18 #include "SpeciesThermo.h"
19 #include "LatticePhase.h"
20 #include "cantera/base/utilities.h"
21 
22 namespace Cantera
23 {
24 
25 //! A phase that is comprised of a fixed additive combination of other lattice phases
26 /*!
27  * This is the main way %Cantera describes semiconductors and other solid phases.
28  * This %ThermoPhase object calculates its properties as a sum over other %LatticePhase objects. Each of the %LatticePhase
29  * objects is a %ThermoPhase object by itself.
30  *
31  * The results from this LatticeSolidPhase model reduces to the LatticePhase model when there is one
32  * lattice phase and the molar densities of the sublattice and the molar density within the LatticeSolidPhase
33  * have the same values.
34  *
35  * The mole fraction vector is redefined witin the the LatticeSolidPhase object. Each of the mole
36  * fractions sum to one on each of the sublattices. The routine getMoleFraction() and setMoleFraction()
37  * have been redefined to use this convention.
38  *
39  * <HR>
40  * <H2> Specification of Species Standard %State Properties </H2>
41  * <HR>
42  *
43  * The standard state properties are calculated in the normal way for each of the sublattices. The normal way
44  * here means that a thermodynamic polynomial in temperature is developed. Also, a constant volume approximation
45  * for the pressure dependence is assumed. All of these properties are on a Joules per kmol of sublattice
46  * constituent basis.
47  *
48  * <HR>
49  * <H2> Specification of Solution Thermodynamic Properties </H2>
50  * <HR>
51 
52  * The sum over the %LatticePhase objects is carried out by weighting each %LatticePhase object
53  * value with the molar density (kmol m-3) of its %LatticePhase. Then the resulting quantity is divided by
54  * the molar density of the total compound. The LatticeSolidPhase object therefore only contains a
55  * listing of the number of %LatticePhase object
56  * that comprises the solid, and it contains a value for the molar density of the entire mixture.
57  * This is the same thing as saying that
58  *
59  * \f[
60  * L_i = L^{solid} \theta_i
61  * \f]
62  *
63  * \f$ L_i \f$ is the molar volume of the ith lattice. \f$ L^{solid} \f$ is the molar volume of the entire
64  * solid. \f$ \theta_i \f$ is a fixed weighting factor for the ith lattice representing the lattice
65  * stoichiometric coefficient. For this object the \f$ \theta_i \f$ values are fixed.
66  *
67  * Let's take FeS2 as an example, which may be thought of as a combination of two lattices: Fe and S lattice.
68  * The Fe sublattice has a molar density of 1 gmol cm-3. The S sublattice has a molar density of 2 gmol cm-3.
69  * We then define the LatticeSolidPhase object as having a nominal composition of FeS2, and having a
70  * molar density of 1 gmol cm-3. All quantities pertaining to the FeS2 compound will be have weights
71  * associated with the sublattices. The Fe sublattice will have a weight of 1.0 associated with it. The
72  * S sublattice will have a weight of 2.0 associated with it.
73  *
74  * <HR>
75  * <H3> Specification of Solution Density Properties </H3>
76  * <HR>
77  *
78  * Currently, molar density is not a constant within the object, even though the species molar volumes are a
79  * constant. The basic idea is that a swelling of one of the sublattices will result in a swelling of
80  * of all of the lattices. Therefore, the molar volumes of the individual lattices are not independent of
81  * one another.
82  *
83  * The molar volume of the Lattice solid is calculated from the following formula
84  *
85  * \f[
86  * V = \sum_i{ \theta_i V_i^{lattice}}
87  * \f]
88  *
89  * where \f$ V_i^{lattice} \f$ is the molar volume of the ith sublattice. This is calculated from the
90  * following standard formula.
91  *
92  *
93  * \f[
94  * V_i = \sum_k{ X_k V_k}
95  * \f]
96  *
97  * where k is a species in the ith sublattice.
98  *
99  * The mole fraction vector is redefined witin the the LatticeSolidPhase object. Each of the mole
100  * fractions sum to one on each of the sublattices. The routine getMoleFraction() and setMoleFraction()
101  * have been redefined to use this convention.
102  *
103  * (This object is still under construction)
104  *
105  */
107 {
108 public:
109  //! Base empty constructor
111 
112  //! Copy Constructor
113  /*!
114  * @param right Object to be copied
115  */
116  LatticeSolidPhase(const LatticeSolidPhase& right);
117 
118  //! Assignment operator
119  /*!
120  * @param right Object to be copied
121  */
123 
124  //! Destructor
125  virtual ~LatticeSolidPhase();
126 
127  //! Duplication function
128  /*!
129  * This virtual function is used to create a duplicate of the
130  * current phase. It's used to duplicate the phase when given
131  * a ThermoPhase pointer to the phase.
132  *
133  * @return It returns a ThermoPhase pointer.
134  */
136 
137  //! Equation of state type flag.
138  /*!
139  * Returns cLatticeSolid, listed in mix_defs.h.
140  */
141  virtual int eosType() const {
142  return cLatticeSolid;
143  }
144 
145  //! Minimum temperature for which the thermodynamic data for the species
146  //! or phase are valid.
147  /*!
148  * If no argument is supplied, the
149  * value returned will be the lowest temperature at which the
150  * data for \e all species are valid. Otherwise, the value
151  * will be only for species \a k. This function is a wrapper
152  * that calls the species thermo minTemp function.
153  *
154  * @param k index of the species. Default is -1, which will return the max of the min value
155  * over all species.
156  */
157  virtual doublereal minTemp(size_t k = npos) const;
158 
159  //! Maximum temperature for which the thermodynamic data for the species
160  //! are valid.
161  /*!
162  * If no argument is supplied, the
163  * value returned will be the highest temperature at which the
164  * data for \e all species are valid. Otherwise, the value
165  * will be only for species \a k. This function is a wrapper
166  * that calls the species thermo maxTemp function.
167  *
168  * @param k index of the species. Default is -1, which will return the min of the max value
169  * over all species.
170  */
171  virtual doublereal maxTemp(size_t k = npos) const;
172 
173  //! Returns the reference pressure in Pa. This function is a wrapper
174  //! that calls the species thermo refPressure function.
175  virtual doublereal refPressure() const ;
176 
177  //! This method returns the convention used in specification
178  //! of the standard state, of which there are currently two,
179  //! temperature based, and variable pressure based.
180  /*!
181  * All of the thermo is determined by slave %ThermoPhase routines.
182  */
183  virtual int standardStateConvention() const {
184  return cSS_CONVENTION_SLAVE;
185  }
186 
187  //! Return the Molar Enthalpy. Units: J/kmol.
188  /*!
189  * The molar enthalpy is determined by the following formula, where \f$ \theta_n \f$ is the
190  * lattice stoichiometric coefficient of the nth lattice
191  *
192  * \f[
193  * \tilde h(T,P) = {\sum_n \theta_n \tilde h_n(T,P) }
194  * \f]
195  *
196  * \f$ \tilde h_n(T,P) \f$ is the enthalpy of the n<SUP>th</SUP> lattice.
197  *
198  * units J/kmol
199  */
200  virtual doublereal enthalpy_mole() const;
201 
202  //! Return the Molar Internal Energy. Units: J/kmol.
203  /*!
204  * The molar enthalpy is determined by the following formula, where \f$ \theta_n \f$ is the
205  * lattice stoichiometric coefficient of the nth lattice
206  *
207  * \f[
208  * \tilde u(T,P) = {\sum_n \theta_n \tilde u_n(T,P) }
209  * \f]
210  *
211  * \f$ \tilde u_n(T,P) \f$ is the internal energy of the n<SUP>th</SUP> lattice.
212  *
213  * units J/kmol
214  */
215  virtual doublereal intEnergy_mole() const;
216 
217  //! Return the Molar Entropy. Units: J/kmol/K.
218  /*!
219  * The molar enthalpy is determined by the following formula, where \f$ \theta_n \f$ is the
220  * lattice stoichiometric coefficient of the nth lattice
221  *
222  * \f[
223  * \tilde s(T,P) = \sum_n \theta_n \tilde s_n(T,P)
224  * \f]
225  *
226  * \f$ \tilde s_n(T,P) \f$ is the molar entropy of the n<SUP>th</SUP> lattice.
227  *
228  * units J/kmol/K
229  */
230  virtual doublereal entropy_mole() const;
231 
232  //! Return the Molar Gibbs energy. Units: J/kmol.
233  /*!
234  * The molar gibbs free energy is determined by the following formula, where \f$ \theta_n \f$ is the
235  * lattice stoichiometric coefficient of the nth lattice
236  *
237  * \f[
238  * \tilde h(T,P) = {\sum_n \theta_n \tilde h_n(T,P) }
239  * \f]
240  *
241  * \f$ \tilde h_n(T,P) \f$ is the enthalpy of the n<SUP>th</SUP> lattice.
242  *
243  * units J/kmol
244  */
245  virtual doublereal gibbs_mole() const;
246 
247  //! Return the constant pressure heat capacity. Units: J/kmol/K
248  /*!
249  * The molar constant pressure heat capacity is determined by the following formula, where \f$ C_n \f$ is the
250  * lattice molar density of the nth lattice, and \f$ C_T \f$ is the molar density
251  * of the solid compound.
252  *
253  * \f[
254  * \tilde c_{p,n}(T,P) = \frac{\sum_n C_n \tilde c_{p,n}(T,P) }{C_T},
255  * \f]
256  *
257  * \f$ \tilde c_{p,n}(T,P) \f$ is the heat capacity of the n<SUP>th</SUP> lattice.
258  *
259  * units J/kmol/K
260  */
261  virtual doublereal cp_mole() const;
262 
263  //! Return the constant volume heat capacity. Units: J/kmol/K
264  /*!
265  * The molar constant volume heat capacity is determined by the following formula, where \f$ C_n \f$ is the
266  * lattice molar density of the nth lattice, and \f$ C_T \f$ is the molar density
267  * of the solid compound.
268  *
269  * \f[
270  * \tilde c_{v,n}(T,P) = \frac{\sum_n C_n \tilde c_{v,n}(T,P) }{C_T},
271  * \f]
272  *
273  * \f$ \tilde c_{v,n}(T,P) \f$ is the heat capacity of the n<SUP>th</SUP> lattice.
274  *
275  * units J/kmol/K
276  */
277  virtual doublereal cv_mole() const {
278  return cp_mole();
279  }
280 
281  //! Report the Pressure. Units: Pa.
282  /*!
283  * This method simply returns the stored pressure value.
284  */
285  virtual doublereal pressure() const {
286  return m_press;
287  }
288 
289  //! Set the pressure at constant temperature. Units: Pa.
290  /*!
291  *
292  * @param p Pressure (units - Pa)
293  */
294  virtual void setPressure(doublereal p);
295 
296  //! Calculate the density of the solid mixture
297  /*!
298  * The formula for this is
299  *
300  * \f[
301  * \rho = \sum_n{ \rho_n \theta_n }
302  * \f]
303  *
304  * where \f$ \rho_n \f$ is the density of the nth sublattice
305  */
306  doublereal calcDensity();
307 
308  //! Set the mole fractions to the specified values, and then
309  //! normalize them so that they sum to 1.0 for each of the subphases
310  /*!
311  * On input, the mole fraction vector is assumed to sum to one for each of the sublattices. The sublattices
312  * are updated with this mole fraction vector. The mole fractions are also stored within this object, after
313  * they are normalized to one by dividing by the number of sublattices.
314  *
315  * @param x Input vector of mole fractions. There is no restriction
316  * on the sum of the mole fraction vector. Internally,
317  * this object will pass portions of this vector to the sublattices which assume that the portions
318  * individually sum to one.
319  * Length is m_kk.
320  */
321  virtual void setMoleFractions(const doublereal* const x);
322 
323  //! Get the species mole fraction vector.
324  /*!
325  * On output the mole fraction vector will sum to one for each of the subphases which make up this phase.
326  *
327  * @param x On return, x contains the mole fractions. Must have a
328  * length greater than or equal to the number of species.
329  */
330  virtual void getMoleFractions(doublereal* const x) const;
331 
332  //! The mole fraction of species k.
333  /*!
334  * If k is outside the valid
335  * range, an exception will be thrown. Note that it is
336  * somewhat more efficient to call getMoleFractions if the
337  * mole fractions of all species are desired.
338  * @param k species index
339  */
340  doublereal moleFraction(const int k) const {
341  return err("not implemented");
342  }
343 
344  //! Get the species mass fractions.
345  /*!
346  * @param y On return, y contains the mass fractions. Array \a y must have a length
347  * greater than or equal to the number of species.
348  */
349  void getMassFractions(doublereal* const y) const {
350  err("not implemented");
351  }
352 
353  //! Mass fraction of species k.
354  /*!
355  * If k is outside the valid range, an exception will be thrown. Note that it is
356  * somewhat more efficient to call getMassFractions if the mass fractions of all species are desired.
357  *
358  * @param k species index
359  */
360  doublereal massFraction(const int k) const {
361  return err("not implemented");
362  }
363 
364  //! Set the mass fractions to the specified values, and then
365  //! normalize them so that they sum to 1.0.
366  /*!
367  * @param y Array of unnormalized mass fraction values (input).
368  * Must have a length greater than or equal to the number of species.
369  * Input vector of mass fractions. There is no restriction
370  * on the sum of the mass fraction vector. Internally,
371  * the State object will normalize this vector before
372  * storing its contents.
373  * Length is m_kk.
374  */
375  virtual void setMassFractions(const doublereal* const y) {
376  err("not implemented");
377  }
378 
379  //! Set the mass fractions to the specified values without normalizing.
380  /*!
381  * This is useful when the normalization
382  * condition is being handled by some other means, for example
383  * by a constraint equation as part of a larger set of equations.
384  *
385  * @param y Input vector of mass fractions.
386  * Length is m_kk.
387  */
388  virtual void setMassFractions_NoNorm(const doublereal* const y) {
389  err("not implemented");
390  }
391 
392  void getConcentrations(doublereal* const c) const {
393  err("not implemented");
394  }
395 
396  doublereal concentration(int k) const {
397  return err("not implemented");
398  }
399 
400  virtual void setConcentrations(const doublereal* const conc) {
401  err("not implemented");
402  }
403 
404  //! This method returns an array of generalized activity concentrations
405  /*!
406  * The generalized activity concentrations,
407  * \f$ C^a_k \f$, are defined such that \f$ a_k = C^a_k /
408  * C^0_k, \f$ where \f$ C^0_k \f$ is a standard concentration
409  * defined below and \f$ a_k \f$ are activities used in the
410  * thermodynamic functions. These activity (or generalized)
411  * concentrations are used by kinetics manager classes to compute the forward and
412  * reverse rates of elementary reactions. Note that they may
413  * or may not have units of concentration --- they might be
414  * partial pressures, mole fractions, or surface coverages,
415  * for example.
416  *
417  * @param c Output array of generalized concentrations. The
418  * units depend upon the implementation of the
419  * reaction rate expressions within the phase.
420  */
421  virtual void getActivityConcentrations(doublereal* c) const;
422 
423  //! Get the array of non-dimensional molar-based activity coefficients at
424  //! the current solution temperature, pressure, and solution concentration.
425  /*!
426  * @param ac Output vector of activity coefficients. Length: m_kk.
427  */
428  virtual void getActivityCoefficients(doublereal* ac) const;
429 
430  //! Get the species chemical potentials. Units: J/kmol.
431  /*!
432  * This function returns a vector of chemical potentials of the
433  * species in solution at the current temperature, pressure
434  * and mole fraction of the solution.
435  *
436  * This returns the underlying lattice chemical potentials, as the units are kmol-1 of
437  * the sublattice species.
438  *
439  * @param mu Output vector of species chemical
440  * potentials. Length: m_kk. Units: J/kmol
441  */
442  virtual void getChemPotentials(doublereal* mu) const;
443 
444  //! Returns an array of partial molar enthalpies for the species in the mixture.
445  /*!
446  * Units (J/kmol)
447  * For this phase, the partial molar enthalpies are equal to the
448  * pure species enthalpies
449  * \f[
450  * \bar h_k(T,P) = \hat h^{ref}_k(T) + (P - P_{ref}) \hat V^0_k
451  * \f]
452  * The reference-state pure-species enthalpies, \f$ \hat h^{ref}_k(T) \f$,
453  * at the reference pressure,\f$ P_{ref} \f$,
454  * are computed by the species thermodynamic
455  * property manager. They are polynomial functions of temperature.
456  * @see SpeciesThermo
457  *
458  * @param hbar Output vector containing partial molar enthalpies.
459  * Length: m_kk.
460  */
461  virtual void getPartialMolarEnthalpies(doublereal* hbar) const;
462 
463  /**
464  * Returns an array of partial molar entropies of the species in the
465  * solution. Units: J/kmol/K.
466  * For this phase, the partial molar entropies are equal to the
467  * pure species entropies plus the ideal solution contribution.
468  * \f[
469  * \bar s_k(T,P) = \hat s^0_k(T) - R log(X_k)
470  * \f]
471  * The reference-state pure-species entropies,\f$ \hat s^{ref}_k(T) \f$,
472  * at the reference pressure, \f$ P_{ref} \f$, are computed by the
473  * species thermodynamic
474  * property manager. They are polynomial functions of temperature.
475  * @see SpeciesThermo
476  *
477  * @param sbar Output vector containing partial molar entropies.
478  * Length: m_kk.
479  */
480  virtual void getPartialMolarEntropies(doublereal* sbar) const;
481 
482  /**
483  * Returns an array of partial molar Heat Capacities at constant
484  * pressure of the species in the
485  * solution. Units: J/kmol/K.
486  * For this phase, the partial molar heat capacities are equal
487  * to the standard state heat capacities.
488  *
489  * @param cpbar Output vector of partial heat capacities. Length: m_kk.
490  */
491  virtual void getPartialMolarCp(doublereal* cpbar) const;
492 
493  /**
494  * returns an array of partial molar volumes of the species
495  * in the solution. Units: m^3 kmol-1.
496  *
497  * For this solution, thepartial molar volumes are equal to the
498  * constant species molar volumes.
499  *
500  * @param vbar Output vector of partial molar volumes. Length: m_kk.
501  */
502  virtual void getPartialMolarVolumes(doublereal* vbar) const;
503 
504  //! Get the array of standard state chemical potentials at unit activity for the species
505  //! at their standard states at the current <I>T</I> and <I>P</I> of the solution.
506  /*!
507  * These are the standard state chemical potentials \f$ \mu^0_k(T,P)
508  * \f$. The values are evaluated at the current
509  * temperature and pressure of the solution.
510  *
511  * This returns the underlying lattice standard chemical potentials, as the units are kmol-1 of
512  * the sublattice species.
513  *
514  * @param mu0 Output vector of chemical potentials.
515  * Length: m_kk. Units: J/kmol
516  */
517  virtual void getStandardChemPotentials(doublereal* mu0) const;
518 
519  //! Return the standard concentration for the kth species
520  /*!
521  * The standard concentration \f$ C^0_k \f$ used to normalize
522  * the activity (i.e., generalized) concentration. In many cases, this quantity
523  * will be the same for all species in a phase - for example,
524  * for an ideal gas \f$ C^0_k = P/\hat R T \f$. For this
525  * reason, this method returns a single value, instead of an
526  * array. However, for phases in which the standard
527  * concentration is species-specific (e.g. surface species of
528  * different sizes), this method may be called with an
529  * optional parameter indicating the species.
530  *
531  * @param k Optional parameter indicating the species. The default
532  * is to assume this refers to species 0.
533  * @return
534  * Returns the standard concentration. The units are by definition
535  * dependent on the ThermoPhase and kinetics manager representation.
536  */
537  virtual doublereal standardConcentration(size_t k=0) const;
538 
539  //! Natural logarithm of the standard concentration of the kth species.
540  /*!
541  * @param k index of the species (defaults to zero)
542  */
543  virtual doublereal logStandardConc(size_t k=0) const;
544  //@}
545  /// @name Thermodynamic Values for the Species Reference States
546  //@{
547 
548  //! Returns the vector of nondimensional enthalpies of the reference state at the current
549  //! temperature of the solution and the reference pressure for the species.
550  /*!
551  * This function fills in its one entry in hrt[] by calling
552  * the underlying species thermo function for the
553  * dimensionless gibbs free energy, calculated from the
554  * dimensionless enthalpy and entropy.
555  *
556  * @param grt Vector of dimensionless Gibbs free energies of the reference state
557  * length = m_kk
558  */
559  virtual void getGibbs_RT_ref(doublereal* grt) const;
560 
561  //! Returns the vector of the gibbs function of the reference state at the current
562  //! temperatureof the solution and the reference pressure for the species.
563  /*!
564  * units = J/kmol
565  *
566  * This function fills in its one entry in g[] by calling the underlying species thermo
567  * functions for the gibbs free energy, calculated from enthalpy and the
568  * entropy, and the multiplying by RT.
569  *
570  * @param g Vector of Gibbs free energies of the reference state.
571  * length = m_kk
572  */
573  virtual void getGibbs_ref(doublereal* g) const;
574 
575  //! Initialize the ThermoPhase object after all species have been set up
576  /*!
577  * @internal Initialize.
578  *
579  * This method is provided to allow
580  * subclasses to perform any initialization required after all
581  * species have been added. For example, it might be used to
582  * resize internal work arrays that must have an entry for
583  * each species. The base class implementation does nothing,
584  * and subclasses that do not require initialization do not
585  * need to overload this method. When importing a CTML phase
586  * description, this method is called from ThermoPhase::initThermoXML(),
587  * which is called from importPhase(),
588  * just prior to returning from function importPhase().
589  *
590  * @see importCTML.cpp
591  */
592  virtual void initThermo();
593 
594  //! Initialize vectors that depend on the number of species and sublattices
595  void initLengths();
596 
597  //! Add in species from Slave phases
598  /*!
599  * This hook is used for cSS_CONVENTION_SLAVE phases
600  *
601  * @param phaseNode XML_Node for the current phase
602  */
603  virtual void installSlavePhases(Cantera::XML_Node* phaseNode);
604 
605  //! Set equation of state parameter values from XML entries.
606  /*!
607  * This method is called by function importPhase() in
608  * file importCTML.cpp when processing a phase definition in
609  * an input file. It should be overloaded in subclasses to set
610  * any parameters that are specific to that particular phase
611  * model. Note, this method is called before the phase is
612  * initialized with elements and/or species.
613  *
614  * @param eosdata An XML_Node object corresponding to
615  * the "thermo" entry for this phase in the input file.
616  */
617  virtual void setParametersFromXML(const XML_Node& eosdata);
618 
619  //! Set the Lattice mole fractions using a string
620  /*!
621  * @param n Integer value of the lattice whose mole fractions are being set
622  * @param x string containing Name:value pairs that will specify the mole fractions
623  * of species on a particular lattice
624  */
625  void setLatticeMoleFractionsByName(int n, const std::string& x);
626 
627 #ifdef H298MODIFY_CAPABILITY
628 
629  //! Modify the value of the 298 K Heat of Formation of one species in the phase (J kmol-1)
630  /*!
631  * The 298K heat of formation is defined as the enthalpy change to create the standard state
632  * of the species from its constituent elements in their standard states at 298 K and 1 bar.
633  *
634  * @param k Species k
635  * @param Hf298New Specify the new value of the Heat of Formation at 298K and 1 bar
636  */
637  virtual void modifyOneHf298SS(const size_t& k, const doublereal Hf298New);
638 #endif
639 
640 private:
641  //! error routine
642  /*!
643  * @param msg Message
644  *
645  * @return nothing
646  */
647  doublereal err(const std::string& msg) const;
648 
649 protected:
650  //! Last temperature at which the reference thermo was calculated
651  mutable doublereal m_tlast;
652 
653  //! Current value of the pressure
654  doublereal m_press;
655 
656  //! Current value of the molar density
657  doublereal m_molar_density;
658 
659  //! Number of sublattice phases
660  size_t m_nlattice;
661 
662  //! Vector of sublattic ThermoPhase objects
663  std::vector<LatticePhase*> m_lattice;
664 
665  //! Vector of mole fractions
666  /*!
667  * Note these mole fractions sum to one when summed over all phases.
668  * However, this is not what's passed down to the lower m_lattice objects.
669  */
670  mutable vector_fp m_x;
671 
672  //! Lattice stoichiometric coefficients
673  std::vector<doublereal> theta_;
674 
675  //! Temporary vector
676  mutable vector_fp tmpV_;
677 
678  std::vector<size_t> lkstart_;
679 
680 private:
681  //! Update the reference thermodynamic functions
682  void _updateThermo() const;
683 };
684 }
685 
686 #endif
virtual doublereal logStandardConc(size_t k=0) const
Natural logarithm of the standard concentration of the kth species.
std::vector< LatticePhase * > m_lattice
Vector of sublattic ThermoPhase objects.
virtual void installSlavePhases(Cantera::XML_Node *phaseNode)
Add in species from Slave phases.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
virtual void getPartialMolarCp(doublereal *cpbar) const
Returns an array of partial molar Heat Capacities at constant pressure of the species in the solution...
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
Various templated functions that carry out common vector operations (see Templated Utility Functions)...
doublereal moleFraction(const int k) const
The mole fraction of species k.
virtual doublereal cv_mole() const
Return the constant volume heat capacity. Units: J/kmol/K.
doublereal calcDensity()
Calculate the density of the solid mixture.
const size_t npos
index returned by functions to indicate "no position"
Definition: ct_defs.h:173
LatticeSolidPhase & operator=(const LatticeSolidPhase &right)
Assignment operator.
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
LatticeSolidPhase()
Base empty constructor.
virtual void modifyOneHf298SS(const int k, const doublereal Hf298New)
Modify the value of the 298 K Heat of Formation of one species in the phase (J kmol-1) ...
Definition: ThermoPhase.h:227
virtual void setMoleFractions(const doublereal *const x)
Set the mole fractions to the specified values, and then normalize them so that they sum to 1...
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:100
virtual doublereal cp_mole() const
Return the constant pressure heat capacity. Units: J/kmol/K.
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
Virtual base class for the calculation of multiple-species thermodynamic reference-state property man...
virtual ~LatticeSolidPhase()
Destructor.
virtual void setMassFractions_NoNorm(const doublereal *const y)
Set the mass fractions to the specified values without normalizing.
doublereal m_tlast
Last temperature at which the reference thermo was calculated.
virtual void setPressure(doublereal p)
Set the pressure at constant temperature. Units: Pa.
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:101
void _updateThermo() const
Update the reference thermodynamic functions.
virtual void getGibbs_RT_ref(doublereal *grt) const
Returns the vector of nondimensional enthalpies of the reference state at the current temperature of ...
virtual void getStandardChemPotentials(doublereal *mu0) const
Get the array of standard state chemical potentials at unit activity for the species at their standar...
virtual void getGibbs_ref(doublereal *g) const
Returns the vector of the gibbs function of the reference state at the current temperatureof the solu...
void initLengths()
Initialize vectors that depend on the number of species and sublattices.
ThermoPhase * duplMyselfAsThermoPhase() const
Duplication function.
doublereal m_molar_density
Current value of the molar density.
vector_fp tmpV_
Temporary vector.
virtual doublereal pressure() const
Report the Pressure. Units: Pa.
doublereal err(const std::string &msg) const
error routine
doublereal m_press
Current value of the pressure.
virtual doublereal maxTemp(size_t k=npos) const
Maximum temperature for which the thermodynamic data for the species are valid.
virtual void getPartialMolarVolumes(doublereal *vbar) const
returns an array of partial molar volumes of the species in the solution.
virtual doublereal refPressure() const
Returns the reference pressure in Pa.
virtual doublereal intEnergy_mole() const
Return the Molar Internal Energy. Units: J/kmol.
void setLatticeMoleFractionsByName(int n, const std::string &x)
Set the Lattice mole fractions using a string.
virtual doublereal minTemp(size_t k=npos) const
Minimum temperature for which the thermodynamic data for the species or phase are valid...
void getMassFractions(doublereal *const y) const
Get the species mass fractions.
vector_fp m_x
Vector of mole fractions.
std::vector< doublereal > theta_
Lattice stoichiometric coefficients.
virtual int eosType() const
Equation of state type flag.
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:165
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized activity concentrations.
virtual void setParametersFromXML(const XML_Node &eosdata)
Set equation of state parameter values from XML entries.
A phase that is comprised of a fixed additive combination of other lattice phases.
virtual void getActivityCoefficients(doublereal *ac) const
Get the array of non-dimensional molar-based activity coefficients at the current solution temperatur...
virtual doublereal entropy_mole() const
Return the Molar Entropy. Units: J/kmol/K.
virtual int standardStateConvention() const
This method returns the convention used in specification of the standard state, of which there are cu...
doublereal massFraction(const int k) const
Mass fraction of species k.
size_t m_nlattice
Number of sublattice phases.
virtual void getMoleFractions(doublereal *const x) const
Get the species mole fraction vector.
virtual doublereal enthalpy_mole() const
Return the Molar Enthalpy. Units: J/kmol.
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 gibbs_mole() const
Return the Molar Gibbs energy. Units: J/kmol.
Header for a simple thermodynamics model of a bulk phase derived from ThermoPhase, assuming a lattice of solid atoms (see Thermodynamic Properties and class LatticePhase).
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
virtual void setMassFractions(const doublereal *const y)
Set the mass fractions to the specified values, and then normalize them so that they sum to 1...
const int cSS_CONVENTION_SLAVE
Standard state thermodynamics is obtained from slave ThermoPhase objects.
Definition: ThermoPhase.h:38
virtual void setConcentrations(const doublereal *const conc)
Set the concentrations to the specified values within the phase.