makeReaction.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2016 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 InClass
25  Foam::makeReaction
26 
27 Description
28  Macros for instantiating reactions on given thermo packages
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef makeReaction_H
33 #define makeReaction_H
34 
35 #include "Reaction.H"
36 
37 #include "IrreversibleReaction.H"
38 #include "ReversibleReaction.H"
40 
41 #include "thermo.H"
42 
43 #include "sutherlandTransport.H"
44 #include "janafThermo.H"
45 #include "perfectGas.H"
46 
47 #include "polynomialTransport.H"
48 #include "hPolynomialThermo.H"
49 #include "icoPolynomial.H"
50 
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 
60 #define makeReaction(Thermo, ReactionType, ReactionRate) \
61  \
62  typedef Reaction<Thermo> Reaction##Thermo; \
63  \
64  typedef ReactionType<Reaction, Thermo, ReactionRate> \
65  ReactionType##Thermo##ReactionRate; \
66  \
67  template<> \
68  const word ReactionType##Thermo##ReactionRate::typeName \
69  ( \
70  ReactionType::typeName_() \
71  + ReactionRate::type() \
72  + Reaction##Thermo::typeName_() \
73  ); \
74  \
75  addToRunTimeSelectionTable \
76  ( \
77  Reaction##Thermo, \
78  ReactionType##Thermo##ReactionRate, \
79  Istream \
80  ); \
81  \
82  addToRunTimeSelectionTable \
83  ( \
84  Reaction##Thermo, \
85  ReactionType##Thermo##ReactionRate, \
86  dictionary \
87  );
88 
89 
90 #define makePressureDependentReaction\
91 ( \
92  Thermo, \
93  Reaction, \
94  PressureDependentReactionRate, \
95  ReactionRate, \
96  FallOffFunction \
97 ) \
98  \
99  typedef PressureDependentReactionRate<ReactionRate, FallOffFunction> \
100  PressureDependentReactionRate##ReactionRate##FallOffFunction; \
101  \
102  makeReaction \
103  ( \
104  Thermo, \
105  Reaction, \
106  PressureDependentReactionRate##ReactionRate##FallOffFunction \
107  )
108 
109 
110 #define makeIRReactions(Thermo, ReactionRate) \
111  \
112  makeReaction(Thermo, IrreversibleReaction, ReactionRate) \
113  \
114  makeReaction(Thermo, ReversibleReaction, ReactionRate)
115 
116 
117 #define makeIRNReactions(Thermo, ReactionRate) \
118  \
119  makeIRReactions(Thermo, ReactionRate) \
120  \
121  makeReaction(Thermo, NonEquilibriumReversibleReaction, ReactionRate)
122 
123 
124 #define makePressureDependentReactions(Thermo, ReactionRate, FallOffFunction) \
125  \
126  makePressureDependentReaction \
127  ( \
128  Thermo, \
129  IrreversibleReaction, \
130  FallOffReactionRate, \
131  ReactionRate, \
132  FallOffFunction \
133  ) \
134  \
135  makePressureDependentReaction \
136  ( \
137  Thermo, \
138  ReversibleReaction, \
139  FallOffReactionRate, \
140  ReactionRate, \
141  FallOffFunction \
142  ) \
143  \
144  makePressureDependentReaction \
145  ( \
146  Thermo, \
147  IrreversibleReaction, \
148  ChemicallyActivatedReactionRate, \
149  ReactionRate, \
150  FallOffFunction \
151  ) \
152  \
153  makePressureDependentReaction \
154  ( \
155  Thermo, \
156  ReversibleReaction, \
157  ChemicallyActivatedReactionRate, \
158  ReactionRate, \
159  FallOffFunction \
160  )
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Namespace for OpenFOAM.