Cantera 2.6.0

SurfPhase.cpp
Go to the documentation of this file.
1/**
2 * @file SurfPhase.cpp
3 * Definitions for a simple thermodynamic model of a surface phase
4 * derived from ThermoPhase, assuming an ideal solution model
5 * (see \ref thermoprops and class
6 * \link Cantera::SurfPhase SurfPhase\endlink).
7 */
8
9// This file is part of Cantera. See License.txt in the top-level directory or
10// at https://cantera.org/license.txt for license and copyright information.
11
12#include "cantera/thermo/SurfPhase.h"
13#include "cantera/thermo/EdgePhase.h"
14#include "cantera/thermo/ThermoFactory.h"
15#include "cantera/thermo/Species.h"
16#include "cantera/base/stringUtils.h"
17#include "cantera/base/ctml.h"
18#include "cantera/base/utilities.h"
19
20 using namespace std;
21
22 namespace Cantera
23{
24 SurfPhase::SurfPhase(doublereal n0):
25 m_press(OneAtm)
26{
27 // @todo After Cantera 2.6, this constructor can be deleted and a
28 // default value of "" can be added to for the infile argument of
29 // the other constructor to make this class default constructible.
30 if (n0 != -1.0) {
31 warn_deprecated("SurfPhase(double)", "The 'n0' argument to the "
32 "SurfPhase constructor is deprecated and will be removed after "
33 "Cantera 2.6. Use the 'setSiteDensity' method instead.");
34 } else {
35 n0 = 1.0;
36 }
37 setSiteDensity(n0);
38 setNDim(2);
39}
40
41 SurfPhase::SurfPhase(const std::string& infile, const std::string& id_) :
42 m_n0(1.0),
43 m_press(OneAtm)
44{
45 setNDim(2);
46 initThermoFile(infile, id_);
47}
48
49 SurfPhase::SurfPhase(XML_Node& xmlphase) :
50 m_n0(1.0),
51 m_press(OneAtm)
52{
53 importPhase(xmlphase, this);
54}
55
56doublereal SurfPhase::enthalpy_mole() const
57{
58 if (m_n0 <= 0.0) {
59 return 0.0;
60 }
61 _updateThermo();
62 return mean_X(m_h0);
63}
64
65doublereal SurfPhase::intEnergy_mole() const
66{
67 return enthalpy_mole();
68}
69
70doublereal SurfPhase::entropy_mole() const
71{
72 _updateThermo();
73 doublereal s = 0.0;
74 for (size_t k = 0; k < m_kk; k++) {
75 s += moleFraction(k) * (m_s0[k] -
76 GasConstant * log(std::max(concentration(k) * size(k)/m_n0, SmallNumber)));
77 }
78 return s;
79}
80
81doublereal SurfPhase::cp_mole() const
82{
83 _updateThermo();
84 return mean_X(m_cp0);
85}
86
87doublereal SurfPhase::cv_mole() const
88{
89 return cp_mole();
90}
91
92 void SurfPhase::getPartialMolarEnthalpies(doublereal* hbar) const
93{
94 getEnthalpy_RT(hbar);
95 for (size_t k = 0; k < m_kk; k++) {
96 hbar[k] *= RT();
97 }
98}
99
100 void SurfPhase::getPartialMolarEntropies(doublereal* sbar) const
101{
102 getEntropy_R(sbar);
103 for (size_t k = 0; k < m_kk; k++) {
104 sbar[k] *= GasConstant;
105 }
106}
107
108 void SurfPhase::getPartialMolarCp(doublereal* cpbar) const
109{
110 getCp_R(cpbar);
111 for (size_t k = 0; k < m_kk; k++) {
112 cpbar[k] *= GasConstant;
113 }
114}
115
116// HKM 9/1/11 The partial molar volumes returned here are really partial molar areas.
117// Partial molar volumes for this phase should actually be equal to zero.
118 void SurfPhase::getPartialMolarVolumes(doublereal* vbar) const
119{
120 getStandardVolumes(vbar);
121}
122
123 void SurfPhase::getStandardChemPotentials(doublereal* mu0) const
124{
125 _updateThermo();
126 copy(m_mu0.begin(), m_mu0.end(), mu0);
127}
128
129 void SurfPhase::getChemPotentials(doublereal* mu) const
130{
131 _updateThermo();
132 copy(m_mu0.begin(), m_mu0.end(), mu);
133 getActivityConcentrations(m_work.data());
134 for (size_t k = 0; k < m_kk; k++) {
135 mu[k] += RT() * (log(m_work[k]) - logStandardConc(k));
136 }
137}
138
139 void SurfPhase::getActivityConcentrations(doublereal* c) const
140{
141 getConcentrations(c);
142}
143
144doublereal SurfPhase::standardConcentration(size_t k) const
145{
146 return m_n0/size(k);
147}
148
149doublereal SurfPhase::logStandardConc(size_t k) const
150{
151 return m_logn0 - m_logsize[k];
152}
153
154 void SurfPhase::setParameters(int n, doublereal* const c)
155{
156 warn_deprecated("SurfPhase::setParamters(int, double*)",
157 "To be removed after Cantera 2.6.");
158 if (n != 1) {
159 throw CanteraError("SurfPhase::setParameters",
160 "Bad value for number of parameter");
161 }
162 setSiteDensity(c[0]);
163}
164
165 void SurfPhase::getPureGibbs(doublereal* g) const
166{
167 _updateThermo();
168 copy(m_mu0.begin(), m_mu0.end(), g);
169}
170
171 void SurfPhase::getGibbs_RT(doublereal* grt) const
172{
173 _updateThermo();
174 scale(m_mu0.begin(), m_mu0.end(), grt, 1.0/RT());
175}
176
177 void SurfPhase::getEnthalpy_RT(doublereal* hrt) const
178{
179 _updateThermo();
180 scale(m_h0.begin(), m_h0.end(), hrt, 1.0/RT());
181}
182
183 void SurfPhase::getEntropy_R(doublereal* sr) const
184{
185 _updateThermo();
186 scale(m_s0.begin(), m_s0.end(), sr, 1.0/GasConstant);
187}
188
189 void SurfPhase::getCp_R(doublereal* cpr) const
190{
191 _updateThermo();
192 scale(m_cp0.begin(), m_cp0.end(), cpr, 1.0/GasConstant);
193}
194
195 void SurfPhase::getStandardVolumes(doublereal* vol) const
196{
197 _updateThermo();
198 for (size_t k = 0; k < m_kk; k++) {
199 vol[k] = 1.0/standardConcentration(k);
200 }
201}
202
203 void SurfPhase::getGibbs_RT_ref(doublereal* grt) const
204{
205 getGibbs_RT(grt);
206}
207
208 void SurfPhase::getEnthalpy_RT_ref(doublereal* hrt) const
209{
210 getEnthalpy_RT(hrt);
211}
212
213 void SurfPhase::getEntropy_R_ref(doublereal* sr) const
214{
215 getEntropy_R(sr);
216}
217
218 void SurfPhase::getCp_R_ref(doublereal* cprt) const
219{
220 getCp_R(cprt);
221}
222
223 bool SurfPhase::addSpecies(shared_ptr<Species> spec)
224{
225 bool added = ThermoPhase::addSpecies(spec);
226 if (added) {
227 m_h0.push_back(0.0);
228 m_s0.push_back(0.0);
229 m_cp0.push_back(0.0);
230 m_mu0.push_back(0.0);
231 m_work.push_back(0.0);
232 m_speciesSize.push_back(spec->size);
233 m_logsize.push_back(log(spec->size));
234 if (m_kk == 1) {
235 vector_fp cov{1.0};
236 setCoverages(cov.data());
237 }
238 }
239 return added;
240}
241
242 void SurfPhase::setSiteDensity(doublereal n0)
243{
244 if (n0 <= 0.0) {
245 throw CanteraError("SurfPhase::setSiteDensity",
246 "Site density must be positive. Got {}", n0);
247 }
248 m_n0 = n0;
249 m_logn0 = log(m_n0);
250}
251
252 void SurfPhase::setCoverages(const doublereal* theta)
253{
254 double sum = 0.0;
255 for (size_t k = 0; k < m_kk; k++) {
256 sum += theta[k];
257 }
258 if (sum <= 0.0) {
259 throw CanteraError("SurfPhase::setCoverages",
260 "Sum of Coverage fractions is zero or negative");
261 }
262 for (size_t k = 0; k < m_kk; k++) {
263 m_work[k] = m_n0*theta[k]/(sum*size(k));
264 }
265 // Call the Phase:: class function setConcentrations.
266 setConcentrations(m_work.data());
267}
268
269 void SurfPhase::setCoveragesNoNorm(const doublereal* theta)
270{
271 for (size_t k = 0; k < m_kk; k++) {
272 m_work[k] = m_n0*theta[k]/size(k);
273 }
274 setConcentrationsNoNorm(m_work.data());
275}
276
277 void SurfPhase::getCoverages(doublereal* theta) const
278{
279 getConcentrations(theta);
280 for (size_t k = 0; k < m_kk; k++) {
281 theta[k] *= size(k)/m_n0;
282 }
283}
284
285 void SurfPhase::setCoveragesByName(const std::string& cov)
286{
287 setCoveragesByName(parseCompString(cov, speciesNames()));
288}
289
290 void SurfPhase::setCoveragesByName(const compositionMap& cov)
291{
292 vector_fp cv(m_kk, 0.0);
293 bool ifound = false;
294 for (size_t k = 0; k < m_kk; k++) {
295 double c = getValue(cov, speciesName(k), 0.0);
296 if (c > 0.0) {
297 ifound = true;
298 cv[k] = c;
299 }
300 }
301 if (!ifound) {
302 throw CanteraError("SurfPhase::setCoveragesByName",
303 "Input coverages are all zero or negative");
304 }
305 setCoverages(cv.data());
306}
307
308 void SurfPhase::setState(const AnyMap& state) {
309 if (state.hasKey("coverages")) {
310 if (state["coverages"].is<string>()) {
311 setCoveragesByName(state["coverages"].asString());
312 } else {
313 setCoveragesByName(state["coverages"].asMap<double>());
314 }
315 }
316 ThermoPhase::setState(state);
317}
318
319 void SurfPhase::_updateThermo(bool force) const
320{
321 doublereal tnow = temperature();
322 if (m_tlast != tnow || force) {
323 m_spthermo.update(tnow, m_cp0.data(), m_h0.data(), m_s0.data());
324 m_tlast = tnow;
325 for (size_t k = 0; k < m_kk; k++) {
326 m_h0[k] *= GasConstant * tnow;
327 m_s0[k] *= GasConstant;
328 m_cp0[k] *= GasConstant;
329 m_mu0[k] = m_h0[k] - tnow*m_s0[k];
330 }
331 m_tlast = tnow;
332 }
333}
334
335 void SurfPhase::setParametersFromXML(const XML_Node& eosdata)
336{
337 eosdata._require("model","Surface");
338 doublereal n = getFloat(eosdata, "site_density", "toSI");
339 setSiteDensity(n);
340}
341
342 void SurfPhase::initThermo()
343{
344 if (m_input.hasKey("site-density")) {
345 // Units are kmol/m^2 for surface phases or kmol/m for edge phases
346 setSiteDensity(m_input.convert("site-density",
347 Units(1.0, 0, -static_cast<double>(m_ndim), 0, 0, 0, 1)));
348 }
349}
350
351 void SurfPhase::getParameters(AnyMap& phaseNode) const
352{
353 ThermoPhase::getParameters(phaseNode);
354 phaseNode["site-density"].setQuantity(
355 m_n0, Units(1.0, 0, -static_cast<double>(m_ndim), 0, 0, 0, 1));
356}
357
358 void SurfPhase::setStateFromXML(const XML_Node& state)
359{
360 double t;
361 if (getOptionalFloat(state, "temperature", t, "temperature")) {
362 setTemperature(t);
363 }
364
365 if (state.hasChild("coverages")) {
366 string comp = getChildValue(state,"coverages");
367 setCoveragesByName(comp);
368 }
369}
370
371 EdgePhase::EdgePhase(doublereal n0)
372{
373 if (n0 != -1.0) {
374 warn_deprecated("EdgePhase(double)", "The 'n0' argument to the "
375 "EdgePhase constructor is deprecated and will be removed after "
376 "Cantera 2.6. Use the 'setSiteDensity' method instead.");
377 } else {
378 n0 = 1.0;
379 }
380 setSiteDensity(n0);
381 setNDim(1);
382}
383
384 EdgePhase::EdgePhase(const std::string& infile, const std::string& id_)
385{
386 setNDim(1);
387 initThermoFile(infile, id_);
388}
389
390 void EdgePhase::setParametersFromXML(const XML_Node& eosdata)
391{
392 eosdata._require("model","Edge");
393 doublereal n = getFloat(eosdata, "site_density", "toSI");
394 setSiteDensity(n);
395}
396
397}
EdgePhase.h
Declarations for the EdgePhase ThermoPhase object, which models the interface between two surfaces (s...
Species.h
Declaration for class Cantera::Species.
SurfPhase.h
Header for a simple thermodynamics model of a surface phase derived from ThermoPhase,...
ThermoFactory.h
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
Cantera::AnyMap
A map of string keys to values whose type can vary at runtime.
Definition: AnyMap.h:399
Cantera::AnyMap::convert
double convert(const std::string &key, const std::string &units) const
Convert the item stored by the given key to the units specified in units.
Definition: AnyMap.cpp:1508
Cantera::AnyMap::hasKey
bool hasKey(const std::string &key) const
Returns true if the map contains an item named key.
Definition: AnyMap.cpp:1406
Cantera::CanteraError
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:61
Cantera::EdgePhase::EdgePhase
EdgePhase(const std::string &infile, const std::string &id="")
Construct and initialize an EdgePhase directly from an input file.
Definition: SurfPhase.cpp:384
Cantera::EdgePhase::setParametersFromXML
virtual void setParametersFromXML(const XML_Node &thermoData)
Set the Equation-of-State parameters by reading an XML Node Input.
Definition: SurfPhase.cpp:390
Cantera::MultiSpeciesThermo::update
virtual void update(doublereal T, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state properties for all species.
Definition: MultiSpeciesThermo.cpp:90
Cantera::Phase::getConcentrations
void getConcentrations(double *const c) const
Get the species concentrations (kmol/m^3).
Definition: Phase.cpp:596
Cantera::Phase::mean_X
doublereal mean_X(const doublereal *const Q) const
Evaluate the mole-fraction-weighted mean of an array Q.
Definition: Phase.cpp:717
Cantera::Phase::setConcentrationsNoNorm
virtual void setConcentrationsNoNorm(const double *const conc)
Set the concentrations without ignoring negative concentrations.
Definition: Phase.cpp:623
Cantera::Phase::setNDim
void setNDim(size_t ndim)
Set the number of spatial dimensions (1, 2, or 3).
Definition: Phase.h:645
Cantera::Phase::m_kk
size_t m_kk
Number of species in the phase.
Definition: Phase.h:943
Cantera::Phase::m_ndim
size_t m_ndim
Dimensionality of the phase.
Definition: Phase.h:947
Cantera::Phase::setConcentrations
virtual void setConcentrations(const double *const conc)
Set the concentrations to the specified values within the phase.
Definition: Phase.cpp:601
Cantera::Phase::concentration
double concentration(const size_t k) const
Concentration of species k.
Definition: Phase.cpp:590
Cantera::Phase::speciesName
std::string speciesName(size_t k) const
Name of the species with index k.
Definition: Phase.cpp:200
Cantera::Phase::moleFraction
double moleFraction(size_t k) const
Return the mole fraction of a single species.
Definition: Phase.cpp:548
Cantera::Phase::temperature
doublereal temperature() const
Temperature (K).
Definition: Phase.h:654
Cantera::Phase::setTemperature
virtual void setTemperature(double temp)
Set the internally stored temperature of the phase (K).
Definition: Phase.h:719
Cantera::Phase::speciesNames
const std::vector< std::string > & speciesNames() const
Return a const reference to the vector of species names.
Definition: Phase.cpp:206
Cantera::SurfPhase::setStateFromXML
virtual void setStateFromXML(const XML_Node &state)
Set the initial state of the Surface Phase from an XML_Node.
Definition: SurfPhase.cpp:358
Cantera::SurfPhase::setCoveragesNoNorm
void setCoveragesNoNorm(const doublereal *theta)
Set the surface site fractions to a specified state.
Definition: SurfPhase.cpp:269
Cantera::SurfPhase::setCoveragesByName
void setCoveragesByName(const std::string &cov)
Set the coverages from a string of colon-separated name:value pairs.
Definition: SurfPhase.cpp:285
Cantera::SurfPhase::addSpecies
virtual bool addSpecies(shared_ptr< Species > spec)
Definition: SurfPhase.cpp:223
Cantera::SurfPhase::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: SurfPhase.cpp:203
Cantera::SurfPhase::m_s0
vector_fp m_s0
Temporary storage for the reference state entropies.
Definition: SurfPhase.h:416
Cantera::SurfPhase::getParameters
virtual void getParameters(AnyMap &phaseNode) const
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
Definition: SurfPhase.cpp:351
Cantera::SurfPhase::getGibbs_RT
virtual void getGibbs_RT(doublereal *grt) const
Get the nondimensional Gibbs functions for the species in their standard states at the current T and ...
Definition: SurfPhase.cpp:171
Cantera::SurfPhase::setState
virtual void setState(const AnyMap &state)
Set the state using an AnyMap containing any combination of properties supported by the thermodynamic...
Definition: SurfPhase.cpp:308
Cantera::SurfPhase::cp_mole
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
Definition: SurfPhase.cpp:81
Cantera::SurfPhase::getPartialMolarEnthalpies
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
Definition: SurfPhase.cpp:92
Cantera::SurfPhase::m_speciesSize
vector_fp m_speciesSize
Vector of species sizes (number of sites occupied). length m_kk.
Definition: SurfPhase.h:404
Cantera::SurfPhase::getPartialMolarEntropies
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
Definition: SurfPhase.cpp:100
Cantera::SurfPhase::enthalpy_mole
virtual doublereal enthalpy_mole() const
Return the Molar Enthalpy. Units: J/kmol.
Definition: SurfPhase.cpp:56
Cantera::SurfPhase::SurfPhase
SurfPhase(doublereal n0=-1.0)
Constructor.
Definition: SurfPhase.cpp:24
Cantera::SurfPhase::logStandardConc
virtual doublereal logStandardConc(size_t k=0) const
Natural logarithm of the standard concentration of the kth species.
Definition: SurfPhase.cpp:149
Cantera::SurfPhase::getPartialMolarVolumes
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
Definition: SurfPhase.cpp:118
Cantera::SurfPhase::getCoverages
void getCoverages(doublereal *theta) const
Return a vector of surface coverages.
Definition: SurfPhase.cpp:277
Cantera::SurfPhase::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: SurfPhase.cpp:195
Cantera::SurfPhase::setSiteDensity
void setSiteDensity(doublereal n0)
Set the site density of the surface phase (kmol m-2)
Definition: SurfPhase.cpp:242
Cantera::SurfPhase::cv_mole
virtual doublereal cv_mole() const
Molar heat capacity at constant volume. Units: J/kmol/K.
Definition: SurfPhase.cpp:87
Cantera::SurfPhase::getActivityConcentrations
virtual void getActivityConcentrations(doublereal *c) const
Return a vector of activity concentrations for each species.
Definition: SurfPhase.cpp:139
Cantera::SurfPhase::setParametersFromXML
virtual void setParametersFromXML(const XML_Node &thermoData)
Set the Equation-of-State parameters by reading an XML Node Input.
Definition: SurfPhase.cpp:335
Cantera::SurfPhase::m_n0
doublereal m_n0
Surface site density (kmol m-2)
Definition: SurfPhase.h:401
Cantera::SurfPhase::m_logn0
doublereal m_logn0
log of the surface site density
Definition: SurfPhase.h:407
Cantera::SurfPhase::m_h0
vector_fp m_h0
Temporary storage for the reference state enthalpies.
Definition: SurfPhase.h:413
Cantera::SurfPhase::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: SurfPhase.cpp:189
Cantera::SurfPhase::getPartialMolarCp
virtual void getPartialMolarCp(doublereal *cpbar) const
Return an array of partial molar heat capacities for the species in the mixture.
Definition: SurfPhase.cpp:108
Cantera::SurfPhase::getStandardChemPotentials
virtual void getStandardChemPotentials(doublereal *mu0) const
Get the array of chemical potentials at unit activity for the species at their standard states at the...
Definition: SurfPhase.cpp:123
Cantera::SurfPhase::size
virtual double size(size_t k) const
Returns the number of sites occupied by one molecule of species k.
Definition: SurfPhase.h:313
Cantera::SurfPhase::getEntropy_R
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
Definition: SurfPhase.cpp:183
Cantera::SurfPhase::entropy_mole
virtual doublereal entropy_mole() const
Return the Molar Entropy. Units: J/kmol-K.
Definition: SurfPhase.cpp:70
Cantera::SurfPhase::m_work
vector_fp m_work
Temporary work array.
Definition: SurfPhase.h:425
Cantera::SurfPhase::initThermo
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
Definition: SurfPhase.cpp:342
Cantera::SurfPhase::m_mu0
vector_fp m_mu0
Temporary storage for the reference state Gibbs energies.
Definition: SurfPhase.h:422
Cantera::SurfPhase::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: SurfPhase.cpp:213
Cantera::SurfPhase::_updateThermo
void _updateThermo(bool force=false) const
Update the species reference state thermodynamic functions.
Definition: SurfPhase.cpp:319
Cantera::SurfPhase::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: SurfPhase.cpp:218
Cantera::SurfPhase::m_cp0
vector_fp m_cp0
Temporary storage for the reference state heat capacities.
Definition: SurfPhase.h:419
Cantera::SurfPhase::getPureGibbs
virtual void getPureGibbs(doublereal *g) const
Get the Gibbs functions for the standard state of the species at the current T and P of the solution.
Definition: SurfPhase.cpp:165
Cantera::SurfPhase::setParameters
virtual void setParameters(int n, doublereal *const c)
Set the equation of state parameters from the argument list.
Definition: SurfPhase.cpp:154
Cantera::SurfPhase::getChemPotentials
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
Definition: SurfPhase.cpp:129
Cantera::SurfPhase::getEnthalpy_RT
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
Definition: SurfPhase.cpp:177
Cantera::SurfPhase::setCoverages
void setCoverages(const doublereal *theta)
Set the surface site fractions to a specified state.
Definition: SurfPhase.cpp:252
Cantera::SurfPhase::intEnergy_mole
virtual doublereal intEnergy_mole() const
Return the Molar Internal Energy. Units: J/kmol.
Definition: SurfPhase.cpp:65
Cantera::SurfPhase::m_logsize
vector_fp m_logsize
vector storing the log of the size of each species.
Definition: SurfPhase.h:432
Cantera::SurfPhase::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: SurfPhase.cpp:208
Cantera::SurfPhase::standardConcentration
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
Definition: SurfPhase.cpp:144
Cantera::ThermoPhase::addSpecies
virtual bool addSpecies(shared_ptr< Species > spec)
Definition: ThermoPhase.cpp:1140
Cantera::ThermoPhase::RT
doublereal RT() const
Return the Gas Constant multiplied by the current temperature.
Definition: ThermoPhase.h:782
Cantera::ThermoPhase::m_tlast
doublereal m_tlast
last value of the temperature processed by reference state
Definition: ThermoPhase.h:1928
Cantera::ThermoPhase::setState
virtual void setState(const AnyMap &state)
Set the state using an AnyMap containing any combination of properties supported by the thermodynamic...
Definition: ThermoPhase.cpp:210
Cantera::ThermoPhase::initThermoFile
void initThermoFile(const std::string &inputFile, const std::string &id)
Definition: ThermoPhase.cpp:1066
Cantera::ThermoPhase::m_spthermo
MultiSpeciesThermo m_spthermo
Pointer to the calculation manager for species reference-state thermodynamic properties.
Definition: ThermoPhase.h:1894
Cantera::ThermoPhase::m_input
AnyMap m_input
Data supplied via setParameters.
Definition: ThermoPhase.h:1898
Cantera::ThermoPhase::getParameters
virtual void getParameters(int &n, doublereal *const c) const
Get the equation of state parameters in a vector.
Definition: ThermoPhase.cpp:1193
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::XML_Node::hasChild
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
Definition: xml.cpp:529
Cantera::XML_Node::_require
void _require(const std::string &a, const std::string &v) const
Require that the current XML node has an attribute named by the first argument, a,...
Definition: xml.cpp:577
ctml.h
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data.
Cantera::importPhase
void importPhase(XML_Node &phase, ThermoPhase *th)
Import a phase information into an empty ThermoPhase object.
Definition: ThermoFactory.cpp:250
Cantera
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:557
Cantera::getFloat
doublereal getFloat(const XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
Definition: ctml.cpp:166
Cantera::getOptionalFloat
bool getOptionalFloat(const XML_Node &parent, const std::string &name, doublereal &fltRtn, const std::string &type)
Get an optional floating-point value from a child element.
Definition: ctml.cpp:214
Cantera::getChildValue
std::string getChildValue(const XML_Node &parent, const std::string &nameString)
This function reads a child node with the name, nameString, and returns its XML value as the return s...
Definition: ctml.cpp:133
Cantera::OneAtm
const double OneAtm
One atmosphere [Pa].
Definition: ct_defs.h:81
Cantera::warn_deprecated
void warn_deprecated(const std::string &source, const AnyBase &node, const std::string &message)
A deprecation warning for syntax in an input file.
Definition: AnyMap.cpp:1901
Cantera::SmallNumber
const double SmallNumber
smallest number to compare to zero.
Definition: ct_defs.h:153
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
Cantera::GasConstant
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition: ct_defs.h:113
Cantera::compositionMap
std::map< std::string, double > compositionMap
Map connecting a string name with a double.
Definition: ct_defs.h:176
Cantera::scale
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
Definition: utilities.h:100
Cantera::parseCompString
compositionMap parseCompString(const std::string &ss, const std::vector< std::string > &names)
Parse a composition string into a map consisting of individual key:composition pairs.
Definition: stringUtils.cpp:59
Cantera::getValue
const U & getValue(const std::map< T, U > &m, const T &key, const U &default_val)
Const accessor for a value in a std::map.
Definition: utilities.h:184
stringUtils.h
Contains declarations for string manipulation functions within Cantera.
utilities.h
Various templated functions that carry out common vector operations (see Templated Utility Functions)...