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-2018 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  // Private Member Functions
65 
66  //- Disallow default bitwise assignment
67  void operator=
68  (
70  <
71  ReactionType,
72  ReactionThermo,
73  ReactionRate
74  >&
75  );
76 
77 
78 public:
79 
80  //- Runtime type information
81  TypeName("irreversible");
82 
83 
84  // Constructors
85 
86  //- Construct from components
88  (
89  const ReactionType<ReactionThermo>& reaction,
90  const ReactionRate& reactionRate
91  );
92 
93  //- Construct as copy given new speciesTable
95  (
97  <
98  ReactionType,
99  ReactionThermo,
100  ReactionRate
101  >&,
102  const speciesTable& species
103  );
104 
105  //- Construct from dictionary
107  (
108  const speciesTable& species,
109  const HashPtrTable<ReactionThermo>& thermoDatabase,
110  const dictionary& dict
111  );
112 
113  //- Construct and return a clone
114  virtual autoPtr<Reaction<ReactionThermo>> clone() const
115  {
117  (
119  <
120  ReactionType,
121  ReactionThermo,
122  ReactionRate
123  >(*this)
124  );
125  }
126 
127  //- Construct and return a clone with new speciesTable
129  (
130  const speciesTable& species
131  ) const
132  {
134  (
136  <
137  ReactionType,
138  ReactionThermo,
139  ReactionRate
140  >
141  (
142  *this,
143  species
144  )
145  );
146  }
147 
148 
149  //- Destructor
150  virtual ~IrreversibleReaction()
151  {}
152 
153 
154  // Member Functions
155 
156  // IrreversibleReaction rate coefficients
157 
158  //- Forward rate constant
159  virtual scalar kf
160  (
161  const scalar p,
162  const scalar T,
163  const scalarField& c
164  ) const;
165 
166  //- Reverse rate constant from the given forward rate constant
167  // Returns 0
168  virtual scalar kr
169  (
170  const scalar kfwd,
171  const scalar p,
172  const scalar T,
173  const scalarField& c
174  ) const;
175 
176  //- Reverse rate constant
177  // Returns 0
178  virtual scalar kr
179  (
180  const scalar p,
181  const scalar T,
182  const scalarField& c
183  ) const;
184 
185 
186  // IrreversibleReaction Jacobian functions
187 
188  //- Temperature derivative of forward rate
189  virtual scalar dkfdT
190  (
191  const scalar p,
192  const scalar T,
193  const scalarField& c
194  ) const;
195 
196  //- Temperature derivative of reverse rate
197  // Returns 0
198  virtual scalar dkrdT
199  (
200  const scalar p,
201  const scalar T,
202  const scalarField& c,
203  const scalar dkfdT,
204  const scalar kr
205  ) const;
206 
207  //- Third-body efficiencies (beta = 1-alpha)
208  // non-empty only for third-body reactions
209  // with enhanced molecularity (alpha != 1)
210  virtual const List<Tuple2<label, scalar>>& beta() const;
211 
212  //- Species concentration derivative of the pressure dependent term
213  // By default this value is 1 as it multiplies the third-body term
214  virtual void dcidc
215  (
216  const scalar p,
217  const scalar T,
218  const scalarField& c,
220  ) const;
221 
222  //- Temperature derivative of the pressure dependent term
223  // By default this value is 0 since ddT of molecularity is approx.0
224  virtual scalar dcidT
225  (
226  const scalar p,
227  const scalar T,
228  const scalarField& c
229  ) const;
230 
231 
232  //- Write
233  virtual void write(Ostream&) const;
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:137
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:60
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.