makeTurbulenceModel.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2013-2016 OpenFOAM Foundation
9 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
29//- Define turbulence model typedefs, with EddyDiffusivity
30#define defineTurbulenceModelTypes( \
31 Alpha, Rho, baseModel, BaseModel, Transport) \
32 \
33 namespace Foam \
34 { \
35 typedef TurbulenceModel \
36 < \
37 Alpha, \
38 Rho, \
39 baseModel, \
40 Transport \
41 > Transport##baseModel; \
42 \
43 typedef BaseModel<Transport> \
44 Transport##BaseModel; \
45 \
46 typedef laminarModel<Transport##BaseModel> \
47 laminar##Transport##BaseModel; \
48 \
49 typedef RASModel<Transport##BaseModel> \
50 RAS##Transport##BaseModel; \
51 \
52 typedef LESModel<Transport##BaseModel> \
53 LES##Transport##BaseModel; \
54 }
55
56// Legacy name
57#define makeTurbulenceModelTypes(a, b, c, d, e) \
58 defineTurbulenceModelTypes(a, b, c, d, e)
59
60
61#define makeBaseTurbulenceModel(Alpha, Rho, baseModel, BaseModel, Transport) \
62 /* Turbulence typedefs */ \
63 defineTurbulenceModelTypes(Alpha, Rho, baseModel, BaseModel, Transport) \
64 \
65 namespace Foam \
66 { \
67 /* Turbulence selection table */ \
68 defineTemplateRunTimeSelectionTable \
69 ( \
70 Transport##baseModel, \
71 dictionary \
72 ); \
73 \
74 /* Laminar models */ \
75 defineNamedTemplateTypeNameAndDebug(laminar##Transport##BaseModel, 0); \
76 \
77 defineTemplateRunTimeSelectionTable \
78 (laminar##Transport##BaseModel, dictionary); \
79 \
80 addToRunTimeSelectionTable \
81 ( \
82 Transport##baseModel, \
83 laminar##Transport##BaseModel, \
84 dictionary \
85 ); \
86 \
87 /* RAS models */ \
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 /* LES models */ \
101 defineNamedTemplateTypeNameAndDebug(LES##Transport##BaseModel, 0); \
102 \
103 defineTemplateRunTimeSelectionTable \
104 (LES##Transport##BaseModel, dictionary); \
105 \
106 addToRunTimeSelectionTable \
107 ( \
108 Transport##baseModel, \
109 LES##Transport##BaseModel, \
110 dictionary \
111 ); \
112 }
113
114
115#define makeTemplatedTurbulenceModel(BaseModel, SType, Type) \
116 defineNamedTemplateTypeNameAndDebug \
117 (Foam::SType##Models::Type<Foam::BaseModel>, 0); \
118 \
119 namespace Foam \
120 { \
121 namespace SType##Models \
122 { \
123 typedef Type<BaseModel> Type##SType##BaseModel; \
124 \
125 addToRunTimeSelectionTable \
126 ( \
127 SType##BaseModel, \
128 Type##SType##BaseModel, \
129 dictionary \
130 ); \
131 } \
132 }
133
134
135#define makeTurbulenceModel(BaseModel, SType, Type) \
136 namespace Foam \
137 { \
138 namespace SType##Models \
139 { \
140 defineTypeNameAndDebug(Type, 0); \
141 \
142 addToRunTimeSelectionTable \
143 ( \
144 SType##BaseModel, \
145 Type, \
146 dictionary \
147 ); \
148 } \
149 }
150
151
152// ************************************************************************* //