FreeFOAM The Cross-Platform CFD Toolkit
makeReactionThermo.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) 1991-2010 OpenCFD Ltd.
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::makeReactionThermo
26 
27 Description
28  Macros for instantiating reactions on given thermo packages
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef makeReactionThermo_H
33 #define makeReactionThermo_H
34 
35 #include <specie/Reaction.H>
36 
40 
41 #include <specie/specieThermo.H>
42 
44 #include <specie/janafThermo.H>
45 #include <specie/perfectGas.H>
46 
49 #include <specie/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<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 
83 #define makePressureDependentReaction(Thermo, Reaction, PressureDependentReactionRate, ReactionRate, FallOffFunction) \
84  \
85  typedef PressureDependentReactionRate<ReactionRate, FallOffFunction> \
86  PressureDependentReactionRate##ReactionRate##FallOffFunction; \
87  \
88  makeReaction \
89  ( \
90  Thermo, \
91  Reaction, \
92  PressureDependentReactionRate##ReactionRate##FallOffFunction \
93  )
94 
95 
96 #define makeIRReactions(Thermo, ReactionRate) \
97  \
98  makeReaction(Thermo, IrreversibleReaction, ReactionRate) \
99  \
100  makeReaction(Thermo, ReversibleReaction, ReactionRate)
101 
102 
103 #define makeIRNReactions(Thermo, ReactionRate) \
104  \
105  makeIRReactions(Thermo, ReactionRate) \
106  \
107  makeReaction(Thermo, NonEquilibriumReversibleReaction, ReactionRate)
108 
109 
110 #define makePressureDependentReactions(Thermo, ReactionRate, FallOffFunction) \
111  \
112  makePressureDependentReaction \
113  ( \
114  Thermo, \
115  IrreversibleReaction, \
116  FallOffReactionRate, \
117  ReactionRate, \
118  FallOffFunction \
119  ) \
120  \
121  makePressureDependentReaction \
122  ( \
123  Thermo, \
124  ReversibleReaction, \
125  FallOffReactionRate, \
126  ReactionRate, \
127  FallOffFunction \
128  ) \
129  \
130  makePressureDependentReaction \
131  ( \
132  Thermo, \
133  IrreversibleReaction, \
134  ChemicallyActivatedReactionRate, \
135  ReactionRate, \
136  FallOffFunction \
137  ) \
138  \
139  makePressureDependentReaction \
140  ( \
141  Thermo, \
142  ReversibleReaction, \
143  ChemicallyActivatedReactionRate, \
144  ReactionRate, \
145  FallOffFunction \
146  )
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace Foam
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #endif
156 
157 // ************************ vim: set sw=4 sts=4 et: ************************ //