SurfaceFilmModel.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-2017 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::SurfaceFilmModel
29
30Group
31 grpLagrangianIntermediateSurfaceFilmSubModels
32
33Description
34 Templated wall surface film model class.
35
36SourceFiles
37 SurfaceFilmModel.C
38 SurfaceFilmModelNew.C
39
40\*---------------------------------------------------------------------------*/
41
42#ifndef SurfaceFilmModel_H
43#define SurfaceFilmModel_H
44
45#include "IOdictionary.H"
46#include "autoPtr.H"
48#include "CloudSubModelBase.H"
49
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace Foam
54{
55
56// Forward declaration of classes
57namespace regionModels
58{
59 namespace surfaceFilmModels
60 {
61 class surfaceFilmRegionModel;
62 }
63}
64
65namespace regionModels
66{
67 namespace areaSurfaceFilmModels
68 {
69 class liquidFilmBase;
70 }
71}
72
73
74/*---------------------------------------------------------------------------*\
75 Class SurfaceFilmModel Declaration
76\*---------------------------------------------------------------------------*/
77
78template<class CloudType>
80:
81 public CloudSubModelBase<CloudType>
82{
83protected:
84
85 // Protected data
86
87 //- Convenience typedef to the cloud's parcel type
88 typedef typename CloudType::parcelType parcelType;
89
90 typedef typename
92
93 //- Gravitational acceleration constant
94 const dimensionedVector& g_;
95
96 //- Ejected parcel type label - id assigned to identify parcel for
97 // post-processing. If not specified, defaults to originating cloud
98 // type
100
101 //- Injection offset position
102 scalar injectionOffset_;
103
104 //- Minimum diameter particle injection
105 scalar minDiameter_;
106
107
108 // Cached injector fields per film patch
109
110 //- Parcel mass / patch face
112
113 //- Parcel diameter / patch face
115
116 //- Film velocity / patch face
118
119 //- Film density / patch face
121
122 //- Film height of all film patches / patch face
124
125
126 // Counters
127
128 //- Number of parcels transferred to the film model
130
131 //- Number of parcels injected from the film model
132 label nParcelsInjected_;
133
134
135 // Total mass info
136
137 //- Total mass transferred to the film
139
140
141 // Protected functions
142
143 //- Cache the film fields in preparation for injection
144 virtual void cacheFilmFields
145 (
146 const label filmPatchi,
147 const label primaryPatchi,
149 );
150
151 //- Cache the finite area film fields in preparation for injection
152 virtual void cacheFilmFields
153 (
154 const label primaryPatchi,
155 const areaFilm&
156 );
157
158 //- Inject particles in cloud
159 template<class TrackCloudType>
160 void injectParticles
161 (
162 const label primaryPatchi,
163 const labelList& injectorCellsPatch,
164 TrackCloudType& cloud
165 );
166
167 //- Set the individual parcel properties
168 virtual void setParcelProperties
169 (
170 parcelType& p,
171 const label filmFacei
172 ) const;
173
174
175public:
176
177 //- Runtime type information
178 TypeName("surfaceFilmModel");
179
180 //- Declare runtime constructor selection table
182 (
183 autoPtr,
186 (
187 const dictionary& dict,
189 ),
190 (dict, owner)
191 );
192
193
194 // Constructors
195
196 //- Construct null from owner
198
199 //- Construct from components
201 (
202 const dictionary& dict,
204 const word& type
205 );
206
207 //- Construct copy
209
210 //- Construct and return a clone
211 virtual autoPtr<SurfaceFilmModel<CloudType>> clone() const = 0;
212
213
214 //- Destructor
215 virtual ~SurfaceFilmModel();
216
217
218 //- Selector
220 (
221 const dictionary& dict,
223 );
224
225
226 // Member Functions
227
228 // Access
229
230 //- Return gravitational acceleration constant
231 inline const dimensionedVector& g() const;
232
233 //- Return const access to the number of parcels transferred to the
234 // film model
235 inline label nParcelsTransferred() const;
236
237 //- Return non-const access to the number of parcels transferred to
238 // the film model
239 inline label& nParcelsTransferred();
240
241 //- Return const access to the number of parcels injected from the
242 // film model
243 inline label nParcelsInjected() const;
244
245 //- Return non-const access to the number of parcels injected from
246 // the film model
247 inline label& nParcelsInjected();
248
249 //- Return non-const total mass transferred
250 inline scalar& totalMassTransferred();
251
252 //- Return consr access to mass transferred
253 inline scalar totalMassTransferred() const;
254
255
256 // Member Functions
257
258 //- Transfer parcel from cloud to surface film
259 // Returns true if parcel is to be transferred
260 virtual bool transferParcel
261 (
262 parcelType& p,
263 const polyPatch& pp,
264 bool& keepParticle
265 ) = 0;
266
267 //- Inject parcels into the cloud
268 template<class TrackCloudType>
269 void inject(TrackCloudType& cloud);
270
271
272 // I-O
273
274 //- Write surface film info to stream
275 virtual void info(Ostream& os);
276};
277
278
279// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
280
281} // End namespace Foam
282
283// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
285#define makeSurfaceFilmModel(CloudType) \
286 \
287 typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \
288 defineNamedTemplateTypeNameAndDebug \
289 ( \
290 Foam::SurfaceFilmModel<kinematicCloudType>, \
291 0 \
292 ); \
293 namespace Foam \
294 { \
295 defineTemplateRunTimeSelectionTable \
296 ( \
297 SurfaceFilmModel<kinematicCloudType>, \
298 dictionary \
299 ); \
300 }
301
303#define makeSurfaceFilmModelType(SS, CloudType) \
304 \
305 typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \
306 defineNamedTemplateTypeNameAndDebug(Foam::SS<kinematicCloudType>, 0); \
307 \
308 Foam::SurfaceFilmModel<kinematicCloudType>:: \
309 adddictionaryConstructorToTable<Foam::SS<kinematicCloudType>> \
310 add##SS##CloudType##kinematicCloudType##ConstructorToTable_;
311
312
313// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
314
315#include "SurfaceFilmModelI.H"
316
317// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
318
319#ifdef NoRepository
320 #include "SurfaceFilmModel.C"
321#endif
322
323// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
324
325#endif
326
327// ************************************************************************* //
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
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Templated wall surface film model class.
virtual void setParcelProperties(parcelType &p, const label filmFacei) const
Set the individual parcel properties.
virtual bool transferParcel(parcelType &p, const polyPatch &pp, bool &keepParticle)=0
Transfer parcel from cloud to surface film.
Field< vector > UFilmPatch_
Film velocity / patch face.
virtual void cacheFilmFields(const label filmPatchi, const label primaryPatchi, const regionModels::surfaceFilmModels::surfaceFilmRegionModel &)
Cache the film fields in preparation for injection.
scalar minDiameter_
Minimum diameter particle injection.
scalarField rhoFilmPatch_
Film density / patch face.
scalarField massParcelPatch_
Parcel mass / patch face.
TypeName("surfaceFilmModel")
Runtime type information.
void inject(TrackCloudType &cloud)
Inject parcels into the cloud.
void injectParticles(const label primaryPatchi, const labelList &injectorCellsPatch, TrackCloudType &cloud)
Inject particles in cloud.
declareRunTimeSelectionTable(autoPtr, SurfaceFilmModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
virtual void info(Ostream &os)
Write surface film info to stream.
label nParcelsInjected_
Number of parcels injected from the film model.
static autoPtr< SurfaceFilmModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
regionModels::areaSurfaceFilmModels::liquidFilmBase areaFilm
const dimensionedVector & g_
Gravitational acceleration constant.
Field< scalarField > deltaFilmPatch_
Film height of all film patches / patch face.
virtual ~SurfaceFilmModel()
Destructor.
label ejectedParcelType_
Ejected parcel type label - id assigned to identify parcel for.
scalarField diameterParcelPatch_
Parcel diameter / patch face.
label nParcelsTransferred() const
Return const access to the number of parcels transferred to the.
const dimensionedVector & g() const
Return gravitational acceleration constant.
scalar injectionOffset_
Injection offset position.
label nParcelsTransferred_
Number of parcels transferred to the film model.
virtual autoPtr< SurfaceFilmModel< CloudType > > clone() const =0
Construct and return a clone.
scalar & totalMassTransferred()
Return non-const total mass transferred.
CloudType::parcelType parcelType
Convenience typedef to the cloud's parcel type.
label nParcelsInjected() const
Return const access to the number of parcels injected from the.
scalar totalMassTransferred_
Total mass transferred to the film.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A cloud is a registry collection of lagrangian particles.
Definition: cloud.H:60
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
Base class for thermal 2D shells.
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
OBJstream os(runTime.globalPath()/outputName)
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