Loading...
Searching...
No Matches
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-2025 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 Foam_SurfaceFilmModel_H
43#define Foam_SurfaceFilmModel_H
44
45#include "IOdictionary.H"
46#include "autoPtr.H"
47#include "UPtrList.H"
48#include "faMesh.H"
49#include "polyMesh.H"
51#include "CloudSubModelBase.H"
52
53
54// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55
56namespace Foam
57{
58
59// Forward Declarations
60namespace regionModels
61{
62 namespace surfaceFilmModels
63 {
65 }
66 namespace areaSurfaceFilmModels
67 {
68 class liquidFilmBase;
69 }
70}
71
72
73/*---------------------------------------------------------------------------*\
74 Class SurfaceFilmModel Declaration
75\*---------------------------------------------------------------------------*/
76
77template<class CloudType>
79:
80 public CloudSubModelBase<CloudType>
81{
82protected:
83
84 // Data Types
85
86 //- Convenience typedef to the cloud's parcel type
87 typedef typename CloudType::parcelType parcelType;
89 typedef typename
93 typedef typename
96
97
98 // Protected Data
99
100 //- Gravitational acceleration constant
101 const dimensionedVector& g_;
102
103 //- Ejected parcel type label - id assigned to identify parcel for
104 //- post-processing. If not specified, defaults to originating cloud
105 //- type
106 label ejectedParcelType_;
108 //- Injection offset position
109 scalar injectionOffset_;
110
111 //- Minimum diameter particle injection
113
114
115 // Injector fields transferred from film patch
116
117 //- Parcel mass / patch face
119
120 //- Parcel diameter / patch face
122
123 //- Film velocity / patch face
126 //- Film density / patch face
128
129 //- Film height of all film patches / patch face
131
132
133 // Counters
134
135 //- Number of parcels transferred to the film model
137
138 //- Number of parcels injected from the film model
139 label nParcelsInjected_;
141
142 // Total mass info
143
144 //- Total mass transferred to the film
146
147
148 // Protected Functions
149
150 //- Cache the film fields in preparation for injection
151 virtual void cacheFilmFields
152 (
153 const label filmPatchi,
154 const label primaryPatchi,
155 const regionFilm&
156 );
157
158 //- Cache the finite area film fields in preparation for injection
159 virtual void cacheFilmFields(const areaFilm& film);
160
161 //- Inject particles in cloud
162 template<class TrackCloudType>
163 void injectParticles
164 (
165 const label primaryPatchi,
166 const labelUList& injectorCells, // patch-based
167 TrackCloudType& cloud
168 );
169
170 //- Inject particles in cloud
171 template<class TrackCloudType>
172 void injectParticles
173 (
174 const UList<labelPair>& patchFaces,
175 TrackCloudType& cloud
176 );
177
178 //- Set the individual parcel properties
179 virtual void setParcelProperties
180 (
181 parcelType& p,
182 const label filmFacei
183 ) const;
184
185
186public:
187
188 //- Runtime type information
189 TypeName("surfaceFilmModel");
191 //- Declare runtime constructor selection table
193 (
194 autoPtr,
197 (
198 const dictionary& dict,
200 ),
202 );
203
204
205 // Constructors
206
207 //- Construct null from owner
209
210 //- Construct from components
212 (
213 const dictionary& dict,
215 const word& type
216 );
217
218 //- Construct copy
220
221 //- Construct and return a clone
223
224
225 //- Destructor
226 virtual ~SurfaceFilmModel() = default;
228
229 //- Selector
231 (
232 const dictionary& dict,
234 );
235
236
237 // Member Functions
238
239 // Access
240
241 //- Return gravitational acceleration constant
242 inline const dimensionedVector& g() const noexcept;
243
244 //- The number of parcels transferred to the film model
245 inline label nParcelsTransferred() const noexcept;
246
247 //- Non-const access to number of parcels transferred to the film model
248 inline label& nParcelsTransferred() noexcept;
249
250 //- The number of parcels injected from the film model
251 inline label nParcelsInjected() const noexcept;
252
253 //- Non-const access to number of parcels injected from the film model
254 inline label& nParcelsInjected() noexcept;
255
256 //- The total mass transferred
257 inline scalar totalMassTransferred() const noexcept;
258
259 //- Non-const access to the total mass transferred
260 inline scalar& totalMassTransferred() noexcept;
261
262
263 //- Registry
264
265 //- Return a sorted list of area-film objects that are
266 //- registered on the faMeshesRegistry
267 static UPtrList<const areaFilm> csorted_areaFilms(const polyMesh&);
268
269 //- Return a sorted list of area-film objects that are
270 //- registered on the faMeshesRegistry
272
273
274 // Member Functions
275
276 //- Transfer parcel from cloud to surface film
277 // Returns true if parcel is to be transferred
278 virtual bool transferParcel
279 (
280 parcelType& p,
281 const polyPatch& pp,
282 bool& keepParticle
283 ) = 0;
284
285 //- Inject parcels into the cloud
286 template<class TrackCloudType>
287 void inject(TrackCloudType& cloud);
288
289
290 // I-O
291
292 //- Write surface film info
293 virtual void info();
294};
295
296
297// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
298
299} // End namespace Foam
300
301// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
302
303#define makeSurfaceFilmModel(CloudType) \
304 \
305 typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \
306 defineNamedTemplateTypeNameAndDebug \
307 ( \
308 Foam::SurfaceFilmModel<kinematicCloudType>, \
309 0 \
310 ); \
311 namespace Foam \
312 { \
313 defineTemplateRunTimeSelectionTable \
314 ( \
315 SurfaceFilmModel<kinematicCloudType>, \
316 dictionary \
317 ); \
318 }
319
320
321#define makeSurfaceFilmModelType(SS, CloudType) \
322 \
323 typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \
324 defineNamedTemplateTypeNameAndDebug(Foam::SS<kinematicCloudType>, 0); \
325 \
326 Foam::SurfaceFilmModel<kinematicCloudType>:: \
327 adddictionaryConstructorToTable<Foam::SS<kinematicCloudType>> \
328 add##SS##CloudType##kinematicCloudType##ConstructorToTable_;
329
330
331// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
332
333#include "SurfaceFilmModelI.H"
334
335// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
336
337#ifdef NoRepository
338 #include "SurfaceFilmModel.C"
339#endif
340
341// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
342
343#endif
344
345// ************************************************************************* //
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const CloudType & owner() const
Return const access to the owner cloud.
CloudSubModelBase(CloudType &owner)
Construct null from owner cloud.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition Field.H:172
void injectParticles(const UList< labelPair > &patchFaces, TrackCloudType &cloud)
Inject particles in cloud.
static UPtrList< const areaFilm > csorted_areaFilms(const polyMesh &)
Registry.
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.
scalar minDiameter_
Minimum diameter particle injection.
label nParcelsTransferred() const noexcept
The number of parcels transferred to the film model.
scalarField rhoFilmPatch_
Film density / patch face.
scalarField massParcelPatch_
Parcel mass / patch face.
TypeName("surfaceFilmModel")
Runtime type information.
virtual ~SurfaceFilmModel()=default
Destructor.
void inject(TrackCloudType &cloud)
Inject parcels into the cloud.
declareRunTimeSelectionTable(autoPtr, SurfaceFilmModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
label nParcelsInjected_
Number of parcels injected from the film model.
scalar totalMassTransferred() const noexcept
The total mass transferred.
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.
regionModels::surfaceFilmModels::surfaceFilmRegionModel regionFilm
virtual void cacheFilmFields(const label filmPatchi, const label primaryPatchi, const regionFilm &)
Cache the film fields in preparation for injection.
label ejectedParcelType_
Ejected parcel type label - id assigned to identify parcel for post-processing. If not specified,...
scalarField diameterParcelPatch_
Parcel diameter / patch face.
label nParcelsInjected() const noexcept
The number of parcels injected from the film model.
static UPtrList< areaFilm > sorted_areaFilms(const polyMesh &)
Return a sorted list of area-film objects that are registered on the faMeshesRegistry.
virtual void info()
Write surface film info.
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.
const dimensionedVector & g() const noexcept
Return gravitational acceleration constant.
SurfaceFilmModel(CloudType &owner)
Construct null from owner.
CloudType::parcelType parcelType
Convenience typedef to the cloud's parcel type.
void injectParticles(const label primaryPatchi, const labelUList &injectorCells, TrackCloudType &cloud)
Inject particles in cloud.
scalar totalMassTransferred_
Total mass transferred to the film.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition UList.H:89
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition UPtrList.H:101
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A cloud is a registry collection of lagrangian particles.
Definition cloud.H:56
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
A patch is a list of labels that address the faces in the global face list.
Definition polyPatch.H:73
const dictionary & dict() const
Return const access to the cloud dictionary.
A class for handling words, derived from Foam::string.
Definition word.H:66
volScalarField & p
Namespace for OpenFOAM.
DSMCCloud< dsmcParcel > CloudType
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const direction noexcept
Definition scalarImpl.H:265
UList< label > labelUList
A UList of labels.
Definition UList.H:75
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
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:68