IsotropyModel.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-2020 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 Class
25  Foam::IsotropyModel
26 
27 Description
28  Base class for collisional return-to-isotropy models.
29 
30 SourceFiles
31  IsotropyModel.C
32  IsotropyModelNew.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef IsotropyModel_H
37 #define IsotropyModel_H
38 
39 #include "IOdictionary.H"
40 #include "autoPtr.H"
41 #include "runTimeSelectionTables.H"
42 #include "CloudSubModelBase.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 // Forward declaration of classes
50 
51 class TimeScaleModel;
52 
53 /*---------------------------------------------------------------------------*\
54  Class IsotropyModel Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 template<class CloudType>
58 class IsotropyModel
59 :
60  public CloudSubModelBase<CloudType>
61 {
62 protected:
63 
64  //- Time scale model
66 
67 
68 public:
69 
70  //- Runtime type information
71  TypeName("isotropyModel");
72 
73  //- Declare runtime constructor selection table
75  (
76  autoPtr,
78  dictionary,
79  (
80  const dictionary& dict,
82  ),
83  (dict, owner)
84  );
85 
86 
87  // Constructors
88 
89  //- Construct null from owner
91 
92  //- Construct from components
94  (
95  const dictionary& dict,
97  const word& type
98  );
99 
100  //- Construct a copy
102 
103  //- Construct and return a clone
104  virtual autoPtr<IsotropyModel<CloudType>> clone() const = 0;
105 
106 
107  //- Destructor
108  virtual ~IsotropyModel();
109 
110 
111  //- Selector
113  (
114  const dictionary& dict,
116  );
117 
118 
119  //- Member Functions
120 
121  //- Calculate velocities
122  virtual void calculate() = 0;
123 };
124 
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 } // End namespace Foam
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 #define makeIsotropyModel(CloudType) \
133  \
134  typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
135  defineNamedTemplateTypeNameAndDebug \
136  ( \
137  Foam::IsotropyModel<MPPICCloudType>, \
138  0 \
139  ); \
140  \
141  namespace Foam \
142  { \
143  defineTemplateRunTimeSelectionTable \
144  ( \
145  IsotropyModel<MPPICCloudType>, \
146  dictionary \
147  ); \
148  }
149 
150 
151 #define makeIsotropyModelType(SS, CloudType) \
152  \
153  typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
154  defineNamedTemplateTypeNameAndDebug \
155  (Foam::IsotropyModels::SS<MPPICCloudType>, 0); \
156  \
157  Foam::IsotropyModel<MPPICCloudType>:: \
158  adddictionaryConstructorToTable \
159  <Foam::IsotropyModels::SS<MPPICCloudType>> \
160  add##SS##CloudType##MPPICCloudType##ConstructorToTable_;
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #ifdef NoRepository
166  #include "IsotropyModel.C"
167 #endif
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #endif
172 
173 // ************************************************************************* //
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:80
Base class for collisional return-to-isotropy models.
Definition: IsotropyModel.H:60
virtual autoPtr< IsotropyModel< CloudType > > clone() const =0
Construct and return a clone.
TypeName("isotropyModel")
Runtime type information.
IsotropyModel(CloudType &owner)
Construct null from owner.
Definition: IsotropyModel.C:33
autoPtr< TimeScaleModel > timeScaleModel_
Time scale model.
Definition: IsotropyModel.H:64
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:87
virtual ~IsotropyModel()
Destructor.
Definition: IsotropyModel.C:78
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
Macros to ease declaration of run-time selection tables.