| Cantera 3.0.0

Loading...
Searching...
No Matches
InterfaceRate.cpp
Go to the documentation of this file.
1//! @file InterfaceRate.cpp
2
3// This file is part of Cantera. See License.txt in the top-level directory or
4// at https://cantera.org/license.txt for license and copyright information.
5
6#include "cantera/kinetics/InterfaceRate.h"
7#include "cantera/kinetics/Kinetics.h"
8#include "cantera/kinetics/Reaction.h"
9#include "cantera/thermo/ThermoPhase.h"
10#include "cantera/thermo/SurfPhase.h"
11#include "cantera/base/AnyMap.h"
12#include "cantera/base/utilities.h"
13
14 namespace Cantera
15{
16
17 void InterfaceData::update(double T)
18{
19 throw CanteraError("InterfaceData::update",
20 "Missing state information: 'InterfaceData' requires species coverages.");
21}
22
23 void InterfaceData::update(double T, const vector<double>& values)
24{
25 warn_user("InterfaceData::update",
26 "This method does not update the site density.");
27 ReactionData::update(T);
28 sqrtT = sqrt(T);
29 if (coverages.size() == 0) {
30 coverages = values;
31 logCoverages.resize(values.size());
32 } else if (values.size() == coverages.size()) {
33 std::copy(values.begin(), values.end(), coverages.begin());
34 } else {
35 throw CanteraError("InterfaceData::update",
36 "Incompatible lengths of coverage arrays: received {} elements while "
37 "{} are required.", values.size(), coverages.size());
38 }
39 for (size_t n = 0; n < coverages.size(); n++) {
40 logCoverages[n] = std::log(std::max(coverages[n], Tiny));
41 }
42}
43
44 bool InterfaceData::update(const ThermoPhase& phase, const Kinetics& kin)
45{
46 int mf = 0;
47 for (size_t n = 0; n < kin.nPhases(); n++) {
48 mf += kin.thermo(n).stateMFNumber();
49 }
50
51 double T = phase.temperature();
52 bool changed = false;
53 const auto& surf = dynamic_cast<const SurfPhase&>(
54 kin.thermo(kin.reactionPhaseIndex()));
55 double site_density = surf.siteDensity();
56 if (density != site_density) {
57 density = surf.siteDensity();
58 changed = true;
59 }
60 if (T != temperature) {
61 ReactionData::update(T);
62 sqrtT = sqrt(T);
63 changed = true;
64 }
65 if (changed || mf != m_state_mf_number) {
66 surf.getCoverages(coverages.data());
67 for (size_t n = 0; n < coverages.size(); n++) {
68 logCoverages[n] = std::log(std::max(coverages[n], Tiny));
69 }
70 for (size_t n = 0; n < kin.nPhases(); n++) {
71 size_t start = kin.kineticsSpeciesIndex(0, n);
72 const auto& ph = kin.thermo(n);
73 electricPotentials[n] = ph.electricPotential();
74 ph.getPartialMolarEnthalpies(partialMolarEnthalpies.data() + start);
75 ph.getStandardChemPotentials(standardChemPotentials.data() + start);
76 size_t nsp = ph.nSpecies();
77 for (size_t k = 0; k < nsp; k++) {
78 // only used for exchange current density formulation
79 standardConcentrations[k + start] = ph.standardConcentration(k);
80 }
81 }
82 m_state_mf_number = mf;
83 changed = true;
84 }
85 return changed;
86}
87
88 void InterfaceData::perturbTemperature(double deltaT)
89{
90 throw NotImplementedError("InterfaceData::perturbTemperature");
91}
92
93InterfaceRateBase::InterfaceRateBase()
94 : m_siteDensity(NAN)
95 , m_acov(0.)
96 , m_ecov(0.)
97 , m_mcov(0.)
98 , m_chargeTransfer(false)
99 , m_exchangeCurrentDensityFormulation(false)
100 , m_beta(0.5)
101 , m_deltaPotential_RT(NAN)
102 , m_deltaGibbs0_RT(NAN)
103 , m_prodStandardConcentrations(NAN)
104{
105}
106
107 void InterfaceRateBase::setParameters(const AnyMap& node)
108{
109 if (node.hasKey("coverage-dependencies")) {
110 setCoverageDependencies(
111 node["coverage-dependencies"].as<AnyMap>(), node.units());
112 }
113 if (node.hasKey("beta")) {
114 m_beta = node["beta"].asDouble();
115 }
116 m_exchangeCurrentDensityFormulation = node.getBool(
117 "exchange-current-density-formulation", false);
118}
119
120 void InterfaceRateBase::getParameters(AnyMap& node) const
121{
122 if (!m_cov.empty()) {
123 AnyMap deps;
124 getCoverageDependencies(deps);
125 node["coverage-dependencies"] = std::move(deps);
126 }
127 if (m_chargeTransfer) {
128 if (m_beta != 0.5) {
129 node["beta"] = m_beta;
130 }
131 if (m_exchangeCurrentDensityFormulation) {
132 node["exchange-current-density-formulation"] = true;
133 }
134 }
135}
136
137 void InterfaceRateBase::setCoverageDependencies(const AnyMap& dependencies,
138 const UnitSystem& units)
139{
140 m_cov.clear();
141 m_ac.clear();
142 m_ec.clear();
143 m_mc.clear();
144 m_lindep.clear();
145 for (const auto& [species, coeffs] : dependencies) {
146 double a, m;
147 vector<double> E(5, 0.0);
148 if (coeffs.is<AnyMap>()) {
149 auto& cov_map = coeffs.as<AnyMap>();
150 a = cov_map["a"].asDouble();
151 m = cov_map["m"].asDouble();
152 if (cov_map["E"].isScalar()) {
153 m_lindep.push_back(true);
154 E[1] = units.convertActivationEnergy(cov_map["E"], "K");
155 } else {
156 m_lindep.push_back(false);
157 auto& E_temp = cov_map["E"].asVector<AnyValue>(1, 4);
158 for (size_t i = 0; i < E_temp.size(); i++) {
159 E[i+1] = units.convertActivationEnergy(E_temp[i], "K");
160 }
161 }
162 } else {
163 auto& cov_vec = coeffs.asVector<AnyValue>(3);
164 a = cov_vec[0].asDouble();
165 m = cov_vec[1].asDouble();
166 if (cov_vec[2].isScalar()) {
167 m_lindep.push_back(true);
168 E[1] = units.convertActivationEnergy(cov_vec[2], "K");
169 } else {
170 m_lindep.push_back(false);
171 auto& E_temp = cov_vec[2].asVector<AnyValue>(1, 4);
172 for (size_t i = 0; i < E_temp.size(); i++) {
173 E[i+1] = units.convertActivationEnergy(E_temp[i], "K");
174 }
175 }
176 }
177 addCoverageDependence(species, a, m, E);
178 }
179}
180
181 void InterfaceRateBase::getCoverageDependencies(AnyMap& dependencies,
182 bool asVector) const
183{
184 for (size_t k = 0; k < m_cov.size(); k++) {
185 if (asVector) {
186 // this preserves the previous 'coverage_deps' units
187 warn_deprecated("InterfaceRateBase::getCoverageDependencies",
188 "To be changed after Cantera 3.0: second argument will be removed.");
189 vector<double> dep(3);
190 if (m_lindep[k]) {
191 dep[2] = m_ec[k][1];
192 } else {
193 throw NotImplementedError("InterfaceRateBase::getCoverageDependencies",
194 "Polynomial dependency not implemented for asVector.");
195 }
196 dep[0] = m_ac[k];
197 dep[1] = m_mc[k];
198 dependencies[m_cov[k]] = std::move(dep);
199 } else {
200 AnyMap dep;
201 dep["a"] = m_ac[k];
202 dep["m"] = m_mc[k];
203 if (m_lindep[k]) {
204 dep["E"].setQuantity(m_ec[k][1], "K", true);
205 } else {
206 vector<AnyValue> E_temp(4);
207 for (size_t i = 0; i < m_ec[k].size() - 1; i++) {
208 E_temp[i].setQuantity(m_ec[k][i+1], "K", true);
209 }
210 dep["E"] = E_temp;
211 }
212 dependencies[m_cov[k]] = std::move(dep);
213 }
214 }
215}
216
217 void InterfaceRateBase::addCoverageDependence(const string& sp, double a, double m,
218 const vector<double>& e)
219{
220 if (std::find(m_cov.begin(), m_cov.end(), sp) == m_cov.end()) {
221 m_cov.push_back(sp);
222 m_ac.push_back(a);
223 m_ec.push_back(e);
224 m_mc.push_back(m);
225 m_indices.clear();
226 } else {
227 throw CanteraError("InterfaceRateBase::addCoverageDependence",
228 "Coverage for species '{}' is already specified.", sp);
229 }
230}
231
232 void InterfaceRateBase::setSpecies(const vector<string>& species)
233{
234 m_indices.clear();
235 for (size_t k = 0; k < m_cov.size(); k++) {
236 auto it = find(species.begin(), species.end(), m_cov[k]);
237 if (it != species.end()) {
238 m_indices.emplace(k, it - species.begin());
239 } else {
240 throw CanteraError("InterfaceRateBase:setSpeciesIndices",
241 "Species list does not contain '{}'.", m_cov[k]);
242 }
243 }
244}
245
246 void InterfaceRateBase::updateFromStruct(const InterfaceData& shared_data) {
247 if (shared_data.ready) {
248 m_siteDensity = shared_data.density;
249 }
250
251 if (m_indices.size() != m_cov.size()) {
252 // object is not set up correctly (setSpecies needs to be run)
253 m_acov = NAN;
254 m_ecov = NAN;
255 m_mcov = NAN;
256 return;
257 }
258 m_acov = 0.0;
259 m_ecov = 0.0;
260 m_mcov = 0.0;
261 for (auto& [iCov, iKin] : m_indices) {
262 m_acov += m_ac[iCov] * shared_data.coverages[iKin];
263 if (m_lindep[iCov]) {
264 m_ecov += m_ec[iCov][1] * shared_data.coverages[iKin];
265 } else {
266 m_ecov += poly4(shared_data.coverages[iKin], m_ec[iCov].data());
267 }
268 m_mcov += m_mc[iCov] * shared_data.logCoverages[iKin];
269 }
270
271 // Update change in electrical potential energy
272 if (m_chargeTransfer) {
273 m_deltaPotential_RT = 0.;
274 for (const auto& [iPhase, netCharge] : m_netCharges) {
275 m_deltaPotential_RT +=
276 shared_data.electricPotentials[iPhase] * netCharge;
277 }
278 m_deltaPotential_RT /= GasConstant * shared_data.temperature;
279 }
280
281 // Update quantities used for exchange current density formulation
282 if (m_exchangeCurrentDensityFormulation) {
283 m_deltaGibbs0_RT = 0.;
284 m_prodStandardConcentrations = 1.;
285 for (const auto& [k, stoich] : m_stoichCoeffs) {
286 m_deltaGibbs0_RT +=
287 shared_data.standardChemPotentials[k] * stoich;
288 if (stoich > 0.) {
289 m_prodStandardConcentrations *=
290 shared_data.standardConcentrations[k];
291 }
292 }
293 m_deltaGibbs0_RT /= GasConstant * shared_data.temperature;
294 }
295}
296
297 void InterfaceRateBase::setContext(const Reaction& rxn, const Kinetics& kin)
298{
299 setSpecies(kin.thermo().speciesNames());
300
301 m_chargeTransfer = rxn.usesElectrochemistry(kin);
302 if (!m_chargeTransfer) {
303 return;
304 }
305
306 m_stoichCoeffs.clear();
307 for (const auto& [name, stoich] : rxn.reactants) {
308 m_stoichCoeffs.emplace_back(kin.kineticsSpeciesIndex(name), -stoich);
309 }
310 for (const auto& [name, stoich] : rxn.products) {
311 m_stoichCoeffs.emplace_back(kin.kineticsSpeciesIndex(name), stoich);
312 }
313
314 m_netCharges.clear();
315 for (const auto& [k, stoich] : m_stoichCoeffs) {
316 size_t n = kin.speciesPhaseIndex(k);
317 size_t start = kin.kineticsSpeciesIndex(0, n);
318 double charge = kin.thermo(n).charge(k - start);
319 m_netCharges.emplace_back(n, Faraday * charge * stoich);
320 }
321}
322
323StickingCoverage::StickingCoverage()
324 : m_motzWise(false)
325 , m_explicitMotzWise(false)
326 , m_stickingSpecies("")
327 , m_explicitSpecies(false)
328 , m_surfaceOrder(NAN)
329 , m_multiplier(NAN)
330 , m_factor(NAN)
331{
332}
333
334 void StickingCoverage::setStickingParameters(const AnyMap& node)
335{
336 m_motzWise = node.getBool("Motz-Wise", false);
337 m_explicitMotzWise = node.hasKey("Motz-Wise");
338 m_stickingSpecies = node.getString("sticking-species", "");
339 m_explicitSpecies = node.hasKey("sticking-species");
340}
341
342 void StickingCoverage::getStickingParameters(AnyMap& node) const
343{
344 if (m_explicitMotzWise) {
345 node["Motz-Wise"] = m_motzWise;
346 }
347 if (m_explicitSpecies) {
348 node["sticking-species"] = m_stickingSpecies;
349 }
350}
351
352 void StickingCoverage::setContext(const Reaction& rxn, const Kinetics& kin)
353{
354 // Ensure that site density is initialized
355 const ThermoPhase& phase = kin.thermo(kin.reactionPhaseIndex());
356 const auto& surf = dynamic_cast<const SurfPhase&>(phase);
357 m_siteDensity = surf.siteDensity();
358 if (!m_explicitMotzWise) {
359 m_motzWise = kin.thermo().input().getBool("Motz-Wise", false);
360 }
361
362 // Identify the interface phase
363 size_t iInterface = kin.reactionPhaseIndex();
364
365 string sticking_species = m_stickingSpecies;
366 if (sticking_species == "") {
367 // Identify the sticking species if not explicitly given
368 vector<string> gasSpecies;
369 vector<string> anySpecies;
370 for (const auto& [name, stoich] : rxn.reactants) {
371 size_t iPhase = kin.speciesPhaseIndex(kin.kineticsSpeciesIndex(name));
372 if (iPhase != iInterface) {
373 // Non-interface species. There should be exactly one of these
374 // (either in gas phase or other phase)
375 if (kin.thermo(iPhase).phaseOfMatter() == "gas") {
376 gasSpecies.push_back(name);
377 }
378 anySpecies.push_back(name);
379 }
380 }
381 if (gasSpecies.size() == 1) {
382 // single sticking species in gas phase
383 sticking_species = gasSpecies[0];
384 } else if (anySpecies.size() == 1) {
385 // single sticking species in any phase
386 sticking_species = anySpecies[0];
387 } else if (anySpecies.size() == 0) {
388 throw InputFileError("StickingCoverage::setContext",
389 rxn.input, "No non-interface species found "
390 "in sticking reaction: '{}'", rxn.equation());
391 } else {
392 throw InputFileError("StickingCoverage::setContext",
393 rxn.input, "Multiple non-interface species ({})\nfound in sticking "
394 "reaction: '{}'.\nSticking species must be explicitly specified.",
395 fmt::format("'{}'", fmt::join(anySpecies, "', '")), rxn.equation());
396 }
397 }
398 m_stickingSpecies = sticking_species;
399
400 double surface_order = 0.0;
401 double multiplier = 1.0;
402 // Adjust the A-factor
403 for (const auto& [name, stoich] : rxn.reactants) {
404 size_t iPhase = kin.speciesPhaseIndex(kin.kineticsSpeciesIndex(name));
405 const ThermoPhase& p = kin.thermo(iPhase);
406 size_t k = p.speciesIndex(name);
407 if (name == sticking_species) {
408 multiplier *= sqrt(GasConstant / (2 * Pi * p.molecularWeight(k)));
409 } else {
410 // Non-sticking species. Convert from coverages used in the
411 // sticking probability expression to the concentration units
412 // used in the mass action rate expression. For surface phases,
413 // the dependence on the site density is incorporated when the
414 // rate constant is evaluated, since we don't assume that the
415 // site density is known at this time.
416 double order = getValue(rxn.orders, name, stoich);
417 if (&p == &surf) {
418 multiplier *= pow(surf.size(k), order);
419 surface_order += order;
420 } else {
421 multiplier *= pow(p.standardConcentration(k), -order);
422 }
423 }
424 }
425 m_surfaceOrder = surface_order;
426 m_multiplier = multiplier;
427}
428
429}
AnyMap.h
InterfaceRate.h
Header for reaction rates that occur at interfaces.
Kinetics.h
Base class for kinetics managers and also contains the kineticsmgr module documentation (see Kinetics...
Reaction.h
SurfPhase.h
Header for a simple thermodynamics model of a surface phase derived from ThermoPhase,...
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::AnyMap::hasKey
bool hasKey(const string &key) const
Returns true if the map contains an item named key.
Definition AnyMap.cpp:1423
Cantera::AnyMap::units
const UnitSystem & units() const
Return the default units that should be used to convert stored values.
Definition AnyMap.h:630
Cantera::AnyMap::getBool
bool getBool(const string &key, bool default_) const
If key exists, return it as a bool, otherwise return default_.
Definition AnyMap.cpp:1515
Cantera::AnyMap::clear
void clear()
Erase all items in the mapping.
Definition AnyMap.cpp:1433
Cantera::AnyMap::getString
const string & getString(const string &key, const string &default_) const
If key exists, return it as a string, otherwise return default_.
Definition AnyMap.cpp:1530
Cantera::AnyValue
A wrapper for a variable whose type is determined at runtime.
Definition AnyMap.h:86
Cantera::AnyValue::asDouble
double & asDouble()
Return the held value as a double, if it is a double or a long int.
Definition AnyMap.cpp:824
Cantera::CanteraError
Base class for exceptions thrown by Cantera classes.
Definition ctexceptions.h:66
Cantera::InputFileError
Error thrown for problems processing information contained in an AnyMap or AnyValue.
Definition AnyMap.h:738
Cantera::InterfaceRateBase::m_mcov
double m_mcov
Coverage term in reaction rate.
Definition InterfaceRate.h:235
Cantera::InterfaceRateBase::setCoverageDependencies
void setCoverageDependencies(const AnyMap &dependencies, const UnitSystem &units=UnitSystem())
Set coverage dependencies based on AnyMap node information.
Definition InterfaceRate.cpp:137
Cantera::InterfaceRateBase::m_beta
double m_beta
Electrochemistry only.
Definition InterfaceRate.h:238
Cantera::InterfaceRateBase::m_ecov
double m_ecov
Coverage contribution to activation energy.
Definition InterfaceRate.h:234
Cantera::InterfaceRateBase::m_stoichCoeffs
vector< pair< size_t, double > > m_stoichCoeffs
Pairs of species index and multipliers to calculate enthalpy change.
Definition InterfaceRate.h:257
Cantera::InterfaceRateBase::m_ac
vector< double > m_ac
Vector holding coverage-specific exponential dependence.
Definition InterfaceRate.h:247
Cantera::InterfaceRateBase::setParameters
void setParameters(const AnyMap &node)
Perform object setup based on AnyMap node information.
Definition InterfaceRate.cpp:107
Cantera::InterfaceRateBase::setSpecies
void setSpecies(const vector< string > &species)
Set association with an ordered list of all species associated with a given Kinetics object.
Definition InterfaceRate.cpp:232
Cantera::InterfaceRateBase::m_cov
vector< string > m_cov
Vector holding names of coverage species.
Definition InterfaceRate.h:246
Cantera::InterfaceRateBase::m_prodStandardConcentrations
double m_prodStandardConcentrations
Products of standard concentrations.
Definition InterfaceRate.h:241
Cantera::InterfaceRateBase::m_deltaGibbs0_RT
double m_deltaGibbs0_RT
Normalized standard state Gibbs free energy change.
Definition InterfaceRate.h:240
Cantera::InterfaceRateBase::addCoverageDependence
virtual void addCoverageDependence(const string &sp, double a, double m, const vector< double > &e)
Add a coverage dependency for species sp, with exponential dependence a, power-law exponent m,...
Definition InterfaceRate.cpp:217
Cantera::InterfaceRateBase::m_chargeTransfer
bool m_chargeTransfer
Boolean indicating use of electrochemistry.
Definition InterfaceRate.h:236
Cantera::InterfaceRateBase::getCoverageDependencies
void getCoverageDependencies(AnyMap &dependencies, bool asVector=false) const
Store parameters needed to reconstruct coverage dependencies.
Definition InterfaceRate.cpp:181
Cantera::InterfaceRateBase::m_mc
vector< double > m_mc
Vector holding coverage-specific power-law exponents.
Definition InterfaceRate.h:253
Cantera::InterfaceRateBase::m_indices
map< size_t, size_t > m_indices
Map from coverage dependencies stored in this object to the index of the coverage species in the Kine...
Definition InterfaceRate.h:245
Cantera::InterfaceRateBase::m_netCharges
vector< pair< size_t, double > > m_netCharges
Pairs of phase index and net electric charges (same order as m_stoichCoeffs)
Definition InterfaceRate.h:260
Cantera::InterfaceRateBase::m_acov
double m_acov
Coverage contribution to pre-exponential factor.
Definition InterfaceRate.h:233
Cantera::InterfaceRateBase::m_lindep
vector< bool > m_lindep
Vector holding boolean for linear dependence.
Definition InterfaceRate.h:252
Cantera::InterfaceRateBase::getParameters
void getParameters(AnyMap &node) const
Store parameters needed to reconstruct an identical object.
Definition InterfaceRate.cpp:120
Cantera::InterfaceRateBase::m_ec
vector< vector< double > > m_ec
Vector holding coverage-specific activation energy dependence as a 5-membered array of polynomial coe...
Definition InterfaceRate.h:251
Cantera::InterfaceRateBase::m_siteDensity
double m_siteDensity
Site density [kmol/m^2].
Definition InterfaceRate.h:232
Cantera::InterfaceRateBase::setContext
void setContext(const Reaction &rxn, const Kinetics &kin)
Build rate-specific parameters based on Reaction and Kinetics context.
Definition InterfaceRate.cpp:297
Cantera::InterfaceRateBase::updateFromStruct
void updateFromStruct(const InterfaceData &shared_data)
Update reaction rate parameters.
Definition InterfaceRate.cpp:246
Cantera::InterfaceRateBase::m_deltaPotential_RT
double m_deltaPotential_RT
Normalized electric potential energy change.
Definition InterfaceRate.h:239
Cantera::Kinetics
Public interface for kinetics managers.
Definition Kinetics.h:126
Cantera::Kinetics::reactionPhaseIndex
size_t reactionPhaseIndex() const
Phase where the reactions occur.
Definition Kinetics.h:235
Cantera::Kinetics::thermo
ThermoPhase & thermo(size_t n=0)
This method returns a reference to the nth ThermoPhase object defined in this kinetics mechanism.
Definition Kinetics.h:254
Cantera::Kinetics::nPhases
size_t nPhases() const
The number of phases participating in the reaction mechanism.
Definition Kinetics.h:185
Cantera::Kinetics::kineticsSpeciesIndex
size_t kineticsSpeciesIndex(size_t k, size_t n) const
The location of species k of phase n in species arrays.
Definition Kinetics.h:288
Cantera::Kinetics::speciesPhaseIndex
size_t speciesPhaseIndex(size_t k) const
This function takes as an argument the kineticsSpecies index (that is, the list index in the list of ...
Definition Kinetics.cpp:323
Cantera::NotImplementedError
An error indicating that an unimplemented function has been called.
Definition ctexceptions.h:195
Cantera::Phase::temperature
double temperature() const
Temperature (K).
Definition Phase.h:662
Cantera::Phase::speciesIndex
size_t speciesIndex(const string &name) const
Returns the index of a species named 'name' within the Phase object.
Definition Phase.cpp:138
Cantera::Phase::stateMFNumber
int stateMFNumber() const
Return the State Mole Fraction Number.
Definition Phase.h:866
Cantera::Phase::speciesNames
const vector< string > & speciesNames() const
Return a const reference to the vector of species names.
Definition Phase.cpp:157
Cantera::Phase::molecularWeight
double molecularWeight(size_t k) const
Molecular weight of species k.
Definition Phase.cpp:482
Cantera::Phase::charge
double charge(size_t k) const
Dimensionless electrical charge of a single molecule of species k The charge is normalized by the the...
Definition Phase.h:638
Cantera::Reaction
Abstract base class which stores data about a reaction and its rate parameterization so that it can b...
Definition Reaction.h:27
Cantera::Reaction::orders
Composition orders
Forward reaction order with respect to specific species.
Definition Reaction.h:140
Cantera::Reaction::equation
string equation() const
The chemical equation for this reaction.
Definition Reaction.cpp:347
Cantera::Reaction::usesElectrochemistry
bool usesElectrochemistry(const Kinetics &kin) const
Check whether reaction uses electrochemistry.
Definition Reaction.cpp:690
Cantera::Reaction::products
Composition products
Product species and stoichiometric coefficients.
Definition Reaction.h:135
Cantera::Reaction::reactants
Composition reactants
Reactant species and stoichiometric coefficients.
Definition Reaction.h:132
Cantera::Reaction::input
AnyMap input
Input data used for specific models.
Definition Reaction.h:160
Cantera::StickingCoverage::setStickingParameters
void setStickingParameters(const AnyMap &node)
Perform object setup based on AnyMap node information.
Definition InterfaceRate.cpp:334
Cantera::StickingCoverage::m_explicitSpecies
bool m_explicitSpecies
Boolean flag.
Definition InterfaceRate.h:356
Cantera::StickingCoverage::m_stickingSpecies
string m_stickingSpecies
string identifying sticking species
Definition InterfaceRate.h:355
Cantera::StickingCoverage::m_explicitMotzWise
bool m_explicitMotzWise
Correction cannot be overriden by default.
Definition InterfaceRate.h:354
Cantera::StickingCoverage::getStickingParameters
void getStickingParameters(AnyMap &node) const
Store parameters needed to reconstruct an identical object.
Definition InterfaceRate.cpp:342
Cantera::StickingCoverage::m_multiplier
double m_multiplier
multiplicative factor in rate expression
Definition InterfaceRate.h:358
Cantera::StickingCoverage::m_motzWise
bool m_motzWise
boolean indicating whether Motz & Wise correction is used
Definition InterfaceRate.h:353
Cantera::StickingCoverage::m_surfaceOrder
double m_surfaceOrder
exponent applied to site density term
Definition InterfaceRate.h:357
Cantera::StickingCoverage::setContext
void setContext(const Reaction &rxn, const Kinetics &kin)
Build rate-specific parameters based on Reaction and Kinetics context.
Definition InterfaceRate.cpp:352
Cantera::SurfPhase
A simple thermodynamic model for a surface phase, assuming an ideal solution model.
Definition SurfPhase.h:98
Cantera::SurfPhase::siteDensity
double siteDensity() const
Returns the site density.
Definition SurfPhase.h:221
Cantera::ThermoPhase
Base class for a phase with thermodynamic properties.
Definition ThermoPhase.h:390
Cantera::ThermoPhase::electricPotential
double electricPotential() const
Returns the electric potential of this phase (V).
Definition ThermoPhase.h:621
Cantera::ThermoPhase::standardConcentration
virtual double standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
Definition ThermoPhase.h:718
Cantera::ThermoPhase::phaseOfMatter
virtual string phaseOfMatter() const
String indicating the mechanical phase of the matter in this Phase.
Definition ThermoPhase.h:428
Cantera::ThermoPhase::input
const AnyMap & input() const
Access input data associated with the phase description.
Definition ThermoPhase.cpp:1229
Cantera::UnitSystem
Unit conversion utility.
Definition Units.h:169
Cantera::UnitSystem::convertActivationEnergy
double convertActivationEnergy(double value, const string &src, const string &dest) const
Convert value from the units of src to the units of dest, allowing for the different dimensions that ...
Definition Units.cpp:673
Cantera::poly4
R poly4(D x, R *c)
Evaluates a polynomial of order 4.
Definition utilities.h:153
Cantera::Faraday
const double Faraday
Faraday constant [C/kmol].
Definition ct_defs.h:131
Cantera::GasConstant
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition ct_defs.h:120
Cantera::Pi
const double Pi
Pi.
Definition ct_defs.h:68
Cantera::warn_user
void warn_user(const string &method, const string &msg, const Args &... args)
Print a user warning raised from method as CanteraWarning.
Definition global.h:267
Cantera
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564
Cantera::Tiny
const double Tiny
Small number to compare differences of mole fractions against.
Definition ct_defs.h:173
Cantera::warn_deprecated
void warn_deprecated(const string &source, const AnyBase &node, const string &message)
A deprecation warning for syntax in an input file.
Definition AnyMap.cpp:1926
Cantera::getValue
const U & getValue(const map< T, U > &m, const T &key, const U &default_val)
Const accessor for a value in a map.
Definition utilities.h:190
Cantera::BlowersMaselData::m_state_mf_number
int m_state_mf_number
integer that is incremented when composition changes
Definition BlowersMaselRate.h:37
Cantera::BlowersMaselData::partialMolarEnthalpies
vector< double > partialMolarEnthalpies
partial molar enthalpies
Definition BlowersMaselRate.h:34
Cantera::BlowersMaselData::ready
bool ready
boolean indicating whether vectors are accessible
Definition BlowersMaselRate.h:32
Cantera::BlowersMaselData::density
double density
used to determine if updates are needed
Definition BlowersMaselRate.h:33
Cantera::InterfaceData
Data container holding shared data for reaction rate specification with interfaces.
Definition InterfaceRate.h:30
Cantera::InterfaceData::logCoverages
vector< double > logCoverages
logarithm of surface coverages
Definition InterfaceRate.h:56
Cantera::InterfaceData::electricPotentials
vector< double > electricPotentials
electric potentials of phases
Definition InterfaceRate.h:57
Cantera::InterfaceData::update
bool update(const ThermoPhase &bulk, const Kinetics &kin) override
Update data container based on thermodynamic phase state.
Definition InterfaceRate.cpp:44
Cantera::InterfaceData::coverages
vector< double > coverages
surface coverages
Definition InterfaceRate.h:55
Cantera::InterfaceData::standardChemPotentials
vector< double > standardChemPotentials
standard state chemical potentials
Definition InterfaceRate.h:58
Cantera::InterfaceData::standardConcentrations
vector< double > standardConcentrations
standard state concentrations
Definition InterfaceRate.h:59
Cantera::InterfaceData::sqrtT
double sqrtT
square root of temperature
Definition InterfaceRate.h:53
Cantera::ReactionData::update
virtual void update(double T)
Update data container based on temperature T
Definition ReactionData.h:36
Cantera::ReactionData::temperature
double temperature
temperature
Definition ReactionData.h:110
utilities.h
Various templated functions that carry out common vector and polynomial operations (see Templated Arr...