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 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::DampingModel
28 
29 Group
30  grpLagrangianIntermediateMPPICDampingSubModels
31 
32 Description
33  Base class for collisional damping models.
34 
35 SourceFiles
36  DampingModel.C
37  DampingModelNew.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef DampingModel_H
42 #define DampingModel_H
43 
44 #include "IOdictionary.H"
45 #include "autoPtr.H"
46 #include "runTimeSelectionTables.H"
47 #include "CloudSubModelBase.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 // Forward declaration of classes
55 
56 class TimeScaleModel;
57 
58 /*---------------------------------------------------------------------------*\
59  Class DampingModel Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 template<class CloudType>
63 class DampingModel
64 :
65  public CloudSubModelBase<CloudType>
66 {
67 protected:
68 
69  // Protected data
70 
71  //- Time scale model
73 
74 
75 public:
76 
77  //- Runtime type information
78  TypeName("dampingModel");
79 
80  //- Declare runtime constructor selection table
82  (
83  autoPtr,
85  dictionary,
86  (
87  const dictionary& dict,
88  CloudType& owner
89  ),
90  (dict, owner)
91  );
92 
93 
94  // Constructors
95 
96  //- Construct null from owner
97  DampingModel(CloudType& owner);
98 
99  //- Construct from components
101  (
102  const dictionary& dict,
103  CloudType& owner,
104  const word& type
105  );
106 
107  //- Construct copy
109 
110  //- Construct and return a clone
111  virtual autoPtr<DampingModel<CloudType>> clone() const = 0;
112 
113 
114  //- Destructor
115  virtual ~DampingModel();
116 
117 
118  //- Selector
120  (
121  const dictionary& dict,
122  CloudType& owner
123  );
124 
125 
126  // Member Functions
127 
128  //- Calculate the velocity correction
129  virtual vector velocityCorrection
130  (
131  typename CloudType::parcelType& p,
132  const scalar deltaT
133  ) const = 0;
134 };
135 
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 } // End namespace Foam
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 #define makeDampingModel(CloudType) \
144  \
145  typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
146  defineNamedTemplateTypeNameAndDebug \
147  ( \
148  Foam::DampingModel<MPPICCloudType>, \
149  0 \
150  ); \
151  \
152  namespace Foam \
153  { \
154  defineTemplateRunTimeSelectionTable \
155  ( \
156  DampingModel<MPPICCloudType>, \
157  dictionary \
158  ); \
159  }
160 
161 
162 #define makeDampingModelType(SS, CloudType) \
163  \
164  typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
165  defineNamedTemplateTypeNameAndDebug \
166  (Foam::DampingModels::SS<MPPICCloudType>, 0); \
167  \
168  Foam::DampingModel<MPPICCloudType>:: \
169  adddictionaryConstructorToTable \
170  <Foam::DampingModels::SS<MPPICCloudType>> \
171  add##SS##CloudType##MPPICCloudType##ConstructorToTable_;
172 
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #ifdef NoRepository
177  #include "DampingModel.C"
178 #endif
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #endif
183 
184 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::DampingModel
Base class for collisional damping models.
Definition: MPPICCloud.H:61
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:121
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:71
Foam::DampingModel::clone
virtual autoPtr< DampingModel< CloudType > > clone() const =0
Construct and return a clone.
autoPtr.H