| Cantera 3.0.0

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