| 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
9#include "cantera/zeroD/ReactorBase.h"
10
11 namespace Cantera
12{
13
14 class Kinetics;
15 class SurfPhase;
16
17//! A surface where reactions can occur that is in contact with the bulk fluid of a
18//! Reactor.
19//! @ingroup wallGroup
20 class ReactorSurface
21{
22 public:
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
35 SurfPhase* thermo() {
36 return m_thermo;
37 }
38
39 //! Accessor for the InterfaceKinetics object
40 Kinetics* kinetics() {
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.
87 void resetSensitivityParameters();
88
89 protected:
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
ReactorBase.h
Cantera::Kinetics
Public interface for kinetics managers.
Definition Kinetics.h:126
Cantera::ReactorBase
Base class for stirred reactors.
Definition ReactorBase.h:50
Cantera::ReactorSurface
A surface where reactions can occur that is in contact with the bulk fluid of a Reactor.
Definition ReactorSurface.h:21
Cantera::ReactorSurface::area
double area() const
Returns the surface area [m^2].
Definition ReactorSurface.cpp:15
Cantera::ReactorSurface::setReactor
void setReactor(ReactorBase *reactor)
Set the reactor that this Surface interacts with.
Definition ReactorSurface.cpp:42
Cantera::ReactorSurface::setSensitivityParameters
void setSensitivityParameters(const double *params)
Set reaction rate multipliers.
Definition ReactorSurface.cpp:87
Cantera::ReactorSurface::nSensParams
size_t nSensParams() const
Number of sensitivity parameters associated with reactions on this surface.
Definition ReactorSurface.h:52
Cantera::ReactorSurface::getCoverages
void getCoverages(double *cov) const
Get the surface coverages.
Definition ReactorSurface.cpp:64
Cantera::ReactorSurface::setArea
void setArea(double a)
Set the surface area [m^2].
Definition ReactorSurface.cpp:20
Cantera::ReactorSurface::resetSensitivityParameters
void resetSensitivityParameters()
Set reaction rate multipliers back to their initial values.
Definition ReactorSurface.cpp:95
Cantera::ReactorSurface::syncState
void syncState()
Set the coverages and temperature in the surface phase object to the values for this surface.
Definition ReactorSurface.cpp:69
Cantera::ReactorSurface::setCoverages
void setCoverages(const double *cov)
Set the surface coverages.
Definition ReactorSurface.cpp:47
Cantera::ReactorSurface::setKinetics
void setKinetics(Kinetics *kin)
Set the InterfaceKinetics object for this surface.
Definition ReactorSurface.cpp:25
Cantera::ReactorSurface::thermo
SurfPhase * thermo()
Accessor for the SurfPhase object.
Definition ReactorSurface.h:35
Cantera::ReactorSurface::addSensitivityReaction
void addSensitivityReaction(size_t i)
Enable calculation of sensitivities with respect to the rate constant for reaction i.
Definition ReactorSurface.cpp:75
Cantera::ReactorSurface::kinetics
Kinetics * kinetics()
Accessor for the InterfaceKinetics object.
Definition ReactorSurface.h:40
Cantera::SurfPhase
A simple thermodynamic model for a surface phase, assuming an ideal solution model.
Definition SurfPhase.h:98
Cantera
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564
Cantera::Composition
map< string, double > Composition
Map from string names to doubles.
Definition ct_defs.h:184