makeReaction.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 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  dictionary \
80  );
81 
82 
83 #define makePressureDependentReaction\
84 ( \
85  Thermo, \
86  Reaction, \
87  PressureDependentReactionRate, \
88  ReactionRate, \
89  FallOffFunction \
90 ) \
91  \
92  typedef PressureDependentReactionRate<ReactionRate, FallOffFunction> \
93  PressureDependentReactionRate##ReactionRate##FallOffFunction; \
94  \
95  makeReaction \
96  ( \
97  Thermo, \
98  Reaction, \
99  PressureDependentReactionRate##ReactionRate##FallOffFunction \
100  )
101 
102 
103 #define makeIRReactions(Thermo, ReactionRate) \
104  \
105  makeReaction(Thermo, IrreversibleReaction, ReactionRate) \
106  \
107  makeReaction(Thermo, ReversibleReaction, ReactionRate)
108 
109 
110 #define makeIRNReactions(Thermo, ReactionRate) \
111  \
112  makeIRReactions(Thermo, ReactionRate) \
113  \
114  makeReaction(Thermo, NonEquilibriumReversibleReaction, ReactionRate)
115 
116 
117 #define makePressureDependentReactions(Thermo, ReactionRate, FallOffFunction) \
118  \
119  makePressureDependentReaction \
120  ( \
121  Thermo, \
122  IrreversibleReaction, \
123  FallOffReactionRate, \
124  ReactionRate, \
125  FallOffFunction \
126  ) \
127  \
128  makePressureDependentReaction \
129  ( \
130  Thermo, \
131  ReversibleReaction, \
132  FallOffReactionRate, \
133  ReactionRate, \
134  FallOffFunction \
135  ) \
136  \
137  makePressureDependentReaction \
138  ( \
139  Thermo, \
140  IrreversibleReaction, \
141  ChemicallyActivatedReactionRate, \
142  ReactionRate, \
143  FallOffFunction \
144  ) \
145  \
146  makePressureDependentReaction \
147  ( \
148  Thermo, \
149  ReversibleReaction, \
150  ChemicallyActivatedReactionRate, \
151  ReactionRate, \
152  FallOffFunction \
153  )
154 
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #endif
163 
164 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Namespace for OpenFOAM.