Cantera 2.6.0

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