Cantera  2.4.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 http://www.cantera.org/license.txt for license and copyright information.
5 
6 #ifndef CT_REACTOR_SURFACE_H
7 #define CT_REACTOR_SURFACE_H
8 
10 
11 namespace Cantera
12 {
13 
14 class Kinetics;
15 class SurfPhase;
16 
17 class ReactorSurface
18 {
19 public:
20  ReactorSurface();
21  virtual ~ReactorSurface() {}
22  ReactorSurface(const ReactorSurface&) = delete;
23  ReactorSurface& operator=(const ReactorSurface&) = delete;
24 
25  //! Returns the surface area [m^2]
26  double area() const;
27 
28  //! Set the surface area [m^2]
29  void setArea(double a);
30 
31  //! Accessor for the SurfPhase object
32  SurfPhase* thermo() {
33  return m_thermo;
34  }
35 
36  //! Accessor for the InterfaceKinetics object
37  Kinetics* kinetics() {
38  return m_kinetics;
39  }
40 
41  //! Set the InterfaceKinetics object for this surface
42  void setKinetics(Kinetics* kin);
43 
44  //! Set the reactor that this Surface interacts with
45  void setReactor(ReactorBase* reactor);
46 
47  //! Number of sensitivity parameters associated with reactions on this
48  //! surface
49  size_t nSensParams() const {
50  return m_params.size();
51  }
52 
53  //! Set the surface coverages. Array `cov` has length equal to the number of
54  //! surface species.
55  void setCoverages(const double* cov);
56 
57  //! Set the surface coverages by name
58  void setCoverages(const Composition& cov);
59 
60  //! Set the surface coverages by name
61  void setCoverages(const std::string& cov);
62 
63  //! Get the surface coverages. Array `cov` should have length equal to the
64  //! number of surface species.
65  void getCoverages(double* cov) const;
66 
67  //! Set the coverages in the surface phase object to the values for this
68  //! surface.
69  void syncCoverages();
70 
71  //! Enable calculation of sensitivities with respect to the rate constant
72  //! for reaction `i`.
73  void addSensitivityReaction(size_t i);
74 
75  //! Set reaction rate multipliers. `params` is the global vector of
76  //! sensitivity parameters. This function is called within
77  //! ReactorNet::eval() before the reaction rates are evaluated.
78  void setSensitivityParameters(const double* params);
79 
80  //! Set reaction rate multipliers back to their initial values. This
81  //! function is called within ReactorNet::eval() after all rates have been
82  //! evaluated.
83  void resetSensitivityParameters();
84 
85 protected:
86  double m_area;
87 
88  SurfPhase* m_thermo;
89  Kinetics* m_kinetics;
90  ReactorBase* m_reactor;
91  vector_fp m_cov;
92  std::vector<SensitivityParameter> m_params;
93 };
94 
95 }
96 
97 #endif
std::map< std::string, doublereal > Composition
Map from string names to doubles.
Definition: ct_defs.h:153
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:157
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:8