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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::KinematicSurfaceFilm
28 
29 Group
30  grpLagrangianIntermediateSurfaceFilmSubModels
31 
32 Description
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 
39 SourceFiles
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 // Forward Declarations
59 namespace regionModels
60 {
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 
75 template<class CloudType>
77 :
78  public SurfaceFilmModel<CloudType>
79 {
80 public:
81 
82  // Public Data
83 
84  //- Options for the interaction types
85  enum class interactionType
86  {
87  absorb,
88  bounce,
89  splashBai
90  };
91 
92  //- Names for interactionType
94 
95 
96 protected:
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
113  Random& rndGen_;
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
211  (
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 
225 public:
226 
227  //- Runtime type information
228  TypeName("kinematicSurfaceFilm");
229 
230 
231  // Constructors
232 
233  //- Construct from components
235  (
236  const dictionary& dict,
237  CloudType& owner,
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>
269  void absorbInteraction
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)
280  void bounceInteraction
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>
316  void splashInteraction
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 // ************************************************************************* //
interactionType interactionType_
Interaction type enumeration.
interactionType
Options for the interaction types.
KinematicSurfaceFilm(const dictionary &dict, CloudType &owner, const word &type=typeName, bool initThermo=true)
Construct from components.
void wetSplashInteraction(filmType &, const scalar sigma, const scalar mu, parcelType &p, const polyPatch &pp, const label facei, bool &keepParticle)
Parcel interaction with wetted surface.
regionModels::surfaceFilmModels::surfaceFilmRegionModel regionFilm
scalar Adry_
Dry surface roughness coefficient.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
scalar Cf_
Skin friction typically in the range 0.6 < Cf < 0.8.
label nParcelsSplashed_
Counter for number of new splash parcels.
void bounceInteraction(parcelType &p, const polyPatch &pp, const label facei, bool &keepParticle) const
Bounce parcel (flip parcel normal velocity)
regionModels::areaSurfaceFilmModels::liquidFilmBase areaFilm
static const Enum< interactionType > 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.
virtual void setParcelProperties(parcelType &p, const label filmFacei) const
Set the individual parcel properties.
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:104
scalar deltaWet_
Film thickness beyond which patch is assumed to be wet.
const CloudType & owner() const
Return const access to the owner cloud.
void init(bool binitThermo)
Initialise thermo.
CloudType::parcelType parcelType
Convenience typedef to the cloud&#39;s parcel type.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: POSIX.C:799
scalar TRef_
Region Film reference temperature.
virtual ~KinematicSurfaceFilm()=default
Destructor.
regionFilm * filmModel_
Pointer to filmModel.
A class for handling words, derived from Foam::string.
Definition: word.H:63
vector splashDirection(const vector &tanVec1, const vector &tanVec2, const vector &nf) const
Return splashed parcel direction.
virtual void cacheFilmFields(const areaFilm &film)
Cache the film fields in preparation for injection.
void absorbInteraction(filmType &, const parcelType &p, const polyPatch &pp, const label facei, const scalar mass, bool &keepParticle)
Absorb parcel into film.
liquidMixtureProperties * thermo_
Region Film liquid thermo.
virtual autoPtr< SurfaceFilmModel< CloudType > > clone() const
Construct and return a clone using supplied owner cloud.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition: HashTable.H:106
Random number generator.
Definition: Random.H:55
labelList parcelTypes_
Particle type IDs that can interact with the film.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:290
vector tangentVector(const vector &v) const
Return a vector tangential to input vector, v.
Kinematic parcel surface film model.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
TypeName("kinematicSurfaceFilm")
Runtime type information.
virtual bool transferParcel(parcelType &p, const polyPatch &pp, bool &keepParticle)
Transfer parcel from cloud to surface film.
void initFilmModels()
Initialise pointers of films.
scalar dMinSplash_
Minimum splash particle diameter for Chi-square distribution.
Templated wall surface film model class.
scalar Awet_
Wet surface roughness coefficient.
const dimensionedScalar mu
Atomic mass unit.
UPtrList< areaFilm > areaFilms_
UPointers to area films.
Random & rndGen_
Reference to the cloud random number generator.
scalar dMaxSplash_
Maximum splash particle diameter for Chi-square distribution.
scalar pRef_
Region Film reference pressure.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
label parcelsPerSplash_
Number of new parcels resulting from splash event.
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.
volScalarField & p
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:69
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:67
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
Namespace for OpenFOAM.
label splashParcelType_
Splash parcel type label - id assigned to identify parcel for.
virtual void info()
Write surface film info.