Loading...
Searching...
No Matches
KinematicSurfaceFilm.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) 2021-2022 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::KinematicSurfaceFilm
28
29Group
30 grpLagrangianIntermediateSurfaceFilmSubModels
31
32Description
33 Kinematic parcel surface film model.
34
35 Responsible for:
36 - injecting parcels from the film model into the cloud, e.g. for dripping
37 - parcel interaction with the film, e.g absorb, bounce, splash
38
39SourceFiles
40 KinematicSurfaceFilm.C
41 KinematicSurfaceFilmI.H
42
43\*---------------------------------------------------------------------------*/
44
45#ifndef Foam_KinematicSurfaceFilm_H
46#define Foam_KinematicSurfaceFilm_H
47
48#include "SurfaceFilmModel.H"
49#include "UPtrList.H"
51#include "Enum.H"
52
53// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55namespace Foam
57
58// Forward Declarations
59namespace regionModels
61 namespace surfaceFilmModels
62 {
63 class surfaceFilmRegionModel;
64 }
65 namespace areaSurfaceFilmModels
66 {
67 class liquidFilmBase;
68 }
69}
70
71/*---------------------------------------------------------------------------*\
72 Class KinematicSurfaceFilm Declaration
73\*---------------------------------------------------------------------------*/
74
75template<class CloudType>
77:
78 public SurfaceFilmModel<CloudType>
79{
80public:
81
82 // Public Data
83
84 //- Options for the interaction types
85 enum class interactionType
86 {
87 absorb,
88 bounce,
90 };
91
92 //- Names for interactionType
94
95
96protected:
97
98 // Data Types
99
100 //- Convenience typedef to the cloud's parcel type
101 typedef typename CloudType::parcelType parcelType;
103 typedef typename
106 typedef typename
109
110 // Protected Data
111
112 //- Reference to the cloud random number generator
114
115
116 // Region Film thermo
117
118 //- Region Film liquid thermo
120
121 //- Region Film reference pressure
122 scalar pRef_;
123
124 //- Region Film reference temperature
125 scalar TRef_;
126
127 //- Pointer to filmModel
130
131 // Area Films
132
133 //- UPointers to area films
135
136
137 // Interaction model data
138
139 //- Interaction type enumeration
141
142 //- Particle type IDs that can interact with the film
143 // If empty (default) all type IDs are included
145
146 //- Film thickness beyond which patch is assumed to be wet
147 scalar deltaWet_;
148
149 //- Splash parcel type label - id assigned to identify parcel for
150 // post-processing. If not specified, defaults to originating cloud
151 // type
152 label splashParcelType_;
153
154 //- Number of new parcels resulting from splash event
156
157 //- Maximum splash particle diameter for Chi-square distribution
158 // Default is incident particle diameter
159 scalar dMaxSplash_;
160
161 //- Minimum splash particle diameter for Chi-square distribution
162 // Default is 0.1 dMaxSplash
163 scalar dMinSplash_;
164
165 // Surface roughness coefficient typically in the range 1300 - 5200
166 // and decreases with increasing surface roughness
168 //- Dry surface roughness coefficient
169 // = 2630 for dry interaction (ref. Bai)
170 scalar Adry_;
171
172 //- Wet surface roughness coefficient
173 // = 1320 for wet interaction (ref. Bai)
174 scalar Awet_;
176
177 //- Skin friction typically in the range 0.6 < Cf < 0.8
178 scalar Cf_;
179
180 //- Counter for number of new splash parcels
181 label nParcelsSplashed_;
182
183
184 // Protected Member Functions
185
186 //- Return a vector tangential to input vector, v
187 vector tangentVector(const vector& v) const;
188
189 //- Return splashed parcel direction
191 (
192 const vector& tanVec1,
193 const vector& tanVec2,
194 const vector& nf
195 ) const;
196
197 //- Initialise thermo
198 void init(bool binitThermo);
199
200 //- Initialise pointers of films
201 void initFilmModels();
202
203
204 // Injection from sheet (ejection) helper functions
205
206 //- Cache the film fields in preparation for injection
207 virtual void cacheFilmFields(const areaFilm& film);
208
209 //- Cache the film fields in preparation for injection
210 virtual void cacheFilmFields
212 const label filmPatchi,
213 const label primaryPatchi,
215 );
216
217 //- Set the individual parcel properties
218 virtual void setParcelProperties
219 (
220 parcelType& p,
221 const label filmFacei
222 ) const;
223
224
225public:
226
227 //- Runtime type information
228 TypeName("kinematicSurfaceFilm");
229
230
231 // Constructors
232
233 //- Construct from components
235 (
236 const dictionary& dict,
238 const word& type = typeName,
239 bool initThermo = true
240 );
241
242 //- Construct copy
244 (
246 bool initThermo = true
247 );
248
249 //- Construct and return a clone using supplied owner cloud
251 {
253 (
255 );
256 }
257
258
259 //- Destructor
260 virtual ~KinematicSurfaceFilm() = default;
261
262
263 // Member Functions
264
265 // Interaction models
266
267 //- Absorb parcel into film
268 template<class filmType>
270 (
271 filmType&,
272 const parcelType& p,
273 const polyPatch& pp,
274 const label facei,
275 const scalar mass,
276 bool& keepParticle
277 );
278
279 //- Bounce parcel (flip parcel normal velocity)
281 (
282 parcelType& p,
283 const polyPatch& pp,
284 const label facei,
285 bool& keepParticle
286 ) const;
287
288 //- Parcel interaction with dry surface
289 template<class filmType>
291 (
292 filmType&,
293 const scalar sigma,
294 const scalar mu,
295 const parcelType& p,
296 const polyPatch& pp,
297 const label facei,
298 bool& keepParticle
299 );
300
301 //- Parcel interaction with wetted surface
302 template<class filmType>
304 (
305 filmType&,
306 const scalar sigma,
307 const scalar mu,
308 parcelType& p,
309 const polyPatch& pp,
310 const label facei,
311 bool& keepParticle
312 );
314 //- Bai parcel splash interaction model
315 template<class filmType>
317 (
318 filmType&,
319 const parcelType& p,
320 const polyPatch& pp,
321 const label facei,
322 const scalar mRatio,
323 const scalar We,
324 const scalar Wec,
325 const scalar sigma,
326 bool& keepParticle
327 );
328
329
330 // Evaluation
331
332 //- Transfer parcel from cloud to surface film
333 // Returns true if parcel is to be transferred
334 virtual bool transferParcel
335 (
336 parcelType& p,
337 const polyPatch& pp,
338 bool& keepParticle
339 );
340
341
342 // I-O
343
344 //- Write surface film info
345 virtual void info();
346};
347
348
349// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
350
351} // End namespace Foam
352
353// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
354
355#ifdef NoRepository
356 #include "KinematicSurfaceFilm.C"
357#endif
358
359// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
360
361#endif
362
363// ************************************************************************* //
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const CloudType & owner() const
Return const access to the owner cloud.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition Enum.H:57
virtual void cacheFilmFields(const areaFilm &film)
Cache the film fields in preparation for injection.
void wetSplashInteraction(filmType &, const scalar sigma, const scalar mu, parcelType &p, const polyPatch &pp, const label facei, bool &keepParticle)
Parcel interaction with wetted surface.
virtual void setParcelProperties(parcelType &p, const label filmFacei) const
Set the individual parcel properties.
void drySplashInteraction(filmType &, const scalar sigma, const scalar mu, const parcelType &p, const polyPatch &pp, const label facei, bool &keepParticle)
Parcel interaction with dry surface.
label splashParcelType_
Splash parcel type label - id assigned to identify parcel for.
void splashInteraction(filmType &, const parcelType &p, const polyPatch &pp, const label facei, const scalar mRatio, const scalar We, const scalar Wec, const scalar sigma, bool &keepParticle)
Bai parcel splash interaction model.
KinematicSurfaceFilm(const dictionary &dict, CloudType &owner, const word &type=typeName, bool initThermo=true)
Construct from components.
scalar Cf_
Skin friction typically in the range 0.6 < Cf < 0.8.
liquidMixtureProperties * thermo_
Region Film liquid thermo.
Random & rndGen_
Reference to the cloud random number generator.
scalar dMaxSplash_
Maximum splash particle diameter for Chi-square distribution.
scalar Awet_
Wet surface roughness coefficient.
void absorbInteraction(filmType &, const parcelType &p, const polyPatch &pp, const label facei, const scalar mass, bool &keepParticle)
Absorb parcel into film.
regionModels::areaSurfaceFilmModels::liquidFilmBase areaFilm
vector splashDirection(const vector &tanVec1, const vector &tanVec2, const vector &nf) const
Return splashed parcel direction.
void bounceInteraction(parcelType &p, const polyPatch &pp, const label facei, bool &keepParticle) const
Bounce parcel (flip parcel normal velocity).
regionModels::surfaceFilmModels::surfaceFilmRegionModel regionFilm
labelList parcelTypes_
Particle type IDs that can interact with the film.
static const Enum< interactionType > interactionTypeNames
Names for interactionType.
interactionType
Options for the interaction types.
TypeName("kinematicSurfaceFilm")
Runtime type information.
scalar Adry_
Dry surface roughness coefficient.
vector tangentVector(const vector &v) const
Return a vector tangential to input vector, v.
scalar deltaWet_
Film thickness beyond which patch is assumed to be wet.
interactionType interactionType_
Interaction type enumeration.
void init(bool binitThermo)
Initialise thermo.
virtual void info()
Write surface film info.
scalar dMinSplash_
Minimum splash particle diameter for Chi-square distribution.
UPtrList< areaFilm > areaFilms_
UPointers to area films.
regionFilm * filmModel_
Pointer to filmModel.
void initFilmModels()
Initialise pointers of films.
label parcelsPerSplash_
Number of new parcels resulting from splash event.
CloudType::parcelType parcelType
Convenience typedef to the cloud's parcel type.
scalar pRef_
Region Film reference pressure.
scalar TRef_
Region Film reference temperature.
virtual autoPtr< SurfaceFilmModel< CloudType > > clone() const
Construct and return a clone using supplied owner cloud.
virtual bool transferParcel(parcelType &p, const polyPatch &pp, bool &keepParticle)
Transfer parcel from cloud to surface film.
label nParcelsSplashed_
Counter for number of new splash parcels.
virtual ~KinematicSurfaceFilm()=default
Destructor.
Random number generator.
Definition Random.H:56
SurfaceFilmModel(CloudType &owner)
Construct null from owner.
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 list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
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
List< label > labelList
A List of labels.
Definition List.H:62
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Vector< scalar > vector
Definition vector.H:57
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68