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-------------------------------------------------------------------------------
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::DampingModel
29
30Group
31 grpLagrangianIntermediateMPPICDampingSubModels
32
33Description
34 Base class for collisional damping models.
35
36SourceFiles
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"
48#include "CloudSubModelBase.H"
49
50// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
52namespace Foam
53{
54
55// Forward declaration of classes
56
57class TimeScaleModel;
58
59/*---------------------------------------------------------------------------*\
60 Class DampingModel Declaration
61\*---------------------------------------------------------------------------*/
62
63template<class CloudType>
64class DampingModel
65:
66 public CloudSubModelBase<CloudType>
67{
68protected:
69
70 // Protected data
71
72 //- Time scale model
74
75
76public:
77
78 //- Runtime type information
79 TypeName("dampingModel");
80
81 //- Declare runtime constructor selection table
83 (
84 autoPtr,
87 (
88 const dictionary& dict,
90 ),
91 (dict, owner)
92 );
93
94
95 // Constructors
96
97 //- Construct null from owner
99
100 //- Construct from components
102 (
103 const dictionary& dict,
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,
124 );
125
126
127 // Member Functions
128
129 //- Calculate the velocity correction
131 (
132 typename CloudType::parcelType& p,
133 const scalar deltaT
134 ) const = 0;
135};
136
137
138// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139
140} // End namespace Foam
141
142// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
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
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
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
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// ************************************************************************* //
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
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Base class for collisional damping models.
Definition: DampingModel.H:66
autoPtr< TimeScaleModel > timeScaleModel_
Time scale model.
Definition: DampingModel.H:72
virtual ~DampingModel()
Destructor.
Definition: DampingModel.C:72
virtual vector velocityCorrection(typename CloudType::parcelType &p, const scalar deltaT) const =0
Calculate the velocity correction.
TypeName("dampingModel")
Runtime type information.
static autoPtr< DampingModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
Definition: DampingModel.C:81
virtual autoPtr< DampingModel< CloudType > > clone() const =0
Construct and return a clone.
declareRunTimeSelectionTable(autoPtr, DampingModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
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
volScalarField & p
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