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