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 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 parcelss 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 KinematicSurfaceFilm_H
46#define KinematicSurfaceFilm_H
47
48#include "SurfaceFilmModel.H"
49#include "UPtrList.H"
51
52// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53
54namespace Foam
55{
56
57//Forward declaration of classes
58namespace regionModels
60 namespace surfaceFilmModels
61 {
63 }
64}
65
66namespace regionModels
68 namespace areaSurfaceFilmModels
69 {
70 class liquidFilmBase;
71 }
72}
73
74/*---------------------------------------------------------------------------*\
75 Class KinematicSurfaceFilm Declaration
76\*---------------------------------------------------------------------------*/
77
78template<class CloudType>
80:
81 public SurfaceFilmModel<CloudType>
82{
83public:
84
85 // Public Data
86
87 //- Options for the interaction types
89 {
93 };
94
95 //- Names for interactionType
97
98
99 // Public Member Functions
100
101 //- Return interaction type enum from word
103
104 //- Return word from interaction type enum
105 word interactionTypeStr(const interactionType& it) const;
106
107
108protected:
109
110 // Protected Data
111
112 //- Convenience typedef to the cloud's parcel type
113 typedef typename CloudType::parcelType parcelType;
114
115 typedef typename
117
118 typedef typename
120
121 //- Reference to the cloud random number generator
123
124
125 // Region Film thermo
126
127 //- Region Film liquid thermo
129
130 //- Region Film reference pressure
131 scalar pRef_;
132
133 //- Region Film reference temperature
134 scalar TRef_;
135
136 //- Pointer to filmModel
138
139
140 // Area Films
141
142 //- UPointers to area films
144
145
146 // Interaction model data
147
148 //- Interaction type enumeration
150
151 //- Film thickness beyond which patch is assumed to be wet
152 scalar deltaWet_;
153
154 //- Splash parcel type label - id assigned to identify parcel for
155 // post-processing. If not specified, defaults to originating cloud
156 // type
157 label splashParcelType_;
158
159 //- Number of new parcels resulting from splash event
160 label parcelsPerSplash_;
161
162
163 // Surface roughness coefficient typically in the range 1300 - 5200
164 // and decreases with increasing surface roughness
165
166 //- Dry surface roughness coefficient
167 // = 2630 for dry interaction (ref. Bai)
168 scalar Adry_;
169
170 //- Wet surface roughness coefficient
171 // = 1320 for wet interaction (ref. Bai)
172 scalar Awet_;
173
174
175 //- Skin friction typically in the range 0.6 < Cf < 0.8
176 scalar Cf_;
177
178 //- Counter for number of new splash parcels
179 label nParcelsSplashed_;
180
181
182 // Protected Member Functions
183
184 //- Return a vector tangential to input vector, v
185 vector tangentVector(const vector& v) const;
186
187 //- Return splashed parcel direction
189 (
190 const vector& tanVec1,
191 const vector& tanVec2,
192 const vector& nf
193 ) const;
194
195 //- Initialise thermo
196 void init(bool binitThermo);
197
198 //- Initialise pointers of films
199 void initFilmModels();
200
201
202 // Injection from sheet (ejection) helper functions
203
204 //- Cache the film fields in preparation for injection
205 virtual void cacheFilmFields
206 (
207 const label primaryPatchi,
208 const areaFilm&
209 );
210
211 //- Cache the film fields in preparation for injection
212 virtual void cacheFilmFields
213 (
214 const label filmPatchi,
215 const label primaryPatchi,
217 );
218
219 //- Set the individual parcel properties
220 virtual void setParcelProperties
221 (
222 parcelType& p,
223 const label filmFacei
224 ) const;
225
226
227public:
228
229 //- Runtime type information
230 TypeName("kinematicSurfaceFilm");
231
232
233 // Constructors
234
235 //- Construct from components
237 (
238 const dictionary& dict,
240 const word& type = typeName,
241 bool initThermo = true
242 );
243
244 //- Construct copy
246 (
248 bool initThermo = true
249 );
250
251 //- Construct and return a clone using supplied owner cloud
253 {
255 (
257 );
258 }
259
260
261 //- Destructor
262 virtual ~KinematicSurfaceFilm() = default;
263
264
265 // Member Functions
266
267 // Interaction models
268
269 //- Absorb parcel into film
270 template<class filmType>
272 (
273 filmType&,
274 const parcelType& p,
275 const polyPatch& pp,
276 const label facei,
277 const scalar mass,
278 bool& keepParticle
279 );
280
281 //- Bounce parcel (flip parcel normal velocity)
283 (
284 parcelType& p,
285 const polyPatch& pp,
286 const label facei,
287 bool& keepParticle
288 ) const;
289
290 //- Parcel interaction with dry surface
291 template<class filmType>
293 (
294 filmType&,
295 const scalar sigma,
296 const scalar mu,
297 const parcelType& p,
298 const polyPatch& pp,
299 const label facei,
300 bool& keepParticle
301 );
302
303 //- Parcel interaction with wetted surface
304 template<class filmType>
306 (
307 filmType&,
308 const scalar sigma,
309 const scalar mu,
310 parcelType& p,
311 const polyPatch& pp,
312 const label facei,
313 bool& keepParticle
314 );
315
316 //- Bai parcel splash interaction model
317 template<class filmType>
319 (
320 filmType&,
321 const parcelType& p,
322 const polyPatch& pp,
323 const label facei,
324 const scalar mRatio,
325 const scalar We,
326 const scalar Wec,
327 const scalar sigma,
328 bool& keepParticle
329 );
330
331
332 // Evaluation
333
334 //- Transfer parcel from cloud to surface film
335 // Returns true if parcel is to be transferred
336 virtual bool transferParcel
337 (
338 parcelType& p,
339 const polyPatch& pp,
340 bool& keepParticle
341 );
342
343
344 // I-O
345
346 //- Write surface film info to stream
347 virtual void info(Ostream& os);
348};
349
350
351// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
352
353} // End namespace Foam
354
355// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
356
357#ifdef NoRepository
358 #include "KinematicSurfaceFilm.C"
359#endif
360
361// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
362
363#endif
364
365// ************************************************************************* //
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
Kinematic parcel surface film model.
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.
static wordList interactionTypeNames_
Names for interactionType.
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.
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 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.
virtual void info(Ostream &os)
Write surface film info to stream.
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
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 cacheFilmFields(const label primaryPatchi, const areaFilm &)
Cache the film fields in preparation for injection.
UPtrList< areaFilm > areaFilms_
UPointers to area films.
regionFilm * filmModel_
Pointer to filmModel.
interactionType interactionTypeEnum(const word &it) const
Return interaction type enum from word.
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.
word interactionTypeStr(const interactionType &it) const
Return word from interaction type enum.
label nParcelsSplashed_
Counter for number of new splash parcels.
virtual ~KinematicSurfaceFilm()=default
Destructor.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Random number generator.
Definition: Random.H:60
Templated wall surface film model class.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition: UPtrList.H:71
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
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
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
const volScalarField & mu
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
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73