DispersionModel.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) 2011-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::DispersionModel
28 
29 Group
30  grpLagrangianIntermediateDispersionSubModels
31 
32 Description
33  Base class for dispersion modelling
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef DispersionModel_H
38 #define DispersionModel_H
39 
40 #include "IOdictionary.H"
41 #include "autoPtr.H"
42 #include "runTimeSelectionTables.H"
43 #include "CloudSubModelBase.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class DispersionModel Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class CloudType>
55 class DispersionModel
56 :
57  public CloudSubModelBase<CloudType>
58 {
59 public:
60 
61  //- Runtime type information
62  TypeName("dispersionModel");
63 
64 
65  // Declare runtime constructor selection table
66 
68  (
69  autoPtr,
71  dictionary,
72  (
73  const dictionary& dict,
74  CloudType& owner
75  ),
76  (dict, owner)
77  );
78 
79 
80  // Constructors
81 
82  //- Construct null from owner
83  DispersionModel(CloudType& owner);
84 
85  //- Construct from components
87  (
88  const dictionary& dict,
89  CloudType& owner,
90  const word& type
91  );
92 
93  //- Construct copy
94  DispersionModel(const DispersionModel<CloudType>& dm);
95 
96  //- Construct and return a clone
97  virtual autoPtr<DispersionModel<CloudType>> clone() const = 0;
98 
99 
100  //- Destructor
101  virtual ~DispersionModel();
102 
103 
104  //- Selector
105  static autoPtr<DispersionModel<CloudType>> New
106  (
107  const dictionary& dict,
108  CloudType& owner
109  );
110 
111 
112  // Member Functions
113 
114  //- Update (disperse particles)
115  virtual vector update
116  (
117  const scalar dt,
118  const label celli,
119  const vector& U,
120  const vector& Uc,
121  vector& UTurb,
122  scalar& tTurb
123  ) = 0;
124 };
125 
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 } // End namespace Foam
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #define makeDispersionModel(CloudType) \
134  \
135  typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \
136  defineTemplateTypeNameAndDebug \
137  (Foam::DispersionModel<kinematicCloudType>, 0); \
138  \
139  namespace Foam \
140  { \
141  defineTemplateRunTimeSelectionTable \
142  ( \
143  DispersionModel<kinematicCloudType>, \
144  dictionary \
145  ); \
146  }
147 
148 #define makeDispersionModelType(SS, CloudType) \
149  \
150  typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \
151  defineNamedTemplateTypeNameAndDebug(Foam::SS<kinematicCloudType>, 0); \
152  \
153  Foam::DispersionModel<kinematicCloudType>:: \
154  adddictionaryConstructorToTable<Foam::SS<kinematicCloudType>> \
155  add##SS##CloudType##kinematicCloudType##ConstructorToTable_;
156 
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #ifdef NoRepository
161  #include "DispersionModel.C"
162 #endif
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************************************************************* //
Foam::DispersionModel::DispersionModel
DispersionModel(CloudType &owner)
Construct null from owner.
Definition: DispersionModel.C:33
Foam::DispersionModel::TypeName
TypeName("dispersionModel")
Runtime type information.
DispersionModel.C
CloudSubModelBase.H
Foam::DispersionModel::~DispersionModel
virtual ~DispersionModel()
Destructor.
Definition: DispersionModel.C:64
Foam::CloudType
DSMCCloud< dsmcParcel > CloudType
Definition: makeDSMCParcelBinaryCollisionModels.C:38
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::DispersionModel::update
virtual vector update(const scalar dt, const label celli, const vector &U, const vector &Uc, vector &UTurb, scalar &tTurb)=0
Update (disperse particles)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
IOdictionary.H
U
U
Definition: pEqn.H:72
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
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::DispersionModel::New
static autoPtr< DispersionModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
Definition: DispersionModelNew.C:36
Foam::DispersionModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, DispersionModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Foam::DispersionModel::clone
virtual autoPtr< DispersionModel< CloudType > > clone() const =0
Construct and return a clone.
autoPtr.H