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