Cantera  3.0.0
Loading...
Searching...
No Matches
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 wallGroup
21{
22public:
23 ReactorSurface() = default;
24 virtual ~ReactorSurface() = default;
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 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 and temperature in the surface phase object to the
71 //! values for this surface. The temperature is set to match the bulk phase
72 //! of the attached Reactor.
73 void syncState();
74
75 //! Enable calculation of sensitivities with respect to the rate constant
76 //! for reaction `i`.
77 void addSensitivityReaction(size_t i);
78
79 //! Set reaction rate multipliers. `params` is the global vector of
80 //! sensitivity parameters. This function is called within
81 //! ReactorNet::eval() before the reaction rates are evaluated.
82 void setSensitivityParameters(const double* params);
83
84 //! Set reaction rate multipliers back to their initial values. This
85 //! function is called within ReactorNet::eval() after all rates have been
86 //! evaluated.
88
89protected:
90 double m_area = 1.0;
91
92 SurfPhase* m_thermo = nullptr;
93 Kinetics* m_kinetics = nullptr;
94 ReactorBase* m_reactor = nullptr;
95 vector<double> m_cov;
96 vector<SensitivityParameter> m_params;
97};
98
99}
100
101#endif
Public interface for kinetics managers.
Definition Kinetics.h:126
Base class for stirred reactors.
Definition ReactorBase.h:50
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 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:98
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564
map< string, double > Composition
Map from string names to doubles.
Definition ct_defs.h:184