ReactionProxy.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2018-2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::ReactionProxy
26 
27 Description
28  Proxy version of Reaction which provides dummy implementations of the
29  abstract virtual functions.
30 
31  Used for read-construction and format conversion.
32 
33 SourceFiles
34  ReactionProxy.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef ReactionProxy_H
39 #define ReactionProxy_H
40 
41 #include "Reaction.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class ReactionProxy Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class ThermoType>
53 class ReactionProxy
54 :
55  public Reaction<ThermoType>
56 {
57 
58 public:
59 
60  // Constructors
61 
62  //- Construct from components
64  (
65  const speciesTable& species,
66  const PtrList<ThermoType>& speciesThermo,
67  const List<specieCoeffs>& lhs,
68  const List<specieCoeffs>& rhs
69  );
70 
71  //- Construct and return a clone
72  virtual autoPtr<Reaction<ThermoType>> clone() const;
73 
74  //- Construct and return a clone with new speciesTable
76  (
77  const speciesTable& species
78  ) const;
79 
80 
81  //- Destructor
82  virtual ~ReactionProxy()
83  {}
84 
85 
86  // Member Functions
87 
88  // Hooks
89 
90  //- Pre-evaluation hook
91  virtual void preEvaluate() const;
92 
93  //- Post-evaluation hook
94  virtual void postEvaluate() const;
95 
96 
97  // Reaction rate coefficients
98 
99  //- Forward rate constant
100  virtual scalar kf
101  (
102  const scalar p,
103  const scalar T,
104  const scalarField& c,
105  const label li
106  ) const;
107 
108  //- Reverse rate constant from the given forward rate constant
109  virtual scalar kr
110  (
111  const scalar kfwd,
112  const scalar p,
113  const scalar T,
114  const scalarField& c,
115  const label li
116  ) const;
117 
118  //- Reverse rate constant
119  virtual scalar kr
120  (
121  const scalar p,
122  const scalar T,
123  const scalarField& c,
124  const label li
125  ) const;
126 
127 
128  // Jacobian coefficients
129 
130  //- Temperature derivative of forward rate
131  virtual scalar dkfdT
132  (
133  const scalar p,
134  const scalar T,
135  const scalarField& c,
136  const label li
137  ) const;
138 
139  //- Temperature derivative of reverse rate
140  virtual scalar dkrdT
141  (
142  const scalar p,
143  const scalar T,
144  const scalarField& c,
145  const label li,
146  const scalar dkfdT,
147  const scalar kr
148  ) const;
149 
150  //- Does this reaction have concentration-dependent rate constants?
151  virtual bool hasDkdc() const;
152 
153  //- Concentration derivative of forward rate
154  void dkfdc
155  (
156  const scalar p,
157  const scalar T,
158  const scalarField& c,
159  const label li,
161  ) const;
162 
163  //- Concentration derivative of reverse rate
164  void dkrdc
165  (
166  const scalar p,
167  const scalar T,
168  const scalarField& c,
169  const label li,
170  const scalarField& dkfdc,
171  const scalar kr,
173  ) const;
174 };
175 
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 } // End namespace Foam
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #ifdef NoRepository
184  #include "ReactionProxy.C"
185 #endif
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #endif
190 
191 // ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:91
Proxy version of Reaction which provides dummy implementations of the abstract virtual functions.
Definition: ReactionProxy.H:55
virtual scalar kf(const scalar p, const scalar T, const scalarField &c, const label li) const
Forward rate constant.
virtual void postEvaluate() const
Post-evaluation hook.
virtual void preEvaluate() const
Pre-evaluation hook.
virtual scalar kr(const scalar kfwd, const scalar p, const scalar T, const scalarField &c, const label li) const
Reverse rate constant from the given forward rate constant.
virtual autoPtr< Reaction< ThermoType > > clone() const
Construct and return a clone.
ReactionProxy(const speciesTable &species, const PtrList< ThermoType > &speciesThermo, const List< specieCoeffs > &lhs, const List< specieCoeffs > &rhs)
Construct from components.
void dkfdc(const scalar p, const scalar T, const scalarField &c, const label li, scalarField &dkfdc) const
Concentration derivative of forward rate.
virtual bool hasDkdc() const
Does this reaction have concentration-dependent rate constants?
virtual ~ReactionProxy()
Destructor.
Definition: ReactionProxy.H:81
virtual scalar dkfdT(const scalar p, const scalar T, const scalarField &c, const label li) const
Temperature derivative of forward rate.
virtual scalar dkrdT(const scalar p, const scalar T, const scalarField &c, const label li, const scalar dkfdT, const scalar kr) const
Temperature derivative of reverse rate.
void dkrdc(const scalar p, const scalar T, const scalarField &c, const label li, const scalarField &dkfdc, const scalar kr, scalarField &dkrdc) const
Concentration derivative of reverse rate.
Simple extension of ThermoType to handle reaction kinetics in addition to the equilibrium thermodynam...
Definition: Reaction.H:72
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A wordList with hashed indices for faster lookup by name.
const speciesTable & species() const
Return the specie list.
Definition: reactionI.H:48
const List< specieCoeffs > & lhs() const
Return the components of the left hand side.
Definition: reactionI.H:36
const List< specieCoeffs > & rhs() const
Return the components of the right hand side.
Definition: reactionI.H:42
const dimensionedScalar c
Speed of light in a vacuum.
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
volScalarField & p