Cantera  3.2.0a2
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 SurfPhase;
15
16//! A surface where reactions can occur that is in contact with the bulk fluid of a
17//! Reactor.
18//! @ingroup reactorGroup
20{
21public:
22 ReactorSurface(shared_ptr<Solution> sol, const string& name="(none)");
23 using ReactorBase::ReactorBase; // inherit constructors
24
25 //! String indicating the wall model implemented.
26 string type() const override {
27 return "ReactorSurface";
28 }
29
30 //! Returns the surface area [m^2]
31 double area() const;
32
33 //! Set the surface area [m^2]
34 void setArea(double a);
35
36 //! Accessor for the SurfPhase object
38 return m_surf;
39 }
40
41 //! Accessor for the InterfaceKinetics object
43 return m_kinetics;
44 }
45
46 //! Set the InterfaceKinetics object for this surface
47 //! @deprecated To be removed after %Cantera 3.2. Use constructor with
48 //! Solution object instead.
49 void setKinetics(Kinetics* kin);
50
51 void addInlet(FlowDevice& inlet) override {
52 throw NotImplementedError("ReactorSurface::addInlet",
53 "Inlets are undefined for reactors of type '{}'.", type());
54 }
55
56 void addOutlet(FlowDevice& outlet) override {
57 throw NotImplementedError("ReactorSurface::addOutlet",
58 "Outlets are undefined for reactors of type '{}'.", type());
59 }
60
61 void addWall(WallBase& w, int lr) override {
62 throw NotImplementedError("ReactorSurface::addWall");
63 }
64
65 void addSurface(ReactorSurface* surf) override {
66 throw NotImplementedError("ReactorSurface::addSurface");
67 }
68
69 //! Set the reactor that this Surface interacts with
70 void setReactor(ReactorBase* reactor);
71
72 //! Set the surface coverages. Array `cov` has length equal to the number of
73 //! surface species.
74 void setCoverages(const double* cov);
75
76 //! Set the surface coverages by name
77 void setCoverages(const Composition& cov);
78
79 //! Set the surface coverages by name
80 void setCoverages(const string& cov);
81
82 //! Get the surface coverages. Array `cov` should have length equal to the
83 //! number of surface species.
84 void getCoverages(double* cov) const;
85
86 //! Set the coverages and temperature in the surface phase object to the
87 //! values for this surface. The temperature is set to match the bulk phase
88 //! of the attached Reactor.
89 void syncState() override;
90
91 void addSensitivityReaction(size_t rxn) override;
92
93 //! Set reaction rate multipliers. `params` is the global vector of
94 //! sensitivity parameters. This function is called within
95 //! ReactorNet::eval() before the reaction rates are evaluated.
96 void setSensitivityParameters(const double* params);
97
98 //! Set reaction rate multipliers back to their initial values. This
99 //! function is called within ReactorNet::eval() after all rates have been
100 //! evaluated.
102
103protected:
104 void setThermo(ThermoPhase& thermo) override {}
105
106 //! Set the InterfaceKinetics object for this surface.
107 //! Method is needed to prevent compiler warnings by disambiguating from the
108 //! non-protected variant.
109 //! @since New in %Cantera 3.2.
110 //! @deprecated To be removed after %Cantera 3.2. Use constructor with
111 //! Solution object instead.
112 void setKinetics(Kinetics& kin) override;
113
114 double m_area = 1.0;
115
116 SurfPhase* m_surf = nullptr;
117 Kinetics* m_kinetics = nullptr;
118 ReactorBase* m_reactor = nullptr;
119 vector<double> m_cov;
120};
121
122}
123
124#endif
Base class for 'flow devices' (valves, pressure regulators, etc.) connecting reactors.
Definition FlowDevice.h:25
Public interface for kinetics managers.
Definition Kinetics.h:126
An error indicating that an unimplemented function has been called.
Base class for reactor objects.
Definition ReactorBase.h:49
FlowDevice & outlet(size_t n=0)
Return a reference to the n-th outlet FlowDevice connected to this reactor.
FlowDevice & inlet(size_t n=0)
Return a reference to the n-th inlet FlowDevice connected to this reactor.
string name() const
Return the name of this reactor.
Definition ReactorBase.h:68
A surface where reactions can occur that is in contact with the bulk fluid of a Reactor.
void addSurface(ReactorSurface *surf) override
Add a ReactorSurface object to a Reactor object.
double area() const
Returns the surface area [m^2].
void setReactor(ReactorBase *reactor)
Set the reactor that this Surface interacts with.
void addOutlet(FlowDevice &outlet) override
Connect an outlet FlowDevice to this reactor.
void setSensitivityParameters(const double *params)
Set reaction rate multipliers.
string type() const override
String indicating the wall model implemented.
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 addSensitivityReaction(size_t rxn) override
Add a sensitivity parameter associated with the reaction number rxn
void setThermo(ThermoPhase &thermo) override
Specify the mixture contained in the reactor.
void syncState() override
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.
Kinetics * kinetics()
Accessor for the InterfaceKinetics object.
void addInlet(FlowDevice &inlet) override
Connect an inlet FlowDevice to this reactor.
void addWall(WallBase &w, int lr) override
Insert a Wall between this reactor and another reactor.
A simple thermodynamic model for a surface phase, assuming an ideal solution model.
Definition SurfPhase.h:98
Base class for a phase with thermodynamic properties.
Base class for 'walls' (walls, pistons, etc.) connecting reactors.
Definition Wall.h:23
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595
map< string, double > Composition
Map from string names to doubles.
Definition ct_defs.h:177