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 -------------------------------------------------------------------------------
11 License
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 Class
28  Foam::IsotropyModel
29 
30 Group
31  grpLagrangianIntermediateMPPICIsotropySubModels
32 
33 Description
34  Base class for collisional return-to-isotropy models.
35 
36 SourceFiles
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"
47 #include "runTimeSelectionTables.H"
48 #include "CloudSubModelBase.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 // Forward declaration of classes
56 
57 class TimeScaleModel;
58 
59 /*---------------------------------------------------------------------------*\
60  Class IsotropyModel Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 template<class CloudType>
64 class IsotropyModel
65 :
66  public CloudSubModelBase<CloudType>
67 {
68 protected:
69 
70  //- Time scale model
72 
73 
74 public:
75 
76  //- Runtime type information
77  TypeName("isotropyModel");
78 
79  //- Declare runtime constructor selection table
81  (
82  autoPtr,
84  dictionary,
85  (
86  const dictionary& dict,
87  CloudType& owner
88  ),
89  (dict, owner)
90  );
91 
92 
93  // Constructors
94 
95  //- Construct null from owner
96  IsotropyModel(CloudType& owner);
97 
98  //- Construct from components
100  (
101  const dictionary& dict,
102  CloudType& owner,
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,
121  CloudType& owner
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
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 
156 
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
170 
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 
186 
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 // ************************************************************************* //
Foam::IsotropyModel::IsotropyModel
IsotropyModel(CloudType &owner)
Construct null from owner.
Definition: IsotropyModel.C:35
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::IsotropyModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, IsotropyModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
CloudSubModelBase.H
Foam::IsotropyModel::timeScaleModel_
autoPtr< TimeScaleModel > timeScaleModel_
Time scale model.
Definition: IsotropyModel.H:70
Foam::IsotropyModel::clone
virtual autoPtr< IsotropyModel< CloudType > > clone() const =0
Construct and return a clone.
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
dict
dictionary dict
Definition: searchingEngine.H:14
IsotropyModel.C
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
IOdictionary.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::IsotropyModel::~IsotropyModel
virtual ~IsotropyModel()
Destructor.
Definition: IsotropyModel.C:75
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
Foam::IsotropyModel
Base class for collisional return-to-isotropy models.
Definition: KinematicCloud.H:104
Foam::IsotropyModel::calculate
virtual void calculate()=0
Member Functions.
Foam::IsotropyModel::New
static autoPtr< IsotropyModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
Definition: IsotropyModel.C:84
Foam::IsotropyModel::TypeName
TypeName("isotropyModel")
Runtime type information.
autoPtr.H