All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DispersionModel.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) 2011-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::DispersionModel
26 
27 Description
28 
29 \*---------------------------------------------------------------------------*/
30 
31 #ifndef DispersionModel_H
32 #define DispersionModel_H
33 
34 #include "IOdictionary.H"
35 #include "autoPtr.H"
36 #include "runTimeSelectionTables.H"
37 #include "CloudSubModelBase.H"
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43 
44 /*---------------------------------------------------------------------------*\
45  Class DispersionModel Declaration
46 \*---------------------------------------------------------------------------*/
47 
48 template<class CloudType>
49 class DispersionModel
50 :
51  public CloudSubModelBase<CloudType>
52 {
53 public:
54 
55  //- Runtime type information
56  TypeName("dispersionModel");
57 
58 
59  // Declare runtime constructor selection table
60 
62  (
63  autoPtr,
65  dictionary,
66  (
67  const dictionary& dict,
69  ),
70  (dict, owner)
71  );
72 
73 
74  // Constructors
75 
76  //- Construct null from owner
77  DispersionModel(CloudType& owner);
78 
79  //- Construct from components
81  (
82  const dictionary& dict,
83  CloudType& owner,
84  const word& type
85  );
86 
87  //- Construct copy
88  DispersionModel(const DispersionModel<CloudType>& dm);
89 
90  //- Construct and return a clone
91  virtual autoPtr<DispersionModel<CloudType>> clone() const = 0;
92 
93 
94  //- Destructor
95  virtual ~DispersionModel();
96 
97 
98  //- Selector
99  static autoPtr<DispersionModel<CloudType>> New
100  (
101  const dictionary& dict,
102  CloudType& owner
103  );
104 
105 
106  // Member Functions
107 
108  //- Update (disperse particles)
109  virtual vector update
110  (
111  const scalar dt,
112  const label celli,
113  const vector& U,
114  const vector& Uc,
115  vector& UTurb,
116  scalar& tTurb
117  ) = 0;
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 #define makeDispersionModel(CloudType) \
128  \
129  typedef Foam::CloudType::momentumCloudType momentumCloudType; \
130  defineTemplateTypeNameAndDebug \
131  (Foam::DispersionModel<momentumCloudType>, 0); \
132  \
133  namespace Foam \
134  { \
135  defineTemplateRunTimeSelectionTable \
136  ( \
137  DispersionModel<momentumCloudType>, \
138  dictionary \
139  ); \
140  }
142 #define makeDispersionModelType(SS, CloudType) \
143  \
144  typedef Foam::CloudType::momentumCloudType momentumCloudType; \
145  defineNamedTemplateTypeNameAndDebug(Foam::SS<momentumCloudType>, 0); \
146  \
147  Foam::DispersionModel<momentumCloudType>:: \
148  adddictionaryConstructorToTable<Foam::SS<momentumCloudType>> \
149  add##SS##CloudType##momentumCloudType##ConstructorToTable_;
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #ifdef NoRepository
155  #include "DispersionModel.C"
156 #endif
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #endif
161 
162 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
DSMCCloud< dsmcParcel > CloudType
static autoPtr< DispersionModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
declareRunTimeSelectionTable(autoPtr, DispersionModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
virtual ~DispersionModel()
Destructor.
const CloudType & owner() const
Return const access to the owner cloud.
virtual autoPtr< DispersionModel< CloudType > > clone() const =0
Construct and return a clone.
U
Definition: pEqn.H:72
virtual vector update(const scalar dt, const label celli, const vector &U, const vector &Uc, vector &UTurb, scalar &tTurb)=0
Update (disperse particles)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
DispersionModel(CloudType &owner)
Construct null from owner.
Macros to ease declaration of run-time selection tables.
TypeName("dispersionModel")
Runtime type information.
Namespace for OpenFOAM.