Cantera 2.6.0
ReactorSurface.h
Go to the documentation of this file.
1//! @file ReactorSurface.h Header file for class ReactorSurface
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#ifndef CT_REACTOR_SURFACE_H
7#define CT_REACTOR_SURFACE_H
8
10
11namespace Cantera
12{
13
14class Kinetics;
15class SurfPhase;
16
17//! A surface where reactions can occur that is in contact with the bulk fluid of a
18//! Reactor.
19//! @ingroup ZeroD
21{
22public:
24 virtual ~ReactorSurface() {}
25 ReactorSurface(const ReactorSurface&) = delete;
26 ReactorSurface& operator=(const ReactorSurface&) = delete;
27
28 //! Returns the surface area [m^2]
29 double area() const;
30
31 //! Set the surface area [m^2]
32 void setArea(double a);
33
34 //! Accessor for the SurfPhase object
36 return m_thermo;
37 }
38
39 //! Accessor for the InterfaceKinetics object
41 return m_kinetics;
42 }
43
44 //! Set the InterfaceKinetics object for this surface
45 void setKinetics(Kinetics* kin);
46
47 //! Set the reactor that this Surface interacts with
48 void setReactor(ReactorBase* reactor);
49
50 //! Number of sensitivity parameters associated with reactions on this
51 //! surface
52 size_t nSensParams() const {
53 return m_params.size();
54 }
55
56 //! Set the surface coverages. Array `cov` has length equal to the number of
57 //! surface species.
58 void setCoverages(const double* cov);
59
60 //! Set the surface coverages by name
61 void setCoverages(const Composition& cov);
62
63 //! Set the surface coverages by name
64 void setCoverages(const std::string& cov);
65
66 //! Get the surface coverages. Array `cov` should have length equal to the
67 //! number of surface species.
68 void getCoverages(double* cov) const;
69
70 //! Set the coverages in the surface phase object to the values for this
71 //! surface.
72 //! @deprecated To be removed after Cantera 2.6. Use syncState() instead.
73 void syncCoverages();
74
75 //! Set the coverages and temperature in the surface phase object to the
76 //! values for this surface. The temperature is set to match the bulk phase
77 //! of the attached Reactor.
78 void syncState();
79
80 //! Enable calculation of sensitivities with respect to the rate constant
81 //! for reaction `i`.
82 void addSensitivityReaction(size_t i);
83
84 //! Set reaction rate multipliers. `params` is the global vector of
85 //! sensitivity parameters. This function is called within
86 //! ReactorNet::eval() before the reaction rates are evaluated.
87 void setSensitivityParameters(const double* params);
88
89 //! Set reaction rate multipliers back to their initial values. This
90 //! function is called within ReactorNet::eval() after all rates have been
91 //! evaluated.
93
94protected:
95 double m_area;
96
97 SurfPhase* m_thermo;
98 Kinetics* m_kinetics;
99 ReactorBase* m_reactor;
100 vector_fp m_cov;
101 std::vector<SensitivityParameter> m_params;
102};
103
104}
105
106#endif
Public interface for kinetics managers.
Definition: Kinetics.h:114
Base class for stirred reactors.
Definition: ReactorBase.h:49
A surface where reactions can occur that is in contact with the bulk fluid of a Reactor.
double area() const
Returns the surface area [m^2].
void setReactor(ReactorBase *reactor)
Set the reactor that this Surface interacts with.
void syncCoverages()
Set the coverages in the surface phase object to the values for this surface.
void setSensitivityParameters(const double *params)
Set reaction rate multipliers.
size_t nSensParams() const
Number of sensitivity parameters associated with reactions on this surface.
void getCoverages(double *cov) const
Get the surface coverages.
void setArea(double a)
Set the surface area [m^2].
void resetSensitivityParameters()
Set reaction rate multipliers back to their initial values.
void syncState()
Set the coverages and temperature in the surface phase object to the values for this surface.
void setCoverages(const double *cov)
Set the surface coverages.
void setKinetics(Kinetics *kin)
Set the InterfaceKinetics object for this surface.
SurfPhase * thermo()
Accessor for the SurfPhase object.
void addSensitivityReaction(size_t i)
Enable calculation of sensitivities with respect to the rate constant for reaction i.
Kinetics * kinetics()
Accessor for the InterfaceKinetics object.
A simple thermodynamic model for a surface phase, assuming an ideal solution model.
Definition: SurfPhase.h:125
Namespace for the Cantera kernel.
Definition: AnyMap.h:29
std::map< std::string, double > Composition
Map from string names to doubles.
Definition: ct_defs.h:180
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