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