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-2021 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 ReactionThermo>
53 class ReactionProxy
54 :
55  public Reaction<ReactionThermo>
56 {
57 
58 public:
59 
60  // Constructors
61 
62  //- Construct from components
64  (
65  const speciesTable& species,
66  const List<specieCoeffs>& lhs,
67  const List<specieCoeffs>& rhs,
68  const HashPtrTable<ReactionThermo>& thermoDatabase
69  );
70 
71  //- Construct as copy given new speciesTable
73  (
75  const speciesTable& species
76  );
77 
78  //- Construct from dictionary
80  (
81  const speciesTable& species,
82  const HashPtrTable<ReactionThermo>& thermoDatabase,
83  const dictionary& dict
84  );
85 
86  //- Construct and return a clone
87  virtual autoPtr<Reaction<ReactionThermo>> clone() const;
88 
89  //- Construct and return a clone with new speciesTable
91  (
92  const speciesTable& species
93  ) const;
94 
95 
96  //- Destructor
97  virtual ~ReactionProxy()
98  {}
99 
100 
101  // Member Functions
102 
103  // Hooks
104 
105  //- Pre-evaluation hook
106  virtual void preEvaluate() const;
107 
108  //- Post-evaluation hook
109  virtual void postEvaluate() const;
110 
111 
112  // Reaction rate coefficients
113 
114  //- Forward rate constant
115  virtual scalar kf
116  (
117  const scalar p,
118  const scalar T,
119  const scalarField& c,
120  const label li
121  ) const;
122 
123  //- Reverse rate constant from the given forward rate constant
124  virtual scalar kr
125  (
126  const scalar kfwd,
127  const scalar p,
128  const scalar T,
129  const scalarField& c,
130  const label li
131  ) const;
132 
133  //- Reverse rate constant
134  virtual scalar kr
135  (
136  const scalar p,
137  const scalar T,
138  const scalarField& c,
139  const label li
140  ) const;
141 
142 
143  // Jacobian coefficients
144 
145  //- Temperature derivative of forward rate
146  virtual scalar dkfdT
147  (
148  const scalar p,
149  const scalar T,
150  const scalarField& c,
151  const label li
152  ) const;
153 
154  //- Temperature derivative of reverse rate
155  virtual scalar dkrdT
156  (
157  const scalar p,
158  const scalar T,
159  const scalarField& c,
160  const label li,
161  const scalar dkfdT,
162  const scalar kr
163  ) const;
164 
165  //- Does this reaction have concentration-dependent rate constants?
166  virtual bool hasDkdc() const;
167 
168  //- Concentration derivative of forward rate
169  void dkfdc
170  (
171  const scalar p,
172  const scalar T,
173  const scalarField& c,
174  const label li,
176  ) const;
177 
178  //- Concentration derivative of reverse rate
179  void dkrdc
180  (
181  const scalar p,
182  const scalar T,
183  const scalarField& c,
184  const label li,
185  const scalarField& dkfdc,
186  const scalar kr,
188  ) const;
189 };
190 
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 } // End namespace Foam
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #ifdef NoRepository
199  #include "ReactionProxy.C"
200 #endif
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #endif
205 
206 // ************************************************************************* //
dictionary dict
void dkfdc(const scalar p, const scalar T, const scalarField &c, const label li, scalarField &dkfdc) const
Concentration derivative of forward rate.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Proxy version of Reaction which provides dummy implementations of the abstract virtual functions...
Definition: ReactionProxy.H:52
virtual scalar dkfdT(const scalar p, const scalar T, const scalarField &c, const label li) const
Temperature derivative of forward rate.
A HashTable specialisation for hashing pointers.
Definition: HashPtrTable.H:50
const List< specieCoeffs > & lhs() const
Return the components of the left hand side.
Definition: reactionI.H:36
const dimensionedScalar c
Speed of light in a vacuum.
Simple extension of ReactionThermo to handle reaction kinetics in addition to the equilibrium thermod...
Definition: Reaction.H:55
const speciesTable & species() const
Return the specie list.
Definition: reactionI.H:48
virtual autoPtr< Reaction< ReactionThermo > > clone() const
Construct and return a clone.
Definition: ReactionProxy.C:83
ReactionProxy(const speciesTable &species, const List< specieCoeffs > &lhs, const List< specieCoeffs > &rhs, const HashPtrTable< ReactionThermo > &thermoDatabase)
Construct from components.
Definition: ReactionProxy.C:32
virtual ~ReactionProxy()
Destructor.
Definition: ReactionProxy.H:96
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.
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 bool hasDkdc() const
Does this reaction have concentration-dependent rate constants?
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
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.
const List< specieCoeffs > & rhs() const
Return the components of the right hand side.
Definition: reactionI.H:42
A wordList with hashed indices for faster lookup by name.
virtual scalar kf(const scalar p, const scalar T, const scalarField &c, const label li) const
Forward rate constant.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
virtual void preEvaluate() const
Pre-evaluation hook.
volScalarField & p
virtual void postEvaluate() const
Post-evaluation hook.
Namespace for OpenFOAM.