14ReactorSurface::ReactorSurface()
22double ReactorSurface::area()
const
27void ReactorSurface::setArea(
double a)
32void ReactorSurface::setKinetics(
Kinetics* kin) {
42 "Specified surface kinetics manager does not represent a surface "
43 "kinetics mechanism.");
46 m_cov.resize(m_thermo->nSpecies());
55void ReactorSurface::setCoverages(
const double* cov)
57 copy(cov, cov + m_cov.size(), m_cov.begin());
62 m_thermo->setCoveragesByName(cov);
63 m_thermo->getCoverages(m_cov.data());
66void ReactorSurface::setCoverages(
const std::string& cov)
68 m_thermo->setCoveragesByName(cov);
69 m_thermo->getCoverages(m_cov.data());
72void ReactorSurface::getCoverages(
double* cov)
const
74 copy(m_cov.begin(), m_cov.end(), cov);
77void ReactorSurface::syncCoverages()
80 "To be removed after Cantera 2.6. Use syncState() instead.");
81 m_thermo->setCoveragesNoNorm(m_cov.data());
84void ReactorSurface::syncState()
86 m_thermo->setTemperature(m_reactor->temperature());
87 m_thermo->setCoveragesNoNorm(m_cov.data());
90void ReactorSurface::addSensitivityReaction(
size_t i)
92 if (i >= m_kinetics->nReactions()) {
93 throw CanteraError(
"ReactorSurface::addSensitivityReaction",
94 "Reaction number out of range ({})", i);
96 size_t p = m_reactor->network().registerSensitivityParameter(
97 m_kinetics->reactionString(i), 1.0, 1.0);
98 m_params.emplace_back(
99 SensitivityParameter{i, p, 1.0, SensParameterType::reaction});
102void ReactorSurface::setSensitivityParameters(
const double* params)
104 for (
auto& p : m_params) {
105 p.value = m_kinetics->multiplier(p.local);
106 m_kinetics->setMultiplier(p.local, p.value*params[p.global]);
110void ReactorSurface::resetSensitivityParameters()
112 for (
auto& p : m_params) {
113 m_kinetics->setMultiplier(p.local, p.value);
Base class for kinetics managers and also contains the kineticsmgr module documentation (see Kinetics...
Header file for class ReactorSurface.
Header for a simple thermodynamics model of a surface phase derived from ThermoPhase,...
Base class for exceptions thrown by Cantera classes.
Public interface for kinetics managers.
ThermoPhase & thermo(size_t n=0)
This method returns a reference to the nth ThermoPhase object defined in this kinetics mechanism.
size_t surfacePhaseIndex() const
This returns the integer index of the phase which has ThermoPhase type cSurf.
Base class for stirred reactors.
A simple thermodynamic model for a surface phase, assuming an ideal solution model.
void getCoverages(doublereal *theta) const
Return a vector of surface coverages.
Namespace for the Cantera kernel.
const size_t npos
index returned by functions to indicate "no position"
std::map< std::string, double > Composition
Map from string names to doubles.
void warn_deprecated(const std::string &source, const AnyBase &node, const std::string &message)
A deprecation warning for syntax in an input file.