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-2019 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  // Reaction rate coefficients
104 
105  //- Forward rate constant
106  virtual scalar kf
107  (
108  const scalar p,
109  const scalar T,
110  const scalarField& c,
111  const label li
112  ) const;
113 
114  //- Reverse rate constant from the given forward rate constant
115  virtual scalar kr
116  (
117  const scalar kfwd,
118  const scalar p,
119  const scalar T,
120  const scalarField& c,
121  const label li
122  ) const;
123 
124  //- Reverse rate constant
125  virtual scalar kr
126  (
127  const scalar p,
128  const scalar T,
129  const scalarField& c,
130  const label li
131  ) const;
132 
133 
134  // Jacobian coefficients
135 
136  //- Temperature derivative of forward rate
137  virtual scalar dkfdT
138  (
139  const scalar p,
140  const scalar T,
141  const scalarField& c,
142  const label li
143  ) const;
144 
145  //- Temperature derivative of reverse rate
146  virtual scalar dkrdT
147  (
148  const scalar p,
149  const scalar T,
150  const scalarField& c,
151  const label li,
152  const scalar dkfdT,
153  const scalar kr
154  ) const;
155 
156  //- Third-body efficiencies (beta = 1-alpha)
157  // non-empty only for third-body reactions
158  // with enhanced molecularity (alpha != 1)
159  virtual const List<Tuple2<label, scalar>>& beta() const;
160 
161  //- Species concentration derivative of the pressure dependent term
162  virtual void dcidc
163  (
164  const scalar p,
165  const scalar T,
166  const scalarField& c,
167  const label li,
169  ) const;
170 
171  //- Temperature derivative of the pressure dependent term
172  virtual scalar dcidT
173  (
174  const scalar p,
175  const scalar T,
176  const scalarField& c,
177  const label li
178  ) const;
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #ifdef NoRepository
189  #include "ReactionProxy.C"
190 #endif
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #endif
195 
196 // ************************************************************************* //
dictionary dict
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
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
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.
const List< specieCoeffs > & lhs() const
Return the components of the left hand side.
Definition: ReactionI.H:57
A HashTable specialization for hashing pointers.
Definition: HashPtrTable.H:50
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:56
const speciesTable & species() const
Return the specie list.
Definition: Reaction.C:715
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 const List< Tuple2< label, scalar > > & beta() const
Third-body efficiencies (beta = 1-alpha)
virtual void dcidc(const scalar p, const scalar T, const scalarField &c, const label li, scalarField &dcidc) const
Species concentration derivative of the pressure dependent term.
virtual scalar dcidT(const scalar p, const scalar T, const scalarField &c, const label li) const
Temperature derivative of the pressure dependent term.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
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
const List< specieCoeffs > & rhs() const
Return the components of the right hand side.
Definition: ReactionI.H:64
volScalarField & p
Namespace for OpenFOAM.