PackingModel.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::PackingModel
26 
27 Description
28  Base class for packing models.
29 
30 SourceFiles
31  PackingModel.C
32  PackingModelNew.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef PackingModel_H
37 #define PackingModel_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 ParticleStressModel;
52 
53 class CorrectionLimitingMethod;
54 
55 template<class Type>
56 class AveragingMethod;
57 
58 /*---------------------------------------------------------------------------*\
59  Class PackingModel Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 template<class CloudType>
63 class PackingModel
64 :
65  public CloudSubModelBase<CloudType>
66 {
67 protected:
68 
69  //- Protected data
70 
71  //- Particle stress model
73 
74 
75 public:
76 
77  //- Runtime type information
78  TypeName("packingModel");
79 
80  //- Declare runtime constructor selection table
82  (
83  autoPtr,
85  dictionary,
86  (
87  const dictionary& dict,
89  ),
90  (dict, owner)
91  );
92 
93 
94  // Constructors
95 
96  //- Construct null from 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<PackingModel<CloudType>> clone() const = 0;
112 
113 
114  //- Destructor
115  virtual ~PackingModel();
116 
117 
118  //- Selector
120  (
121  const dictionary& dict,
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 makePackingModel(CloudType) \
144  \
145  typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
146  defineNamedTemplateTypeNameAndDebug \
147  ( \
148  Foam::PackingModel<MPPICCloudType>, \
149  0 \
150  ); \
151  \
152  namespace Foam \
153  { \
154  defineTemplateRunTimeSelectionTable \
155  ( \
156  PackingModel<MPPICCloudType>, \
157  dictionary \
158  ); \
159  }
160 
161 
162 #define makePackingModelType(SS, CloudType) \
163  \
164  typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
165  defineNamedTemplateTypeNameAndDebug \
166  (Foam::PackingModels::SS<MPPICCloudType>, 0); \
167  \
168  Foam::PackingModel<MPPICCloudType>:: \
169  adddictionaryConstructorToTable \
170  <Foam::PackingModels::SS<MPPICCloudType>> \
171  add##SS##CloudType##MPPICCloudType##ConstructorToTable_;
172 
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #ifdef NoRepository
177  #include "PackingModel.C"
178 #endif
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #endif
183 
184 // ************************************************************************* //
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
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:225
Base class for packing models.
Definition: PackingModel.H:65
virtual autoPtr< PackingModel< CloudType > > clone() const =0
Construct and return a clone.
autoPtr< ParticleStressModel > particleStressModel_
Protected data.
Definition: PackingModel.H:71
virtual vector velocityCorrection(typename CloudType::parcelType &p, const scalar deltaT) const =0
Calculate the velocity correction.
static autoPtr< PackingModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
Definition: PackingModel.C:80
PackingModel(CloudType &owner)
Construct null from owner.
Definition: PackingModel.C:34
declareRunTimeSelectionTable(autoPtr, PackingModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
virtual ~PackingModel()
Destructor.
Definition: PackingModel.C:71
TypeName("packingModel")
Runtime type information.
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.
volScalarField & p