makeTurbulenceModel.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) 2015-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 \*---------------------------------------------------------------------------*/
25 
26 #include "EddyDiffusivity.H"
27 
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 
30 #define makeTurbulenceModelTypes( \
31  Alpha, Rho, baseModel, BaseModel, TDModel, Transport) \
32  \
33  namespace Foam \
34  { \
35  typedef TDModel<BaseModel<Transport>> \
36  Transport##BaseModel; \
37  typedef laminarModel<Transport##BaseModel> \
38  laminar##Transport##BaseModel; \
39  typedef RASModel<EddyDiffusivity<Transport##BaseModel>> \
40  RAS##Transport##BaseModel; \
41  typedef LESModel<EddyDiffusivity<Transport##BaseModel>> \
42  LES##Transport##BaseModel; \
43  }
44 
45 
46 #define makeBaseTurbulenceModel( \
47  Alpha, Rho, baseModel, BaseModel, TDModel, Transport) \
48  \
49  namespace Foam \
50  { \
51  typedef TurbulenceModel \
52  < \
53  Alpha, \
54  Rho, \
55  baseModel, \
56  Transport \
57  > Transport##baseModel; \
58  \
59  defineTemplateRunTimeSelectionTable \
60  ( \
61  Transport##baseModel, \
62  dictionary \
63  ); \
64  \
65  typedef TDModel<BaseModel<Transport>> \
66  Transport##BaseModel; \
67  \
68  \
69  typedef laminarModel<Transport##BaseModel> \
70  laminar##Transport##BaseModel; \
71  \
72  defineNamedTemplateTypeNameAndDebug(laminar##Transport##BaseModel, 0); \
73  \
74  defineTemplateRunTimeSelectionTable \
75  (laminar##Transport##BaseModel, dictionary); \
76  \
77  addToRunTimeSelectionTable \
78  ( \
79  Transport##baseModel, \
80  laminar##Transport##BaseModel, \
81  dictionary \
82  ); \
83  \
84  \
85  typedef RASModel<EddyDiffusivity<Transport##BaseModel>> \
86  RAS##Transport##BaseModel; \
87  \
88  defineNamedTemplateTypeNameAndDebug(RAS##Transport##BaseModel, 0); \
89  \
90  defineTemplateRunTimeSelectionTable \
91  (RAS##Transport##BaseModel, dictionary); \
92  \
93  addToRunTimeSelectionTable \
94  ( \
95  Transport##baseModel, \
96  RAS##Transport##BaseModel, \
97  dictionary \
98  ); \
99  \
100  \
101  typedef LESModel<EddyDiffusivity<Transport##BaseModel>> \
102  LES##Transport##BaseModel; \
103  \
104  defineNamedTemplateTypeNameAndDebug(LES##Transport##BaseModel, 0); \
105  \
106  defineTemplateRunTimeSelectionTable \
107  (LES##Transport##BaseModel, dictionary); \
108  \
109  addToRunTimeSelectionTable \
110  ( \
111  Transport##baseModel, \
112  LES##Transport##BaseModel, \
113  dictionary \
114  ); \
115  }
116 
117 
118 #define makeTemplatedLaminarModel(BaseModel, SType, Type) \
119  typedef Foam::SType##Models::Type<Foam::BaseModel> \
120  Type##SType##BaseModel; \
121  defineNamedTemplateTypeNameAndDebug(Type##SType##BaseModel, 0); \
122  \
123  namespace Foam \
124  { \
125  namespace SType##Models \
126  { \
127  typedef Type<BaseModel> Type##SType##BaseModel; \
128  \
129  addToRunTimeSelectionTable \
130  ( \
131  SType##BaseModel, \
132  Type##SType##BaseModel, \
133  dictionary \
134  ); \
135  } \
136  }
137 
138 
139 #define makeTemplatedTurbulenceModel(BaseModel, SType, Type) \
140  typedef Foam::SType##Models::Type<Foam::EddyDiffusivity<Foam::BaseModel>> \
141  Type##SType##BaseModel; \
142  defineNamedTemplateTypeNameAndDebug(Type##SType##BaseModel, 0); \
143  \
144  namespace Foam \
145  { \
146  namespace SType##Models \
147  { \
148  typedef Type<EddyDiffusivity<BaseModel>> Type##SType##BaseModel; \
149  \
150  addToRunTimeSelectionTable \
151  ( \
152  SType##BaseModel, \
153  Type##SType##BaseModel, \
154  dictionary \
155  ); \
156  } \
157  }
158 
159 
160 #define makeTurbulenceModel(BaseModel, SType, Type) \
161  namespace Foam \
162  { \
163  namespace SType##Models \
164  { \
165  defineTypeNameAndDebug(Type, 0); \
166  \
167  addToRunTimeSelectionTable \
168  ( \
169  SType##BaseModel, \
170  Type, \
171  dictionary \
172  ); \
173  } \
174  }
175 
176 
177 // ************************************************************************* //