IrreversibleReaction.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) 2011-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::IrreversibleReaction
26 
27 Description
28  Simple extension of Reaction to handle irreversible reactions
29 
30 SourceFiles
31  IrreversibleReaction.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef IrreversibleReaction_H
36 #define IrreversibleReaction_H
37 
38 #include "Reaction.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class IrreversibleReaction Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template
50 <
51  template<class> class ReactionType,
52  class ReactionThermo,
53  class ReactionRate
54 >
56 :
57  public ReactionType<ReactionThermo>
58 {
59  // Private Data
60 
61  ReactionRate k_;
62 
63 
64 public:
65 
66  //- Runtime type information
67  TypeName("irreversible");
68 
69 
70  // Constructors
71 
72  //- Construct from components
74  (
75  const ReactionType<ReactionThermo>& reaction,
76  const ReactionRate& reactionRate
77  );
78 
79  //- Construct as copy given new speciesTable
81  (
83  <
84  ReactionType,
85  ReactionThermo,
86  ReactionRate
87  >&,
88  const speciesTable& species
89  );
90 
91  //- Construct from dictionary
93  (
94  const speciesTable& species,
95  const HashPtrTable<ReactionThermo>& thermoDatabase,
96  const dictionary& dict
97  );
98 
99  //- Construct and return a clone
100  virtual autoPtr<Reaction<ReactionThermo>> clone() const
101  {
103  (
105  <
106  ReactionType,
107  ReactionThermo,
108  ReactionRate
109  >(*this)
110  );
111  }
112 
113  //- Construct and return a clone with new speciesTable
115  (
116  const speciesTable& species
117  ) const
118  {
120  (
122  <
123  ReactionType,
124  ReactionThermo,
125  ReactionRate
126  >
127  (
128  *this,
129  species
130  )
131  );
132  }
133 
134 
135  //- Destructor
136  virtual ~IrreversibleReaction()
137  {}
138 
139 
140  // Member Functions
141 
142  // IrreversibleReaction rate coefficients
143 
144  //- Forward rate constant
145  virtual scalar kf
146  (
147  const scalar p,
148  const scalar T,
149  const scalarField& c
150  ) const;
151 
152  //- Reverse rate constant from the given forward rate constant
153  // Returns 0
154  virtual scalar kr
155  (
156  const scalar kfwd,
157  const scalar p,
158  const scalar T,
159  const scalarField& c
160  ) const;
161 
162  //- Reverse rate constant
163  // Returns 0
164  virtual scalar kr
165  (
166  const scalar p,
167  const scalar T,
168  const scalarField& c
169  ) const;
170 
171 
172  // IrreversibleReaction Jacobian functions
173 
174  //- Temperature derivative of forward rate
175  virtual scalar dkfdT
176  (
177  const scalar p,
178  const scalar T,
179  const scalarField& c
180  ) const;
181 
182  //- Temperature derivative of reverse rate
183  // Returns 0
184  virtual scalar dkrdT
185  (
186  const scalar p,
187  const scalar T,
188  const scalarField& c,
189  const scalar dkfdT,
190  const scalar kr
191  ) const;
192 
193  //- Third-body efficiencies (beta = 1-alpha)
194  // non-empty only for third-body reactions
195  // with enhanced molecularity (alpha != 1)
196  virtual const List<Tuple2<label, scalar>>& beta() const;
197 
198  //- Species concentration derivative of the pressure dependent term
199  // By default this value is 1 as it multiplies the third-body term
200  virtual void dcidc
201  (
202  const scalar p,
203  const scalar T,
204  const scalarField& c,
206  ) const;
207 
208  //- Temperature derivative of the pressure dependent term
209  // By default this value is 0 since ddT of molecularity is approx.0
210  virtual scalar dcidT
211  (
212  const scalar p,
213  const scalar T,
214  const scalarField& c
215  ) const;
216 
217 
218  //- Write
219  virtual void write(Ostream&) const; // Private Member Functions
220 
221 
222  // Member Operators
223 
224  //- Disallow default bitwise assignment
225  void operator=
226  (
228  <
229  ReactionType,
230  ReactionThermo,
231  ReactionRate
232  >&
233  ) = delete;
234 };
235 
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 } // End namespace Foam
240 
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 
243 #ifdef NoRepository
244  #include "IrreversibleReaction.C"
245 #endif
246 
247 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
248 
249 #endif
250 
251 // ************************************************************************* //
dictionary dict
virtual void write(Ostream &) const
Write.
virtual scalar kr(const scalar kfwd, const scalar p, const scalar T, const scalarField &c) const
Reverse rate constant from the given forward rate constant.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
virtual ~IrreversibleReaction()
Destructor.
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
TypeName("irreversible")
Runtime type information.
virtual autoPtr< Reaction< ReactionThermo > > clone() const
Construct and return a clone.
A HashTable specialization for hashing pointers.
Definition: HashPtrTable.H:50
virtual scalar dkfdT(const scalar p, const scalar T, const scalarField &c) const
Temperature derivative of forward rate.
virtual scalar kf(const scalar p, const scalar T, const scalarField &c) const
Forward rate constant.
virtual scalar dcidT(const scalar p, const scalar T, const scalarField &c) const
Temperature derivative of the pressure dependent term.
virtual const List< Tuple2< label, scalar > > & beta() const
Third-body efficiencies (beta = 1-alpha)
IrreversibleReaction(const ReactionType< ReactionThermo > &reaction, const ReactionRate &reactionRate)
Construct from components.
virtual scalar dkrdT(const scalar p, const scalar T, const scalarField &c, const scalar dkfdT, const scalar kr) const
Temperature derivative of reverse rate.
CombustionModel< rhoReactionThermo > & reaction
virtual void dcidc(const scalar p, const scalar T, const scalarField &c, scalarField &dcidc) const
Species concentration derivative of the pressure dependent term.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
A wordList with hashed indices for faster lookup by name.
const dimensionedScalar c
Speed of light in a vacuum.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
volScalarField & p
Simple extension of Reaction to handle irreversible reactions.
Namespace for OpenFOAM.