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