IsotropyModel.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
27Class
28 Foam::IsotropyModel
29
30Group
31 grpLagrangianIntermediateMPPICIsotropySubModels
32
33Description
34 Base class for collisional return-to-isotropy models.
35
36SourceFiles
37 IsotropyModel.C
38 IsotropyModelNew.C
39
40\*---------------------------------------------------------------------------*/
41
42#ifndef IsotropyModel_H
43#define IsotropyModel_H
44
45#include "IOdictionary.H"
46#include "autoPtr.H"
48#include "CloudSubModelBase.H"
49
50// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
52namespace Foam
53{
54
55// Forward declaration of classes
56
57class TimeScaleModel;
58
59/*---------------------------------------------------------------------------*\
60 Class IsotropyModel Declaration
61\*---------------------------------------------------------------------------*/
62
63template<class CloudType>
64class IsotropyModel
65:
66 public CloudSubModelBase<CloudType>
67{
68protected:
69
70 //- Time scale model
72
73
74public:
75
76 //- Runtime type information
77 TypeName("isotropyModel");
78
79 //- Declare runtime constructor selection table
81 (
82 autoPtr,
85 (
86 const dictionary& dict,
88 ),
89 (dict, owner)
90 );
91
92
93 // Constructors
94
95 //- Construct null from owner
97
98 //- Construct from components
100 (
101 const dictionary& dict,
103 const word& type
104 );
105
106 //- Construct a copy
108
109 //- Construct and return a clone
110 virtual autoPtr<IsotropyModel<CloudType>> clone() const = 0;
111
112
113 //- Destructor
114 virtual ~IsotropyModel();
115
116
117 //- Selector
119 (
120 const dictionary& dict,
122 );
123
124
125 //- Member Functions
126
127 //- Calculate velocities
128 virtual void calculate() = 0;
129};
130
131
132// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133
134} // End namespace Foam
135
136// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138#define makeIsotropyModel(CloudType) \
139 \
140 typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \
141 defineNamedTemplateTypeNameAndDebug \
142 ( \
143 Foam::IsotropyModel<kinematicCloudType>, \
144 0 \
145 ); \
146 \
147 namespace Foam \
148 { \
149 defineTemplateRunTimeSelectionTable \
150 ( \
151 IsotropyModel<kinematicCloudType>, \
152 dictionary \
153 ); \
154 }
155
157#define makeIsotropyModelType(SS, CloudType) \
158 \
159 typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \
160 defineNamedTemplateTypeNameAndDebug \
161 (Foam::IsotropyModels::SS<kinematicCloudType>, 0); \
162 \
163 Foam::IsotropyModel<kinematicCloudType>:: \
164 adddictionaryConstructorToTable \
165 <Foam::IsotropyModels::SS<kinematicCloudType>> \
166 add##SS##CloudType##kinematicCloudType##ConstructorToTable_;
167
168
169// These are used to defined models in MPPIC cloud specifically
171#define makeIsotropyModelMPPIC(CloudType) \
172 \
173 typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
174 defineNamedTemplateTypeNameAndDebug \
175 (Foam::IsotropyModel<MPPICCloudType>, 0); \
176 \
177 namespace Foam \
178 { \
179 defineTemplateRunTimeSelectionTable \
180 ( \
181 IsotropyModel<MPPICCloudType>, \
182 dictionary \
183 ); \
184 }
185
187#define makeIsotropyModelTypeMPPIC(SS, CloudType) \
188 \
189 typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
190 defineNamedTemplateTypeNameAndDebug \
191 (Foam::IsotropyModels::SS<MPPICCloudType>, 0); \
192 \
193 Foam::IsotropyModel<MPPICCloudType>:: \
194 adddictionaryConstructorToTable \
195 <Foam::IsotropyModels::SS<MPPICCloudType>> \
196 add##SS##CloudType##MPPICCloudType##ConstructorToTable_;
197
198// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199
200#ifdef NoRepository
201 #include "IsotropyModel.C"
202#endif
203
204// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205
206#endif
207
208// ************************************************************************* //
Base class for cloud sub-models.
const CloudType & owner() const
Return const access to the owner cloud.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
Base class for collisional return-to-isotropy models.
Definition: IsotropyModel.H:66
TypeName("isotropyModel")
Runtime type information.
autoPtr< TimeScaleModel > timeScaleModel_
Time scale model.
Definition: IsotropyModel.H:70
declareRunTimeSelectionTable(autoPtr, IsotropyModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
virtual void calculate()=0
Member Functions.
static autoPtr< IsotropyModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
Definition: IsotropyModel.C:84
virtual ~IsotropyModel()
Destructor.
Definition: IsotropyModel.C:75
virtual autoPtr< IsotropyModel< CloudType > > clone() const =0
Construct and return a clone.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:113
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:598
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73