Cantera 2.6.0

IdealSolidSolnPhase.h
Go to the documentation of this file.
1/**
2 * @file IdealSolidSolnPhase.h Header file for an ideal solid solution model
3 * with incompressible thermodynamics (see \ref thermoprops and
4 * \link Cantera::IdealSolidSolnPhase IdealSolidSolnPhase\endlink).
5 *
6 * This class inherits from the Cantera class ThermoPhase and implements an
7 * ideal solid solution model with incompressible thermodynamics.
8 */
9
10// This file is part of Cantera. See License.txt in the top-level directory or
11// at https://cantera.org/license.txt for license and copyright information.
12
13#ifndef CT_IDEALSOLIDSOLNPHASE_H
14#define CT_IDEALSOLIDSOLNPHASE_H
15
16#include "ThermoPhase.h"
17
18 namespace Cantera
19{
20
21/**
22 * Class IdealSolidSolnPhase represents a condensed phase ideal solution
23 * compound. The phase and the pure species phases which comprise the standard
24 * states of the species are assumed to have zero volume expansivity and zero
25 * isothermal compressibility. Each species does, however, have constant but
26 * distinct partial molar volumes equal to their pure species molar volumes. The
27 * class derives from class ThermoPhase, and overloads the virtual methods
28 * defined there with ones that use expressions appropriate for ideal solution
29 * mixtures.
30 *
31 * The generalized concentrations can have three different forms depending on
32 * the value of the member attribute #m_formGC, which is supplied in the
33 * constructor and in the input file. The value and form of the generalized
34 * concentration will affect reaction rate constants involving species in this
35 * phase.
36 *
37 * @ingroup thermoprops
38 */
39 class IdealSolidSolnPhase : public ThermoPhase
40{
41 public:
42 /**
43 * Constructor for IdealSolidSolnPhase.
44 * The generalized concentrations can have three different forms
45 * depending on the value of the member attribute #m_formGC, which
46 * is supplied in the constructor or read from the input file.
47 *
48 * @param formCG This parameter initializes the #m_formGC variable.
49 * @deprecated the formGC argument is deprecated and will be removed after
50 * Cantera 2.6. Use the setStandardConcentrationModel method instead.
51 */
52 IdealSolidSolnPhase(int formCG=-1);
53
54 //! Construct and initialize an IdealSolidSolnPhase ThermoPhase object
55 //! directly from an ASCII input file
56 /*!
57 * This constructor will also fully initialize the object.
58 * The generalized concentrations can have three different forms
59 * depending on the value of the member attribute #m_formGC, which
60 * is supplied in the constructor or read from the input file.
61 *
62 * @param infile File name for the input file containing information
63 * for this phase. If blank, an empty phase will be
64 * created.
65 * @param id The name of this phase. This is used to look up
66 * the phase in the input file.
67 * @param formCG This parameter initializes the #m_formGC variable.
68 * @deprecated the formGC argument is deprecated and will be removed after
69 * Cantera 2.6. Use the setStandardConcentrationModel method instead.
70 */
71 explicit IdealSolidSolnPhase(const std::string& infile,
72 const std::string& id="", int formCG=-1);
73
74 //! Construct and initialize an IdealSolidSolnPhase ThermoPhase object
75 //! directly from an XML database
76 /*!
77 * The generalized concentrations can have three different forms
78 * depending on the value of the member attribute #m_formGC, which
79 * is supplied in the constructor and/or read from the data file.
80 *
81 * @param root XML tree containing a description of the phase.
82 * The tree must be positioned at the XML element
83 * named phase with id, "id", on input to this routine.
84 * @param id The name of this phase. This is used to look up
85 * the phase in the XML datafile.
86 * @param formCG This parameter initializes the #m_formGC variable.
87 *
88 * @deprecated The XML input format is deprecated and will be removed in
89 * Cantera 3.0.
90 */
91 IdealSolidSolnPhase(XML_Node& root, const std::string& id="", int formCG=-1);
92
93 virtual std::string type() const {
94 return "IdealSolidSoln";
95 }
96
97 virtual bool isIdeal() const {
98 return true;
99 }
100
101 virtual bool isCompressible() const {
102 return false;
103 }
104
105 //! @name Molar Thermodynamic Properties of the Solution
106 //! @{
107
108 /**
109 * Molar enthalpy of the solution. Units: J/kmol. For an ideal, constant
110 * partial molar volume solution mixture with pure species phases which
111 * exhibit zero volume expansivity and zero isothermal compressibility:
112 * \f[
113 * \hat h(T,P) = \sum_k X_k \hat h^0_k(T) + (P - P_{ref}) (\sum_k X_k \hat V^0_k)
114 * \f]
115 * The reference-state pure-species enthalpies at the reference pressure Pref
116 * \f$ \hat h^0_k(T) \f$, are computed by the species thermodynamic
117 * property manager. They are polynomial functions of temperature.
118 * @see MultiSpeciesThermo
119 */
120 virtual doublereal enthalpy_mole() const;
121
122 /**
123 * Molar entropy of the solution. Units: J/kmol/K. For an ideal, constant
124 * partial molar volume solution mixture with pure species phases which
125 * exhibit zero volume expansivity:
126 * \f[
127 * \hat s(T, P, X_k) = \sum_k X_k \hat s^0_k(T) - \hat R \sum_k X_k log(X_k)
128 * \f]
129 * The reference-state pure-species entropies
130 * \f$ \hat s^0_k(T,p_{ref}) \f$ are computed by the species thermodynamic
131 * property manager. The pure species entropies are independent of
132 * pressure since the volume expansivities are equal to zero.
133 * @see MultiSpeciesThermo
134 */
135 virtual doublereal entropy_mole() const;
136
137 /**
138 * Molar Gibbs free energy of the solution. Units: J/kmol. For an ideal,
139 * constant partial molar volume solution mixture with pure species phases
140 * which exhibit zero volume expansivity:
141 * \f[
142 * \hat g(T, P) = \sum_k X_k \hat g^0_k(T,P) + \hat R T \sum_k X_k log(X_k)
143 * \f]
144 * The reference-state pure-species Gibbs free energies
145 * \f$ \hat g^0_k(T) \f$ are computed by the species thermodynamic
146 * property manager, while the standard state Gibbs free energies
147 * \f$ \hat g^0_k(T,P) \f$ are computed by the member function, gibbs_RT().
148 * @see MultiSpeciesThermo
149 */
150 virtual doublereal gibbs_mole() const;
151
152 /**
153 * Molar heat capacity at constant pressure of the solution.
154 * Units: J/kmol/K.
155 * For an ideal, constant partial molar volume solution mixture with
156 * pure species phases which exhibit zero volume expansivity:
157 * \f[
158 * \hat c_p(T,P) = \sum_k X_k \hat c^0_{p,k}(T) .
159 * \f]
160 * The heat capacity is independent of pressure. The reference-state pure-
161 * species heat capacities \f$ \hat c^0_{p,k}(T) \f$ are computed by the
162 * species thermodynamic property manager.
163 * @see MultiSpeciesThermo
164 */
165 virtual doublereal cp_mole() const;
166
167 /**
168 * Molar heat capacity at constant volume of the solution. Units: J/kmol/K.
169 * For an ideal, constant partial molar volume solution mixture with pure
170 * species phases which exhibit zero volume expansivity:
171 * \f[ \hat c_v(T,P) = \hat c_p(T,P) \f]
172 * The two heat capacities are equal.
173 */
174 virtual doublereal cv_mole() const {
175 return cp_mole();
176 }
177
178 //! @}
179 /** @name Mechanical Equation of State Properties
180 *
181 * In this equation of state implementation, the density is a function only
182 * of the mole fractions. Therefore, it can't be an independent variable.
183 * Instead, the pressure is used as the independent variable. Functions
184 * which try to set the thermodynamic state by calling setDensity() will
185 * cause an exception to be thrown.
186 */
187 //! @{
188
189 /**
190 * Pressure. Units: Pa. For this incompressible system, we return the
191 * internally stored independent value of the pressure.
192 */
193 virtual doublereal pressure() const {
194 return m_Pcurrent;
195 }
196
197 /**
198 * Set the pressure at constant temperature. Units: Pa. This method sets a
199 * constant within the object. The mass density is not a function of
200 * pressure.
201 *
202 * @param p Input Pressure (Pa)
203 */
204 virtual void setPressure(doublereal p);
205
206 /**
207 * Calculate the density of the mixture using the partial molar volumes and
208 * mole fractions as input
209 *
210 * The formula for this is
211 *
212 * \f[
213 * \rho = \frac{\sum_k{X_k W_k}}{\sum_k{X_k V_k}}
214 * \f]
215 *
216 * where \f$X_k\f$ are the mole fractions, \f$W_k\f$ are the molecular
217 * weights, and \f$V_k\f$ are the pure species molar volumes.
218 *
219 * Note, the basis behind this formula is that in an ideal solution the
220 * partial molar volumes are equal to the pure species molar volumes. We
221 * have additionally specified in this class that the pure species molar
222 * volumes are independent of temperature and pressure.
223 */
224 virtual void calcDensity();
225
226 //! @}
227
228 /**
229 * @name Chemical Potentials and Activities
230 *
231 * The activity \f$a_k\f$ of a species in solution is related to the
232 * chemical potential by
233 * \f[
234 * \mu_k(T,P,X_k) = \mu_k^0(T,P)
235 * + \hat R T \log a_k.
236 * \f]
237 * The quantity \f$\mu_k^0(T,P)\f$ is the standard state chemical potential
238 * at unit activity. It may depend on the pressure and the temperature.
239 * However, it may not depend on the mole fractions of the species in the
240 * solid solution.
241 *
242 * The activities are related to the generalized concentrations, \f$\tilde
243 * C_k\f$, and standard concentrations, \f$C^0_k\f$, by the following
244 * formula:
245 *
246 * \f[
247 * a_k = \frac{\tilde C_k}{C^0_k}
248 * \f]
249 * The generalized concentrations are used in the kinetics classes to
250 * describe the rates of progress of reactions involving the species. Their
251 * formulation depends upon the specification of the rate constants for
252 * reaction, especially the units used in specifying the rate constants. The
253 * bridge between the thermodynamic equilibrium expressions that use a_k and
254 * the kinetics expressions which use the generalized concentrations is
255 * provided by the multiplicative factor of the standard concentrations.
256 * @{
257 */
258
259 virtual Units standardConcentrationUnits() const;
260
261 /**
262 * This method returns the array of generalized concentrations. The
263 * generalized concentrations are used in the evaluation of the rates of
264 * progress for reactions involving species in this phase. The generalized
265 * concentration divided by the standard concentration is also equal to the
266 * activity of species.
267 *
268 * For this implementation the activity is defined to be the mole fraction
269 * of the species. The generalized concentration is defined to be equal to
270 * the mole fraction divided by the partial molar volume. The generalized
271 * concentrations for species in this phase therefore have units of
272 * kmol/m^3. Rate constants must reflect this fact.
273 *
274 * On a general note, the following must be true. For an ideal solution, the
275 * generalized concentration must consist of the mole fraction multiplied by
276 * a constant. The constant may be fairly arbitrarily chosen, with
277 * differences adsorbed into the reaction rate expression. 1/V_N, 1/V_k, or
278 * 1 are equally good, as long as the standard concentration is adjusted
279 * accordingly. However, it must be a constant (and not the concentration,
280 * btw, which is a function of the mole fractions) in order for the ideal
281 * solution properties to hold at the same time having the standard
282 * concentration to be independent of the mole fractions.
283 *
284 * In this implementation the form of the generalized concentrations
285 * depend upon the member attribute, #m_formGC.
286 *
287 * HKM Note: We have absorbed the pressure dependence of the pure species
288 * state into the thermodynamics functions. Therefore the standard
289 * state on which the activities are based depend on both temperature
290 * and pressure. If we hadn't, it would have appeared in this
291 * function in a very awkward exp[] format.
292 *
293 * @param c Pointer to array of doubles of length m_kk, which on exit
294 * will contain the generalized concentrations.
295 */
296 virtual void getActivityConcentrations(doublereal* c) const;
297
298 /**
299 * The standard concentration \f$ C^0_k \f$ used to normalize the
300 * generalized concentration. In many cases, this quantity will be the
301 * same for all species in a phase. However, for this case, we will return
302 * a distinct concentration for each species. This is the inverse of the
303 * species molar volume. Units for the standard concentration are kmol/m^3.
304 *
305 * @param k Species number: this is a require parameter, a change from the
306 * ThermoPhase base class, where it was an optional parameter.
307 */
308 virtual doublereal standardConcentration(size_t k) const;
309
310 //! Get the array of species activity coefficients
311 /*!
312 * @param ac output vector of activity coefficients. Length: m_kk
313 */
314 virtual void getActivityCoefficients(doublereal* ac) const;
315
316 /**
317 * Get the species chemical potentials. Units: J/kmol.
318 *
319 * This function returns a vector of chemical potentials of the
320 * species in solution.
321 * \f[
322 * \mu_k = \mu^{ref}_k(T) + V_k * (p - p_o) + R T ln(X_k)
323 * \f]
324 * or another way to phrase this is
325 * \f[
326 * \mu_k = \mu^o_k(T,p) + R T ln(X_k)
327 * \f]
328 * where \f$ \mu^o_k(T,p) = \mu^{ref}_k(T) + V_k * (p - p_o)\f$
329 *
330 * @param mu Output vector of chemical potentials.
331 */
332 virtual void getChemPotentials(doublereal* mu) const;
333
334 /**
335 * Get the array of non-dimensional species solution
336 * chemical potentials at the current T and P
337 * \f$\mu_k / \hat R T \f$.
338 * \f[
339 * \mu^0_k(T,P) = \mu^{ref}_k(T) + (P - P_{ref}) * V_k + RT ln(X_k)
340 * \f]
341 * where \f$V_k\f$ is the molar volume of pure species *k*.
342 * \f$ \mu^{ref}_k(T)\f$ is the chemical potential of pure
343 * species *k* at the reference pressure, \f$P_{ref}\f$.
344 *
345 * @param mu Output vector of dimensionless chemical potentials.
346 * Length = m_kk.
347 */
348 virtual void getChemPotentials_RT(doublereal* mu) const;
349
350 //! @}
351 /// @name Partial Molar Properties of the Solution
352 //! @{
353
354 //! Returns an array of partial molar enthalpies for the species in the
355 //! mixture.
356 /*!
357 * Units (J/kmol). For this phase, the partial molar enthalpies are equal to
358 * the pure species enthalpies
359 * \f[
360 * \bar h_k(T,P) = \hat h^{ref}_k(T) + (P - P_{ref}) \hat V^0_k
361 * \f]
362 * The reference-state pure-species enthalpies, \f$ \hat h^{ref}_k(T) \f$,
363 * at the reference pressure,\f$ P_{ref} \f$, are computed by the species
364 * thermodynamic property manager. They are polynomial functions of
365 * temperature.
366 * @see MultiSpeciesThermo
367 *
368 * @param hbar Output vector containing partial molar enthalpies.
369 * Length: m_kk.
370 */
371 virtual void getPartialMolarEnthalpies(doublereal* hbar) const;
372
373 /**
374 * Returns an array of partial molar entropies of the species in the
375 * solution. Units: J/kmol/K. For this phase, the partial molar entropies
376 * are equal to the pure species entropies plus the ideal solution
377 * contribution.
378 * \f[
379 * \bar s_k(T,P) = \hat s^0_k(T) - R log(X_k)
380 * \f]
381 * The reference-state pure-species entropies,\f$ \hat s^{ref}_k(T) \f$, at
382 * the reference pressure, \f$ P_{ref} \f$, are computed by the species
383 * thermodynamic property manager. They are polynomial functions of
384 * temperature.
385 * @see MultiSpeciesThermo
386 *
387 * @param sbar Output vector containing partial molar entropies.
388 * Length: m_kk.
389 */
390 virtual void getPartialMolarEntropies(doublereal* sbar) const;
391
392 /**
393 * Returns an array of partial molar Heat Capacities at constant pressure of
394 * the species in the solution. Units: J/kmol/K. For this phase, the partial
395 * molar heat capacities are equal to the standard state heat capacities.
396 *
397 * @param cpbar Output vector of partial heat capacities. Length: m_kk.
398 */
399 virtual void getPartialMolarCp(doublereal* cpbar) const;
400
401 /**
402 * returns an array of partial molar volumes of the species
403 * in the solution. Units: m^3 kmol-1.
404 *
405 * For this solution, the partial molar volumes are equal to the
406 * constant species molar volumes.
407 *
408 * @param vbar Output vector of partial molar volumes. Length: m_kk.
409 */
410 virtual void getPartialMolarVolumes(doublereal* vbar) const;
411
412 //! @}
413 /// @name Properties of the Standard State of the Species in the Solution
414 //! @{
415
416 /**
417 * Get the standard state chemical potentials of the species. This is the
418 * array of chemical potentials at unit activity \f$ \mu^0_k(T,P) \f$. We
419 * define these here as the chemical potentials of the pure species at the
420 * temperature and pressure of the solution. This function is used in the
421 * evaluation of the equilibrium constant Kc. Therefore, Kc will also depend
422 * on T and P. This is the norm for liquid and solid systems.
423 *
424 * units = J / kmol
425 *
426 * @param mu0 Output vector of standard state chemical potentials.
427 * Length: m_kk.
428 */
429 virtual void getStandardChemPotentials(doublereal* mu0) const {
430 getPureGibbs(mu0);
431 }
432
433 //! Get the array of nondimensional Enthalpy functions for the standard
434 //! state species at the current *T* and *P* of the solution.
435 /*!
436 * We assume an incompressible constant partial molar volume here:
437 * \f[
438 * h^0_k(T,P) = h^{ref}_k(T) + (P - P_{ref}) * V_k
439 * \f]
440 * where \f$V_k\f$ is the molar volume of pure species *k*.
441 * \f$ h^{ref}_k(T)\f$ is the enthalpy of the pure species *k* at the
442 * reference pressure, \f$P_{ref}\f$.
443 *
444 * @param hrt Vector of length m_kk, which on return hrt[k] will contain the
445 * nondimensional standard state enthalpy of species k.
446 */
447 virtual void getEnthalpy_RT(doublereal* hrt) const;
448
449 //! Get the nondimensional Entropies for the species standard states at the
450 //! current T and P of the solution.
451 /*!
452 * Note, this is equal to the reference state entropies due to the zero
453 * volume expansivity: that is, (dS/dP)_T = (dV/dT)_P = 0.0
454 *
455 * @param sr Vector of length m_kk, which on return sr[k] will contain the
456 * nondimensional standard state entropy for species k.
457 */
458 virtual void getEntropy_R(doublereal* sr) const;
459
460 /**
461 * Get the nondimensional Gibbs function for the species standard states at
462 * the current T and P of the solution.
463 *
464 * \f[
465 * \mu^0_k(T,P) = \mu^{ref}_k(T) + (P - P_{ref}) * V_k
466 * \f]
467 * where \f$V_k\f$ is the molar volume of pure species *k*.
468 * \f$ \mu^{ref}_k(T)\f$ is the chemical potential of pure species *k*
469 * at the reference pressure, \f$P_{ref}\f$.
470 *
471 * @param grt Vector of length m_kk, which on return sr[k] will contain the
472 * nondimensional standard state Gibbs function for species k.
473 */
474 virtual void getGibbs_RT(doublereal* grt) const;
475
476 /**
477 * Get the Gibbs functions for the pure species at the current *T* and *P*
478 * of the solution. We assume an incompressible constant partial molar
479 * volume here:
480 * \f[
481 * \mu^0_k(T,P) = \mu^{ref}_k(T) + (P - P_{ref}) * V_k
482 * \f]
483 * where \f$V_k\f$ is the molar volume of pure species *k*.
484 * \f$ \mu^{ref}_k(T)\f$ is the chemical potential of pure species *k* at
485 * the reference pressure, \f$P_{ref}\f$.
486 *
487 * @param gpure Output vector of Gibbs functions for species. Length: m_kk.
488 */
489 virtual void getPureGibbs(doublereal* gpure) const;
490
491 virtual void getIntEnergy_RT(doublereal* urt) const;
492
493 /**
494 * Get the nondimensional heat capacity at constant pressure function for
495 * the species standard states at the current T and P of the solution.
496 * \f[
497 * Cp^0_k(T,P) = Cp^{ref}_k(T)
498 * \f]
499 * where \f$V_k\f$ is the molar volume of pure species *k*.
500 * \f$ Cp^{ref}_k(T)\f$ is the constant pressure heat capacity of species
501 * *k* at the reference pressure, \f$p_{ref}\f$.
502 *
503 * @param cpr Vector of length m_kk, which on return cpr[k] will contain the
504 * nondimensional constant pressure heat capacity for species k.
505 */
506 virtual void getCp_R(doublereal* cpr) const;
507
508 virtual void getStandardVolumes(doublereal* vol) const;
509
510 //! @}
511 /// @name Thermodynamic Values for the Species Reference States
512 //! @{
513
514 virtual void getEnthalpy_RT_ref(doublereal* hrt) const;
515 virtual void getGibbs_RT_ref(doublereal* grt) const;
516 virtual void getGibbs_ref(doublereal* g) const;
517 virtual void getEntropy_R_ref(doublereal* er) const;
518 virtual void getIntEnergy_RT_ref(doublereal* urt) const;
519 virtual void getCp_R_ref(doublereal* cprt) const;
520
521 /**
522 * Returns a reference to the vector of nondimensional enthalpies of the
523 * reference state at the current temperature. Real reason for its existence
524 * is that it also checks to see if a recalculation of the reference
525 * thermodynamics functions needs to be done.
526 */
527 const vector_fp& enthalpy_RT_ref() const;
528
529 /**
530 * Returns a reference to the vector of nondimensional enthalpies of the
531 * reference state at the current temperature. Real reason for its existence
532 * is that it also checks to see if a recalculation of the reference
533 * thermodynamics functions needs to be done.
534 */
535 const vector_fp& gibbs_RT_ref() const {
536 _updateThermo();
537 return m_g0_RT;
538 }
539
540 /**
541 * Returns a reference to the vector of nondimensional enthalpies of the
542 * reference state at the current temperature. Real reason for its existence
543 * is that it also checks to see if a recalculation of the reference
544 * thermodynamics functions needs to be done.
545 */
546 const vector_fp& entropy_R_ref() const;
547
548 /**
549 * Returns a reference to the vector of nondimensional enthalpies of the
550 * reference state at the current temperature. Real reason for its existence
551 * is that it also checks to see if a recalculation of the reference
552 * thermodynamics functions needs to be done.
553 */
554 const vector_fp& cp_R_ref() const {
555 _updateThermo();
556 return m_cp0_R;
557 }
558
559 //! @}
560 //! @name Utility Functions
561 //! @{
562
563 virtual bool addSpecies(shared_ptr<Species> spec);
564 virtual void initThermo();
565 virtual void getParameters(AnyMap& phaseNode) const;
566 virtual void getSpeciesParameters(const std::string& name,
567 AnyMap& speciesNode) const;
568 virtual void initThermoXML(XML_Node& phaseNode, const std::string& id);
569 virtual void setToEquilState(const doublereal* mu_RT);
570
571 //! Set the form for the standard and generalized concentrations
572 /*!
573 * Must be one of 'unity', 'species-molar-volume', or
574 * 'solvent-molar-volume'. The default is 'unity'.
575 *
576 * | m_formGC | GeneralizedConc | StandardConc |
577 * | -------------------- | --------------- | ------------ |
578 * | unity | X_k | 1.0 |
579 * | species-molar-volume | X_k / V_k | 1.0 / V_k |
580 * | solvent-molar-volume | X_k / V_N | 1.0 / V_N |
581 *
582 * The value and form of the generalized concentration will affect
583 * reaction rate constants involving species in this phase.
584 */
585 void setStandardConcentrationModel(const std::string& model);
586
587 /**
588 * Report the molar volume of species k
589 *
590 * units - \f$ m^3 kmol^-1 \f$
591 *
592 * @param k species index
593 */
594 double speciesMolarVolume(int k) const;
595
596 /**
597 * Fill in a return vector containing the species molar volumes.
598 *
599 * units - \f$ m^3 kmol^-1 \f$
600 *
601 * @param smv output vector containing species molar volumes.
602 * Length: m_kk.
603 */
604 void getSpeciesMolarVolumes(doublereal* smv) const;
605
606 //! @}
607
608 protected:
609 virtual void compositionChanged();
610
611 /**
612 * The standard concentrations can have one of three different forms:
613 * 0 = 'unity', 1 = 'molar_volume', 2 = 'solvent_volume'. See
614 * setStandardConcentrationModel().
615 */
616 int m_formGC;
617
618 /**
619 * Value of the reference pressure for all species in this phase. The T
620 * dependent polynomials are evaluated at the reference pressure. Note,
621 * because this is a single value, all species are required to have the same
622 * reference pressure.
623 */
624 doublereal m_Pref;
625
626 /**
627 * m_Pcurrent = The current pressure
628 * Since the density isn't a function of pressure, but only of the
629 * mole fractions, we need to independently specify the pressure.
630 * The density variable which is inherited as part of the State class,
631 * m_dens, is always kept current whenever T, P, or X[] change.
632 */
633 doublereal m_Pcurrent;
634
635 //! Vector of molar volumes for each species in the solution
636 /**
637 * Species molar volumes \f$ m^3 kmol^-1 \f$
638 */
639 vector_fp m_speciesMolarVolume;
640
641 //! Vector containing the species reference enthalpies at T = m_tlast
642 mutable vector_fp m_h0_RT;
643
644 //! Vector containing the species reference constant pressure heat
645 //! capacities at T = m_tlast
646 mutable vector_fp m_cp0_R;
647
648 //! Vector containing the species reference Gibbs functions at T = m_tlast
649 mutable vector_fp m_g0_RT;
650
651 //! Vector containing the species reference entropies at T = m_tlast
652 mutable vector_fp m_s0_R;
653
654 //! Vector containing the species reference exp(-G/RT) functions at
655 //! T = m_tlast
656 mutable vector_fp m_expg0_RT;
657
658 //! Temporary array used in equilibrium calculations
659 mutable vector_fp m_pp;
660
661 private:
662 //! @name Utility Functions
663 //! @{
664 /**
665 * This function gets called for every call to functions in this class. It
666 * checks to see whether the temperature has changed and thus the reference
667 * thermodynamics functions for all of the species must be recalculated. If
668 * the temperature has changed, the species thermo manager is called to
669 * recalculate G, Cp, H, and S at the current temperature.
670 */
671 virtual void _updateThermo() const;
672
673 //! @}
674};
675}
676
677#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::IdealSolidSolnPhase
Class IdealSolidSolnPhase represents a condensed phase ideal solution compound.
Definition: IdealSolidSolnPhase.h:40
Cantera::IdealSolidSolnPhase::m_g0_RT
vector_fp m_g0_RT
Vector containing the species reference Gibbs functions at T = m_tlast.
Definition: IdealSolidSolnPhase.h:649
Cantera::IdealSolidSolnPhase::m_cp0_R
vector_fp m_cp0_R
Vector containing the species reference constant pressure heat capacities at T = m_tlast.
Definition: IdealSolidSolnPhase.h:646
Cantera::IdealSolidSolnPhase::addSpecies
virtual bool addSpecies(shared_ptr< Species > spec)
Definition: IdealSolidSolnPhase.cpp:372
Cantera::IdealSolidSolnPhase::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: IdealSolidSolnPhase.cpp:316
Cantera::IdealSolidSolnPhase::getParameters
virtual void getParameters(AnyMap &phaseNode) const
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
Definition: IdealSolidSolnPhase.cpp:427
Cantera::IdealSolidSolnPhase::getActivityCoefficients
virtual void getActivityCoefficients(doublereal *ac) const
Get the array of species activity coefficients.
Definition: IdealSolidSolnPhase.cpp:188
Cantera::IdealSolidSolnPhase::m_expg0_RT
vector_fp m_expg0_RT
Vector containing the species reference exp(-G/RT) functions at T = m_tlast.
Definition: IdealSolidSolnPhase.h:656
Cantera::IdealSolidSolnPhase::getGibbs_RT
virtual void getGibbs_RT(doublereal *grt) const
Get the nondimensional Gibbs function for the species standard states at the current T and P of the s...
Definition: IdealSolidSolnPhase.cpp:262
Cantera::IdealSolidSolnPhase::cp_mole
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure of the solution.
Definition: IdealSolidSolnPhase.cpp:108
Cantera::IdealSolidSolnPhase::m_h0_RT
vector_fp m_h0_RT
Vector containing the species reference enthalpies at T = m_tlast.
Definition: IdealSolidSolnPhase.h:642
Cantera::IdealSolidSolnPhase::getPartialMolarEnthalpies
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
Definition: IdealSolidSolnPhase.cpp:219
Cantera::IdealSolidSolnPhase::speciesMolarVolume
double speciesMolarVolume(int k) const
Report the molar volume of species k.
Definition: IdealSolidSolnPhase.cpp:545
Cantera::IdealSolidSolnPhase::getPartialMolarEntropies
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
Definition: IdealSolidSolnPhase.cpp:229
Cantera::IdealSolidSolnPhase::initThermoXML
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
Definition: IdealSolidSolnPhase.cpp:464
Cantera::IdealSolidSolnPhase::enthalpy_mole
virtual doublereal enthalpy_mole() const
Molar enthalpy of the solution.
Definition: IdealSolidSolnPhase.cpp:92
Cantera::IdealSolidSolnPhase::setToEquilState
virtual void setToEquilState(const doublereal *mu_RT)
This method is used by the ChemEquil equilibrium solver.
Definition: IdealSolidSolnPhase.cpp:500
Cantera::IdealSolidSolnPhase::getPartialMolarVolumes
virtual void getPartialMolarVolumes(doublereal *vbar) const
returns an array of partial molar volumes of the species in the solution.
Definition: IdealSolidSolnPhase.cpp:246
Cantera::IdealSolidSolnPhase::m_pp
vector_fp m_pp
Temporary array used in equilibrium calculations.
Definition: IdealSolidSolnPhase.h:659
Cantera::IdealSolidSolnPhase::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: IdealSolidSolnPhase.cpp:301
Cantera::IdealSolidSolnPhase::m_s0_R
vector_fp m_s0_R
Vector containing the species reference entropies at T = m_tlast.
Definition: IdealSolidSolnPhase.h:652
Cantera::IdealSolidSolnPhase::getActivityConcentrations
virtual void getActivityConcentrations(doublereal *c) const
This method returns the array of generalized concentrations.
Definition: IdealSolidSolnPhase.cpp:151
Cantera::IdealSolidSolnPhase::cp_R_ref
const vector_fp & cp_R_ref() const
Returns a reference to the vector of nondimensional enthalpies of the reference state at the current ...
Definition: IdealSolidSolnPhase.h:554
Cantera::IdealSolidSolnPhase::getCp_R
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional heat capacity at constant pressure function for the species standard states at...
Definition: IdealSolidSolnPhase.cpp:295
Cantera::IdealSolidSolnPhase::getStandardChemPotentials
virtual void getStandardChemPotentials(doublereal *mu0) const
Get the standard state chemical potentials of the species.
Definition: IdealSolidSolnPhase.h:429
Cantera::IdealSolidSolnPhase::IdealSolidSolnPhase
IdealSolidSolnPhase(int formCG=-1)
Constructor for IdealSolidSolnPhase.
Definition: IdealSolidSolnPhase.cpp:23
Cantera::IdealSolidSolnPhase::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: IdealSolidSolnPhase.cpp:238
Cantera::IdealSolidSolnPhase::getSpeciesMolarVolumes
void getSpeciesMolarVolumes(doublereal *smv) const
Fill in a return vector containing the species molar volumes.
Definition: IdealSolidSolnPhase.cpp:550
Cantera::IdealSolidSolnPhase::enthalpy_RT_ref
const vector_fp & enthalpy_RT_ref() const
Returns a reference to the vector of nondimensional enthalpies of the reference state at the current ...
Definition: IdealSolidSolnPhase.cpp:358
Cantera::IdealSolidSolnPhase::isCompressible
virtual bool isCompressible() const
Return whether phase represents a compressible substance.
Definition: IdealSolidSolnPhase.h:101
Cantera::IdealSolidSolnPhase::getEntropy_R
virtual void getEntropy_R(doublereal *sr) const
Get the nondimensional Entropies for the species standard states at the current T and P of the soluti...
Definition: IdealSolidSolnPhase.cpp:280
Cantera::IdealSolidSolnPhase::cv_mole
virtual doublereal cv_mole() const
Molar heat capacity at constant volume of the solution.
Definition: IdealSolidSolnPhase.h:174
Cantera::IdealSolidSolnPhase::setPressure
virtual void setPressure(doublereal p)
Set the pressure at constant temperature.
Definition: IdealSolidSolnPhase.cpp:127
Cantera::IdealSolidSolnPhase::m_speciesMolarVolume
vector_fp m_speciesMolarVolume
Vector of molar volumes for each species in the solution.
Definition: IdealSolidSolnPhase.h:639
Cantera::IdealSolidSolnPhase::entropy_mole
virtual doublereal entropy_mole() const
Molar entropy of the solution.
Definition: IdealSolidSolnPhase.cpp:98
Cantera::IdealSolidSolnPhase::entropy_R_ref
const vector_fp & entropy_R_ref() const
Returns a reference to the vector of nondimensional enthalpies of the reference state at the current ...
Definition: IdealSolidSolnPhase.cpp:364
Cantera::IdealSolidSolnPhase::initThermo
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
Definition: IdealSolidSolnPhase.cpp:419
Cantera::IdealSolidSolnPhase::standardConcentration
virtual doublereal standardConcentration(size_t k) const
The standard concentration used to normalize the generalized concentration.
Definition: IdealSolidSolnPhase.cpp:175
Cantera::IdealSolidSolnPhase::gibbs_RT_ref
const vector_fp & gibbs_RT_ref() const
Returns a reference to the vector of nondimensional enthalpies of the reference state at the current ...
Definition: IdealSolidSolnPhase.h:535
Cantera::IdealSolidSolnPhase::getEntropy_R_ref
virtual void getEntropy_R_ref(doublereal *er) const
Returns the vector of nondimensional entropies of the reference state at the current temperature of t...
Definition: IdealSolidSolnPhase.cpp:342
Cantera::IdealSolidSolnPhase::m_formGC
int m_formGC
The standard concentrations can have one of three different forms: 0 = 'unity', 1 = 'molar_volume',...
Definition: IdealSolidSolnPhase.h:616
Cantera::IdealSolidSolnPhase::type
virtual std::string type() const
String indicating the thermodynamic model implemented.
Definition: IdealSolidSolnPhase.h:93
Cantera::IdealSolidSolnPhase::getIntEnergy_RT_ref
virtual void getIntEnergy_RT_ref(doublereal *urt) const
Returns the vector of nondimensional internal Energies of the reference state at the current temperat...
Definition: IdealSolidSolnPhase.cpp:333
Cantera::IdealSolidSolnPhase::getIntEnergy_RT
virtual void getIntEnergy_RT(doublereal *urt) const
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
Definition: IdealSolidSolnPhase.cpp:286
Cantera::IdealSolidSolnPhase::gibbs_mole
virtual doublereal gibbs_mole() const
Molar Gibbs free energy of the solution.
Definition: IdealSolidSolnPhase.cpp:103
Cantera::IdealSolidSolnPhase::m_Pcurrent
doublereal m_Pcurrent
m_Pcurrent = The current pressure Since the density isn't a function of pressure, but only of the mol...
Definition: IdealSolidSolnPhase.h:633
Cantera::IdealSolidSolnPhase::pressure
virtual doublereal pressure() const
Pressure.
Definition: IdealSolidSolnPhase.h:193
Cantera::IdealSolidSolnPhase::getCp_R_ref
virtual void getCp_R_ref(doublereal *cprt) const
Returns the vector of nondimensional constant pressure heat capacities of the reference state at the ...
Definition: IdealSolidSolnPhase.cpp:350
Cantera::IdealSolidSolnPhase::standardConcentrationUnits
virtual Units standardConcentrationUnits() const
Returns the units of the "standard concentration" for this phase.
Definition: IdealSolidSolnPhase.cpp:141
Cantera::IdealSolidSolnPhase::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: IdealSolidSolnPhase.cpp:437
Cantera::IdealSolidSolnPhase::compositionChanged
virtual void compositionChanged()
Apply changes to the state which are needed after the composition changes.
Definition: IdealSolidSolnPhase.cpp:133
Cantera::IdealSolidSolnPhase::isIdeal
virtual bool isIdeal() const
Boolean indicating whether phase is ideal.
Definition: IdealSolidSolnPhase.h:97
Cantera::IdealSolidSolnPhase::getChemPotentials_RT
virtual void getChemPotentials_RT(doublereal *mu) const
Get the array of non-dimensional species solution chemical potentials at the current T and P .
Definition: IdealSolidSolnPhase.cpp:206
Cantera::IdealSolidSolnPhase::setStandardConcentrationModel
void setStandardConcentrationModel(const std::string &model)
Set the form for the standard and generalized concentrations.
Definition: IdealSolidSolnPhase.cpp:529
Cantera::IdealSolidSolnPhase::_updateThermo
virtual void _updateThermo() const
This function gets called for every call to functions in this class.
Definition: IdealSolidSolnPhase.cpp:555
Cantera::IdealSolidSolnPhase::getChemPotentials
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials.
Definition: IdealSolidSolnPhase.cpp:195
Cantera::IdealSolidSolnPhase::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: IdealSolidSolnPhase.cpp:324
Cantera::IdealSolidSolnPhase::m_Pref
doublereal m_Pref
Value of the reference pressure for all species in this phase.
Definition: IdealSolidSolnPhase.h:624
Cantera::IdealSolidSolnPhase::getEnthalpy_RT
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the array of nondimensional Enthalpy functions for the standard state species at the current T an...
Definition: IdealSolidSolnPhase.cpp:271
Cantera::IdealSolidSolnPhase::getPureGibbs
virtual void getPureGibbs(doublereal *gpure) const
Get the Gibbs functions for the pure species at the current T and P of the solution.
Definition: IdealSolidSolnPhase.cpp:253
Cantera::IdealSolidSolnPhase::getEnthalpy_RT_ref
virtual void getEnthalpy_RT_ref(doublereal *hrt) const
Returns the vector of nondimensional enthalpies of the reference state at the current temperature of ...
Definition: IdealSolidSolnPhase.cpp:308
Cantera::IdealSolidSolnPhase::calcDensity
virtual void calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
Definition: IdealSolidSolnPhase.cpp:115
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