Cantera  2.3.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 
22  //! Returns the surface area [m^2]
23  double area() const;
24 
25  //! Set the surface area [m^2]
26  void setArea(double a);
27 
28  //! Accessor for the SurfPhase object
29  SurfPhase* thermo() {
30  return m_thermo;
31  }
32 
33  //! Accessor for the InterfaceKinetics object
34  Kinetics* kinetics() {
35  return m_kinetics;
36  }
37 
38  //! Set the InterfaceKinetics object for this surface
39  void setKinetics(Kinetics* kin);
40 
41  //! Set the reactor that this Surface interacts with
42  void setReactor(ReactorBase* reactor);
43 
44  //! Number of sensitivity parameters associated with reactions on this
45  //! surface
46  size_t nSensParams() const {
47  return m_params.size();
48  }
49 
50  //! Set the surface coverages. Array `cov` has length equal to the number of
51  //! surface species.
52  void setCoverages(const double* cov);
53 
54  //! Set the surface coverages by name
55  void setCoverages(const Composition& cov);
56 
57  //! Set the surface coverages by name
58  void setCoverages(const std::string& cov);
59 
60  //! Get the surface coverages. Array `cov` should have length equal to the
61  //! number of surface species.
62  void getCoverages(double* cov) const;
63 
64  //! Set the coverages in the surface phase object to the values for this
65  //! surface.
66  void syncCoverages();
67 
68  //! Enable calculation of sensitivities with respect to the rate constant
69  //! for reaction `i`.
70  void addSensitivityReaction(size_t i);
71 
72  //! Set reaction rate multipliers. `params` is the global vector of
73  //! sensitivity parameters. This function is called within
74  //! ReactorNet::eval() before the reaction rates are evaluated.
75  void setSensitivityParameters(const double* params);
76 
77  //! Set reaction rate multipliers back to their initial values. This
78  //! function is called within ReactorNet::eval() after all rates have been
79  //! evaluated.
80  void resetSensitivityParameters();
81 
82 protected:
83  double m_area;
84 
85  SurfPhase* m_thermo;
86  Kinetics* m_kinetics;
87  ReactorBase* m_reactor;
88  vector_fp m_cov;
89  std::vector<SensitivityParameter> m_params;
90 };
91 
92 }
93 
94 #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: application.cpp:29