DampingModel.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::DampingModel
29 
30 Group
31  grpLagrangianIntermediateMPPICDampingSubModels
32 
33 Description
34  Base class for collisional damping models.
35 
36 SourceFiles
37  DampingModel.C
38  DampingModelNew.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef DampingModel_H
43 #define DampingModel_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 DampingModel Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 template<class CloudType>
64 class DampingModel
65 :
66  public CloudSubModelBase<CloudType>
67 {
68 protected:
69 
70  // Protected data
71 
72  //- Time scale model
74 
75 
76 public:
77 
78  //- Runtime type information
79  TypeName("dampingModel");
80 
81  //- Declare runtime constructor selection table
83  (
84  autoPtr,
86  dictionary,
87  (
88  const dictionary& dict,
89  CloudType& owner
90  ),
91  (dict, owner)
92  );
93 
94 
95  // Constructors
96 
97  //- Construct null from owner
98  DampingModel(CloudType& owner);
99 
100  //- Construct from components
102  (
103  const dictionary& dict,
104  CloudType& owner,
105  const word& type
106  );
107 
108  //- Construct copy
110 
111  //- Construct and return a clone
112  virtual autoPtr<DampingModel<CloudType>> clone() const = 0;
113 
114 
115  //- Destructor
116  virtual ~DampingModel();
117 
118 
119  //- Selector
121  (
122  const dictionary& dict,
123  CloudType& owner
124  );
125 
126 
127  // Member Functions
128 
129  //- Calculate the velocity correction
130  virtual vector velocityCorrection
131  (
132  typename CloudType::parcelType& p,
133  const scalar deltaT
134  ) const = 0;
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #define makeDampingModel(CloudType) \
145  \
146  typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \
147  defineNamedTemplateTypeNameAndDebug \
148  ( \
149  Foam::DampingModel<kinematicCloudType>, \
150  0 \
151  ); \
152  \
153  namespace Foam \
154  { \
155  defineTemplateRunTimeSelectionTable \
156  ( \
157  DampingModel<kinematicCloudType>, \
158  dictionary \
159  ); \
160  }
161 
162 
163 #define makeDampingModelType(SS, CloudType) \
164  \
165  typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \
166  defineNamedTemplateTypeNameAndDebug \
167  (Foam::DampingModels::SS<kinematicCloudType>, 0); \
168  \
169  Foam::DampingModel<kinematicCloudType>:: \
170  adddictionaryConstructorToTable \
171  <Foam::DampingModels::SS<kinematicCloudType>> \
172  add##SS##CloudType##kinematicCloudType##ConstructorToTable_;
173 
174 
175 // These are used to defined models in MPPIC cloud specifically
176 
177 #define makeDampingModelMPPIC(CloudType) \
178  \
179  typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
180  defineNamedTemplateTypeNameAndDebug \
181  ( \
182  Foam::DampingModel<MPPICCloudType>, \
183  0 \
184  ); \
185  \
186  namespace Foam \
187  { \
188  defineTemplateRunTimeSelectionTable \
189  ( \
190  DampingModel<MPPICCloudType>, \
191  dictionary \
192  ); \
193  }
194 
195 
196 #define makeDampingModelTypeMPPIC(SS, CloudType) \
197  \
198  typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
199  defineNamedTemplateTypeNameAndDebug \
200  (Foam::DampingModels::SS<MPPICCloudType>, 0); \
201  \
202  Foam::DampingModel<MPPICCloudType>:: \
203  adddictionaryConstructorToTable \
204  <Foam::DampingModels::SS<MPPICCloudType>> \
205  add##SS##CloudType##MPPICCloudType##ConstructorToTable_;
206 
207 
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 
210 #ifdef NoRepository
211  #include "DampingModel.C"
212 #endif
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 #endif
217 
218 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::DampingModel
Base class for collisional damping models.
Definition: KinematicCloud.H:101
Foam::DampingModel::~DampingModel
virtual ~DampingModel()
Destructor.
Definition: DampingModel.C:72
DampingModel.C
CloudSubModelBase.H
Foam::DampingModel::New
static autoPtr< DampingModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
Definition: DampingModel.C:81
Foam::DampingModel::velocityCorrection
virtual vector velocityCorrection(typename CloudType::parcelType &p, const scalar deltaT) const =0
Calculate the velocity correction.
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
dict
dictionary dict
Definition: searchingEngine.H:14
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
Foam::DampingModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, DampingModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
Foam::DampingModel::TypeName
TypeName("dampingModel")
Runtime type information.
Foam::DampingModel::DampingModel
DampingModel(CloudType &owner)
Construct null from owner.
Definition: DampingModel.C:35
IOdictionary.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::Vector< scalar >
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::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Foam::DampingModel::timeScaleModel_
autoPtr< TimeScaleModel > timeScaleModel_
Time scale model.
Definition: DampingModel.H:72
Foam::DampingModel::clone
virtual autoPtr< DampingModel< CloudType > > clone() const =0
Construct and return a clone.
autoPtr.H