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