Cantera  3.1.0b1
Loading...
Searching...
No Matches
StoichSubstance.h
Go to the documentation of this file.
1/**
2 * @file StoichSubstance.h
3 * Header file for the StoichSubstance class, which represents a fixed-composition
4 * incompressible substance (see @ref thermoprops and
5 * class @link Cantera::StoichSubstance StoichSubstance@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_STOICHSUBSTANCE_H
12#define CT_STOICHSUBSTANCE_H
13
14#include "SingleSpeciesTP.h"
15
16namespace Cantera
17{
18
19//! Class StoichSubstance represents a stoichiometric (fixed composition)
20//! incompressible substance.
21/*!
22 * This class internally changes the independent degree of freedom from density
23 * to pressure. This is necessary because the phase is incompressible. It uses a
24 * constant volume approximation.
25 *
26 * ## Specification of Species Standard State Properties
27 *
28 * This class inherits from SingleSpeciesTP. It is assumed that the reference
29 * state thermodynamics may be obtained by a pointer to a populated species
30 * thermodynamic property manager class (see ThermoPhase::m_spthermo). How to
31 * relate pressure changes to the reference state thermodynamics is resolved at
32 * this level.
33 *
34 * For an incompressible, stoichiometric substance, the molar internal energy is
35 * independent of pressure. Since the thermodynamic properties are specified by
36 * giving the standard-state enthalpy, the term @f$ P_0 \hat v @f$ is subtracted
37 * from the specified molar enthalpy to compute the molar internal energy. The
38 * entropy is assumed to be independent of the pressure.
39 *
40 * The enthalpy function is given by the following relation.
41 *
42 * @f[
43 * h^o_k(T,P) =
44 * h^{ref}_k(T) + \tilde v \left( P - P_{ref} \right)
45 * @f]
46 *
47 * For an incompressible, stoichiometric substance, the molar internal energy is
48 * independent of pressure. Since the thermodynamic properties are specified by
49 * giving the standard-state enthalpy, the term @f$ P_{ref} \tilde v @f$ is
50 * subtracted from the specified reference molar enthalpy to compute the molar
51 * internal energy.
52 *
53 * @f[
54 * u^o_k(T,P) = h^{ref}_k(T) - P_{ref} \tilde v
55 * @f]
56 *
57 * The standard state heat capacity and entropy are independent of pressure. The
58 * standard state Gibbs free energy is obtained from the enthalpy and entropy
59 * functions.
60 *
61 * ## Specification of Solution Thermodynamic Properties
62 *
63 * All solution properties are obtained from the standard state species
64 * functions, since there is only one species in the phase.
65 *
66 * ## Application within Kinetics Managers
67 *
68 * The standard concentration is equal to 1.0. This means that the kinetics
69 * operator works on an (activities basis). Since this is a stoichiometric
70 * substance, this means that the concentration of this phase drops out of
71 * kinetics expressions.
72 *
73 * An example of a reaction using this is a sticking coefficient reaction of a
74 * substance in an ideal gas phase on a surface with a bulk phase species in
75 * this phase. In this case, the rate of progress for this reaction,
76 * @f$ R_s @f$, may be expressed via the following equation:
77 * @f[
78 * R_s = k_s C_{gas}
79 * @f]
80 * where the units for @f$ R_s @f$ are kmol m-2 s-1. @f$ C_{gas} @f$ has units
81 * of kmol m-3. Therefore, the kinetic rate constant, @f$ k_s @f$, has units of
82 * m s-1. Nowhere does the concentration of the bulk phase appear in the rate
83 * constant expression, since it's a stoichiometric phase and the activity is
84 * always equal to 1.0.
85 *
86 * @ingroup thermoprops
87 */
89{
90public:
91 //! Construct and initialize a StoichSubstance ThermoPhase object directly
92 //! from an input file
93 /*!
94 * @param infile name of the input file. If blank, an empty phase will be
95 * created.
96 * @param id name of the phase id in the file.
97 * If this is blank, the first phase in the file is used.
98 */
99 explicit StoichSubstance(const string& infile="", const string& id="");
100
101 string type() const override {
102 return "fixed-stoichiometry";
103 }
104
105 bool isCompressible() const override {
106 return false;
107 }
108
109 //! @name Mechanical Equation of State
110 //! @{
111
112 //! Report the Pressure. Units: Pa.
113 /*!
114 * For an incompressible substance, the density is independent of pressure.
115 * This method simply returns the stored pressure value.
116 */
117 double pressure() const override;
118
119 //! Set the pressure at constant temperature. Units: Pa.
120 /*!
121 * For an incompressible substance, the density is independent of pressure.
122 * Therefore, this method only stores the specified pressure value. It does
123 * not modify the density.
124 *
125 * @param p Pressure (units - Pa)
126 */
127 void setPressure(double p) override;
128
129 double isothermalCompressibility() const override;
130 double thermalExpansionCoeff() const override;
131
132 //! @}
133 //! @name Activities, Standard States, and Activity Concentrations
134 //!
135 //! This section is largely handled by parent classes, since there
136 //! is only one species. Therefore, the activity is equal to one.
137 //! @{
138
139 Units standardConcentrationUnits() const override;
140
141 //! This method returns an array of generalized concentrations
142 /*!
143 * @f$ C^a_k @f$ are defined such that @f$ a_k = C^a_k / C^0_k, @f$ where
144 * @f$ C^0_k @f$ is a standard concentration defined below and @f$ a_k @f$
145 * are activities used in the thermodynamic functions. These activity (or
146 * generalized) concentrations are used by kinetics manager classes to
147 * compute the forward and reverse rates of elementary reactions.
148 *
149 * For a stoichiometric substance, there is only one species, and the
150 * generalized concentration is 1.0.
151 *
152 * @param c Output array of generalized concentrations. The
153 * units depend upon the implementation of the
154 * reaction rate expressions within the phase.
155 */
156 void getActivityConcentrations(double* c) const override;
157
158 //! Return the standard concentration for the kth species
159 /*!
160 * The standard concentration @f$ C^0_k @f$ used to normalize the activity
161 * (that is, generalized) concentration. This phase assumes that the kinetics
162 * operator works on an dimensionless basis. Thus, the standard
163 * concentration is equal to 1.0.
164 *
165 * @param k Optional parameter indicating the species. The default
166 * is to assume this refers to species 0.
167 * @return
168 * Returns The standard Concentration as 1.0
169 */
170 double standardConcentration(size_t k=0) const override;
171 double logStandardConc(size_t k=0) const override;
172
173 //! Get the array of chemical potentials at unit activity for the species at
174 //! their standard states at the current *T* and *P* of the solution.
175 /*!
176 * For a stoichiometric substance, there is no activity term in the chemical
177 * potential expression, and therefore the standard chemical potential and
178 * the chemical potential are both equal to the molar Gibbs function.
179 *
180 * These are the standard state chemical potentials @f$ \mu^0_k(T,P) @f$.
181 * The values are evaluated at the current temperature and pressure of the
182 * solution
183 *
184 * @param mu0 Output vector of chemical potentials.
185 * Length: m_kk.
186 */
187 void getStandardChemPotentials(double* mu0) const override;
188
189 //! @}
190 //! @name Properties of the Standard State of the Species in the Solution
191 //! @{
192
193 void getEnthalpy_RT(double* hrt) const override;
194 void getEntropy_R(double* sr) const override;
195 void getGibbs_RT(double* grt) const override;
196 void getCp_R(double* cpr) const override;
197
198 //! Returns the vector of nondimensional Internal Energies of the standard
199 //! state species at the current *T* and *P* of the solution
200 /*!
201 * For an incompressible, stoichiometric substance, the molar internal
202 * energy is independent of pressure. Since the thermodynamic properties
203 * are specified by giving the standard-state enthalpy, the term
204 * @f$ P_{ref} \hat v @f$ is subtracted from the specified reference molar
205 * enthalpy to compute the standard state molar internal energy.
206 *
207 * @param urt output vector of nondimensional standard state
208 * internal energies of the species. Length: m_kk.
209 */
210 void getIntEnergy_RT(double* urt) const override;
211
212 //! @}
213 //! @name Thermodynamic Values for the Species Reference States
214 //! @{
215
216 //! Returns the vector of nondimensional internal Energies of the reference
217 //! state at the current temperature of the solution and the reference
218 //! pressure for each species.
219 /*!
220 * @param urt Output vector of nondimensional reference state internal
221 * energies of the species. Length: m_kk
222 */
223 void getIntEnergy_RT_ref(double* urt) const override;
224 //! @}
225
226 void initThermo() override;
227 void getSpeciesParameters(const string& name, AnyMap& speciesNode) const override;
228};
229
230}
231
232#endif
Header for the SingleSpeciesTP class, which is a filter class for ThermoPhase, that eases the constru...
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:431
string name() const
Return the name of the phase.
Definition Phase.cpp:20
The SingleSpeciesTP class is a filter class for ThermoPhase.
Class StoichSubstance represents a stoichiometric (fixed composition) incompressible substance.
void getStandardChemPotentials(double *mu0) const override
Get the array of chemical potentials at unit activity for the species at their standard states at the...
double logStandardConc(size_t k=0) const override
Natural logarithm of the standard concentration of the kth species.
double thermalExpansionCoeff() const override
Return the volumetric thermal expansion coefficient. Units: 1/K.
double pressure() const override
Report the Pressure. Units: Pa.
bool isCompressible() const override
Return whether phase represents a compressible substance.
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...
void getEntropy_R(double *sr) const override
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
void getCp_R(double *cpr) const override
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
string type() const override
String indicating the thermodynamic model implemented.
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
void getActivityConcentrations(double *c) const override
This method returns an array of generalized concentrations.
void setPressure(double p) override
Set the pressure at constant temperature. Units: Pa.
void getIntEnergy_RT_ref(double *urt) const override
Returns the vector of nondimensional internal Energies of the reference state at the current temperat...
void getEnthalpy_RT(double *hrt) const override
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
double isothermalCompressibility() const override
Returns the isothermal compressibility. Units: 1/Pa.
void getGibbs_RT(double *grt) const override
Get the nondimensional Gibbs functions for the species in their standard states at the current T and ...
void getIntEnergy_RT(double *urt) const override
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
Units standardConcentrationUnits() const override
Returns the units of the "standard concentration" for this phase.
double standardConcentration(size_t k=0) const override
Return the standard concentration for the kth species.
A representation of the units associated with a dimensional quantity.
Definition Units.h:35
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595