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 -------------------------------------------------------------------------------
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::PackingModel
28 
29 Group
30  grpLagrangianIntermediateMPPICPackingSubModels
31 
32 Description
33  Base class for packing models.
34 
35 SourceFiles
36  PackingModel.C
37  PackingModelNew.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef PackingModel_H
42 #define PackingModel_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 ParticleStressModel;
57 
58 class CorrectionLimitingMethod;
59 
60 template<class Type>
61 class AveragingMethod;
62 
63 /*---------------------------------------------------------------------------*\
64  Class PackingModel Declaration
65 \*---------------------------------------------------------------------------*/
66 
67 template<class CloudType>
68 class PackingModel
69 :
70  public CloudSubModelBase<CloudType>
71 {
72 protected:
73 
74  //- Protected data
75 
76  //- Particle stress model
78 
79 
80 public:
81 
82  //- Runtime type information
83  TypeName("packingModel");
84 
85  //- Declare runtime constructor selection table
87  (
88  autoPtr,
90  dictionary,
91  (
92  const dictionary& dict,
93  CloudType& owner
94  ),
95  (dict, owner)
96  );
97 
98 
99  // Constructors
100 
101  //- Construct null from owner
102  PackingModel(CloudType& owner);
103 
104  //- Construct from components
106  (
107  const dictionary& dict,
108  CloudType& owner,
109  const word& type
110  );
111 
112  //- Construct copy
114 
115  //- Construct and return a clone
116  virtual autoPtr<PackingModel<CloudType>> clone() const = 0;
117 
118 
119  //- Destructor
120  virtual ~PackingModel();
121 
122 
123  //- Selector
125  (
126  const dictionary& dict,
127  CloudType& owner
128  );
129 
130 
131  // Member Functions
132 
133  //- Calculate the velocity correction
134  virtual vector velocityCorrection
135  (
136  typename CloudType::parcelType& p,
137  const scalar deltaT
138  ) const = 0;
139 };
140 
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 } // End namespace Foam
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #define makePackingModel(CloudType) \
149  \
150  typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
151  defineNamedTemplateTypeNameAndDebug \
152  ( \
153  Foam::PackingModel<MPPICCloudType>, \
154  0 \
155  ); \
156  \
157  namespace Foam \
158  { \
159  defineTemplateRunTimeSelectionTable \
160  ( \
161  PackingModel<MPPICCloudType>, \
162  dictionary \
163  ); \
164  }
165 
166 
167 #define makePackingModelType(SS, CloudType) \
168  \
169  typedef Foam::CloudType::MPPICCloudType MPPICCloudType; \
170  defineNamedTemplateTypeNameAndDebug \
171  (Foam::PackingModels::SS<MPPICCloudType>, 0); \
172  \
173  Foam::PackingModel<MPPICCloudType>:: \
174  adddictionaryConstructorToTable \
175  <Foam::PackingModels::SS<MPPICCloudType>> \
176  add##SS##CloudType##MPPICCloudType##ConstructorToTable_;
177 
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #ifdef NoRepository
182  #include "PackingModel.C"
183 #endif
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
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:76
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
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: MPPICCloud.H:58
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
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