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-------------------------------------------------------------------------------
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::PackingModel
29
30Group
31 grpLagrangianIntermediateMPPICPackingSubModels
32
33Description
34 Base class for packing models.
35
36SourceFiles
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"
48#include "CloudSubModelBase.H"
49
50// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
52namespace Foam
53{
54
55// Forward declaration of classes
56
57class ParticleStressModel;
58
59class CorrectionLimitingMethod;
60
61template<class Type>
62class AveragingMethod;
63
64/*---------------------------------------------------------------------------*\
65 Class PackingModel Declaration
66\*---------------------------------------------------------------------------*/
67
68template<class CloudType>
69class PackingModel
70:
71 public CloudSubModelBase<CloudType>
72{
73protected:
74
75 //- Protected data
76
77 //- Particle stress model
79
80
81public:
82
83 //- Runtime type information
84 TypeName("packingModel");
85
86 //- Declare runtime constructor selection table
88 (
89 autoPtr,
92 (
93 const dictionary& dict,
95 ),
96 (dict, owner)
97 );
98
99
100 // Constructors
101
102 //- Construct null from owner
104
105 //- Construct from components
107 (
108 const dictionary& dict,
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,
129 );
130
131
132 // Member Functions
133
134 //- Calculate the velocity correction
136 (
137 typename CloudType::parcelType& p,
138 const scalar deltaT
139 ) const = 0;
140};
141
142
143// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144
145} // End namespace Foam
146
147// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
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
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
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
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// ************************************************************************* //
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 packing models.
Definition: PackingModel.H:71
virtual autoPtr< PackingModel< CloudType > > clone() const =0
Construct and return a clone.
autoPtr< ParticleStressModel > particleStressModel_
Protected data.
Definition: PackingModel.H:77
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:83
declareRunTimeSelectionTable(autoPtr, PackingModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
virtual ~PackingModel()
Destructor.
Definition: PackingModel.C:74
TypeName("packingModel")
Runtime type information.
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