makeThermo.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) 2012-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::fluidThermo
26 
27 Description
28  Macros for creating basic fluid thermo packages
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef makeThermo_H
33 #define makeThermo_H
34 
35 #include "fluidThermo.H"
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
40 #define typedefThermoPhysics(Transport,Type,Thermo,EqnOfState,Specie) \
41  \
42  typedef \
43  Transport \
44  < \
45  species::thermo \
46  < \
47  Thermo \
48  < \
49  EqnOfState \
50  < \
51  Specie \
52  > \
53  >, \
54  Type \
55  > \
56  > \
57  Transport##Type##Thermo##EqnOfState##Specie
58 
59 
60 #define defineThermoPhysicsThermo(BaseThermo,CThermo,Mixture,ThermoPhys) \
61  \
62  typedef \
63  CThermo \
64  < \
65  BaseThermo, \
66  Mixture<ThermoPhys> \
67  > \
68  CThermo##Mixture##ThermoPhys; \
69  \
70  defineTemplateTypeNameAndDebugWithName \
71  ( \
72  CThermo##Mixture##ThermoPhys, \
73  (#CThermo"<" + Mixture<ThermoPhys>::typeName() + ">").c_str(), \
74  0 \
75  )
76 
77 
78 #define addThermoPhysicsThermo(BaseThermo,CThermoMixtureThermoPhys) \
79  \
80  addToRunTimeSelectionTable \
81  ( \
82  BaseThermo, \
83  CThermoMixtureThermoPhys, \
84  fvMesh \
85  ); \
86 
87 
88 #define makeThermoPhysicsThermo(BaseThermo,CThermo,Mixture,ThermoPhys) \
89  \
90  defineThermoPhysicsThermo(BaseThermo, CThermo, Mixture, ThermoPhys); \
91  \
92  addThermoPhysicsThermo(BaseThermo, CThermo##Mixture##ThermoPhys)
93 
94 
95 #define makeThermoPhysicsThermos(BaseThermo,CThermo,Mixture,ThermoPhys) \
96  \
97  defineThermoPhysicsThermo(BaseThermo, CThermo, Mixture, ThermoPhys); \
98  \
99  addThermoPhysicsThermo(basicThermo, CThermo##Mixture##ThermoPhys); \
100  addThermoPhysicsThermo(fluidThermo, CThermo##Mixture##ThermoPhys); \
101  addThermoPhysicsThermo(BaseThermo, CThermo##Mixture##ThermoPhys)
102 
103 
104 #define makeThermo(BaseThermo,CThermo,Mixture,Transport,Type,Thermo,EqnOfState,Specie) \
105  \
106  typedefThermoPhysics(Transport,Type,Thermo,EqnOfState,Specie); \
107  \
108  makeThermoPhysicsThermo \
109  ( \
110  BaseThermo, \
111  CThermo, \
112  Mixture, \
113  Transport##Type##Thermo##EqnOfState##Specie \
114  )
115 
116 
117 #define makeThermos(BaseThermo,CThermo,Mixture,Transport,Type,Thermo,EqnOfState,Specie) \
118  \
119  typedefThermoPhysics(Transport,Type,Thermo,EqnOfState,Specie); \
120  \
121  makeThermoPhysicsThermos \
122  ( \
123  BaseThermo, \
124  CThermo, \
125  Mixture, \
126  Transport##Type##Thermo##EqnOfState##Specie \
127  )
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.