SurfaceFilmModel.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-2018 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::regionModels::SurfaceFilmModel
26 
27 Description
28  Templated wall surface film model class.
29 
30 SourceFiles
31  SurfaceFilmModel.C
32  SurfaceFilmModelNew.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef SurfaceFilmModel_H
37 #define SurfaceFilmModel_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 namespace regionModels
51 {
52  namespace surfaceFilmModels
53  {
55  }
56 }
57 
58 /*---------------------------------------------------------------------------*\
59  Class SurfaceFilmModel Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 template<class CloudType>
63 class SurfaceFilmModel
64 :
65  public CloudSubModelBase<CloudType>
66 {
67 protected:
68 
69  // Protected data
70 
71  //- Convenience typedef to the cloud's parcel type
72  typedef typename CloudType::parcelType parcelType;
73 
74  //- Gravitational acceleration constant
75  const dimensionedVector& g_;
76 
77  //- Ejected parcel type label - id assigned to identify parcel for
78  // post-processing. If not specified, defaults to originating cloud
79  // type
80  label ejectedParcelType_;
81 
82 
83  // Cached injector fields per film patch
84 
85  //- Parcel mass / patch face
86  scalarList massParcelPatch_;
87 
88  //- Parcel diameter / patch face
89  scalarList diameterParcelPatch_;
90 
91  //- Film velocity / patch face
92  List<vector> UFilmPatch_;
93 
94  //- Film density / patch face
95  scalarList rhoFilmPatch_;
96 
97  //- Film height of all film patches / patch face
98  scalarListList deltaFilmPatch_;
99 
100 
101  // Counters
102 
103  //- Number of parcels transferred to the film model
104  label nParcelsTransferred_;
105 
106  //- Number of parcels injected from the film model
107  label nParcelsInjected_;
108 
109 
110  // Protected functions
111 
112  //- Cache the film fields in preparation for injection
113  virtual void cacheFilmFields
114  (
115  const label filmPatchi,
116  const label primaryPatchi,
118  );
119 
120  //- Set the individual parcel properties
121  virtual void setParcelProperties
122  (
123  parcelType& p,
124  const label filmFacei
125  ) const;
126 
127 
128 public:
129 
130  //- Runtime type information
131  TypeName("surfaceFilmModel");
132 
133  //- Declare runtime constructor selection table
135  (
136  autoPtr,
138  dictionary,
139  (
140  const dictionary& dict,
141  CloudType& owner
142  ),
143  (dict, owner)
144  );
145 
146 
147  // Constructors
148 
149  //- Construct null from owner
150  SurfaceFilmModel(CloudType& owner);
151 
152  //- Construct from components
154  (
155  const dictionary& dict,
156  CloudType& owner,
157  const word& type
158  );
159 
160  //- Construct copy
162 
163  //- Construct and return a clone
164  virtual autoPtr<SurfaceFilmModel<CloudType>> clone() const = 0;
165 
166 
167  //- Destructor
168  virtual ~SurfaceFilmModel();
169 
170 
171  //- Selector
173  (
174  const dictionary& dict,
175  CloudType& owner
176  );
177 
178 
179  // Member Functions
180 
181  // Access
182 
183  //- Return gravitational acceleration constant
184  inline const dimensionedVector& g() const;
185 
186  //- Return const access to the number of parcels transferred to the
187  // film model
188  inline label nParcelsTransferred() const;
189 
190  //- Return non-const access to the number of parcels transferred to
191  // the film model
192  inline label& nParcelsTransferred();
193 
194  //- Return const access to the number of parcels injected from the
195  // film model
196  inline label nParcelsInjected() const;
197 
198  //- Return non-const access to the number of parcels injected from
199  // the film model
200  inline label& nParcelsInjected();
201 
202 
203  // Member Functions
204 
205  //- Transfer parcel from cloud to surface film
206  // Returns true if parcel is to be transferred
207  virtual bool transferParcel
208  (
209  parcelType& p,
210  const polyPatch& pp,
211  bool& keepParticle
212  ) = 0;
213 
214  //- Inject parcels into the cloud
215  template<class TrackCloudType>
216  void inject(TrackCloudType& cloud);
217 
218 
219  // I-O
220 
221  //- Write surface film info to stream
222  virtual void info(Ostream& os);
223 };
224 
225 
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 
228 } // End namespace Foam
229 
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 #define makeSurfaceFilmModel(CloudType) \
233  \
234  typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \
235  defineNamedTemplateTypeNameAndDebug \
236  ( \
237  Foam::SurfaceFilmModel<kinematicCloudType>, \
238  0 \
239  ); \
240  namespace Foam \
241  { \
242  defineTemplateRunTimeSelectionTable \
243  ( \
244  SurfaceFilmModel<kinematicCloudType>, \
245  dictionary \
246  ); \
247  }
248 
250 #define makeSurfaceFilmModelType(SS, CloudType) \
251  \
252  typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \
253  defineNamedTemplateTypeNameAndDebug(Foam::SS<kinematicCloudType>, 0); \
254  \
255  Foam::SurfaceFilmModel<kinematicCloudType>:: \
256  adddictionaryConstructorToTable<Foam::SS<kinematicCloudType>> \
257  add##SS##CloudType##kinematicCloudType##ConstructorToTable_;
258 
259 
260 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
261 
262 #include "SurfaceFilmModelI.H"
263 
264 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
265 
266 #ifdef NoRepository
267  #include "SurfaceFilmModel.C"
268 #endif
269 
270 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
271 
272 #endif
273 
274 // ************************************************************************* //
dictionary dict
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
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Base class for cloud sub-models.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
A class for handling words, derived from string.
Definition: word.H:59
A cloud is a collection of lagrangian particles.
Definition: cloud.H:51
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:70
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:218
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
Templated wall surface film model class.
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:481
#define declareRunTimeSelectionTable(autoPtr, baseType, argNames, argList, parList)
Declare a run-time selection.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Macros to ease declaration of run-time selection tables.
volScalarField & p
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
const dimensionedVector & g
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:69
Namespace for OpenFOAM.