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
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 ZeroD
20 class ReactorSurface
21{
22 public:
23 ReactorSurface();
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
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 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.
92 void resetSensitivityParameters();
93
94 protected:
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
ReactorBase.h
Cantera::Kinetics
Public interface for kinetics managers.
Definition: Kinetics.h:114
Cantera::ReactorBase
Base class for stirred reactors.
Definition: ReactorBase.h:49
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:22
Cantera::ReactorSurface::setReactor
void setReactor(ReactorBase *reactor)
Set the reactor that this Surface interacts with.
Definition: ReactorSurface.cpp:50
Cantera::ReactorSurface::syncCoverages
void syncCoverages()
Set the coverages in the surface phase object to the values for this surface.
Definition: ReactorSurface.cpp:77
Cantera::ReactorSurface::setSensitivityParameters
void setSensitivityParameters(const double *params)
Set reaction rate multipliers.
Definition: ReactorSurface.cpp:102
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:72
Cantera::ReactorSurface::setArea
void setArea(double a)
Set the surface area [m^2].
Definition: ReactorSurface.cpp:27
Cantera::ReactorSurface::resetSensitivityParameters
void resetSensitivityParameters()
Set reaction rate multipliers back to their initial values.
Definition: ReactorSurface.cpp:110
Cantera::ReactorSurface::syncState
void syncState()
Set the coverages and temperature in the surface phase object to the values for this surface.
Definition: ReactorSurface.cpp:84
Cantera::ReactorSurface::setCoverages
void setCoverages(const double *cov)
Set the surface coverages.
Definition: ReactorSurface.cpp:55
Cantera::ReactorSurface::setKinetics
void setKinetics(Kinetics *kin)
Set the InterfaceKinetics object for this surface.
Definition: ReactorSurface.cpp:32
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:90
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:125
Cantera
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:557
Cantera::Composition
std::map< std::string, double > Composition
Map from string names to doubles.
Definition: ct_defs.h:180
Cantera::vector_fp
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