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 -------------------------------------------------------------------------------
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 KinematicSurfaceFilm_H
46 #define KinematicSurfaceFilm_H
47 
48 #include "SurfaceFilmModel.H"
49 #include "UPtrList.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 
57 //Forward declaration of classes
58 namespace regionModels
59 {
60  namespace surfaceFilmModels
61  {
63  }
64 }
65 
66 namespace regionModels
67 {
68  namespace areaSurfaceFilmModels
69  {
70  class liquidFilmBase;
71  }
72 }
73 
74 /*---------------------------------------------------------------------------*\
75  Class KinematicSurfaceFilm Declaration
76 \*---------------------------------------------------------------------------*/
77 
78 template<class CloudType>
80 :
81  public SurfaceFilmModel<CloudType>
82 {
83 public:
84 
85  // Public Data
86 
87  //- Options for the interaction types
88  enum interactionType
89  {
93  };
94 
95  //- Names for interactionType
97 
98 
99  // Public Member Functions
100 
101  //- Return interaction type enum from word
102  interactionType interactionTypeEnum(const word& it) const;
103 
104  //- Return word from interaction type enum
105  word interactionTypeStr(const interactionType& it) const;
106 
107 
108 protected:
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
122  Random& rndGen_;
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 
227 public:
228 
229  //- Runtime type information
230  TypeName("kinematicSurfaceFilm");
231 
232 
233  // Constructors
234 
235  //- Construct from components
237  (
238  const dictionary& dict,
239  CloudType& owner,
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>
271  void absorbInteraction
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)
282  void bounceInteraction
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>
318  void splashInteraction
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 // ************************************************************************* //
Foam::KinematicSurfaceFilm::wetSplashInteraction
void wetSplashInteraction(filmType &, const scalar sigma, const scalar mu, parcelType &p, const polyPatch &pp, const label facei, bool &keepParticle)
Parcel interaction with wetted surface.
Definition: KinematicSurfaceFilm.C:330
Foam::KinematicSurfaceFilm::regionFilm
regionModels::surfaceFilmModels::surfaceFilmRegionModel regionFilm
Definition: KinematicSurfaceFilm.H:118
Foam::Random
Random number generator.
Definition: Random.H:59
Foam::regionModels::areaSurfaceFilmModels::liquidFilmBase
Definition: liquidFilmBase.H:60
UPtrList.H
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::KinematicSurfaceFilm::nParcelsSplashed_
label nParcelsSplashed_
Counter for number of new splash parcels.
Definition: KinematicSurfaceFilm.H:178
Foam::constant::physicoChemical::mu
const dimensionedScalar mu
Atomic mass unit.
Definition: createFieldRefs.H:4
Foam::KinematicSurfaceFilm::splashParcelType_
label splashParcelType_
Splash parcel type label - id assigned to identify parcel for.
Definition: KinematicSurfaceFilm.H:156
Foam::KinematicSurfaceFilm::itBounce
Definition: KinematicSurfaceFilm.H:90
Foam::KinematicSurfaceFilm::Adry_
scalar Adry_
Dry surface roughness coefficient.
Definition: KinematicSurfaceFilm.H:167
Foam::KinematicSurfaceFilm::Cf_
scalar Cf_
Skin friction typically in the range 0.6 < Cf < 0.8.
Definition: KinematicSurfaceFilm.H:175
KinematicSurfaceFilm.C
Foam::KinematicSurfaceFilm::interactionTypeStr
word interactionTypeStr(const interactionType &it) const
Return word from interaction type enum.
Definition: KinematicSurfaceFilm.C:71
Foam::KinematicSurfaceFilm::KinematicSurfaceFilm
KinematicSurfaceFilm(const dictionary &dict, CloudType &owner, const word &type=typeName, bool initThermo=true)
Construct from components.
Definition: KinematicSurfaceFilm.C:544
Foam::KinematicSurfaceFilm::splashInteraction
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.
Definition: KinematicSurfaceFilm.C:405
Foam::KinematicSurfaceFilm::setParcelProperties
virtual void setParcelProperties(parcelType &p, const label filmFacei) const
Set the individual parcel properties.
Definition: KinematicSurfaceFilm.C:795
Foam::KinematicSurfaceFilm::~KinematicSurfaceFilm
virtual ~KinematicSurfaceFilm()=default
Destructor.
Foam::KinematicSurfaceFilm::bounceInteraction
void bounceInteraction(parcelType &p, const polyPatch &pp, const label facei, bool &keepParticle) const
Bounce parcel (flip parcel normal velocity)
Definition: KinematicSurfaceFilm.C:243
Foam::KinematicSurfaceFilm::itSplashBai
Definition: KinematicSurfaceFilm.H:91
Foam::KinematicSurfaceFilm::areaFilm
regionModels::areaSurfaceFilmModels::liquidFilmBase areaFilm
Definition: KinematicSurfaceFilm.H:115
Foam::KinematicSurfaceFilm::init
void init(bool binitThermo)
Initialise thermo.
Definition: KinematicSurfaceFilm.C:180
Foam::regionModels::surfaceFilmModels::surfaceFilmRegionModel
Base class for surface film models.
Definition: surfaceFilmRegionModel.H:55
Foam::SurfaceFilmModel
Templated wall surface film model class.
Definition: KinematicCloud.H:92
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::KinematicSurfaceFilm::thermo_
liquidMixtureProperties * thermo_
Region Film liquid thermo.
Definition: KinematicSurfaceFilm.H:127
Foam::KinematicSurfaceFilm::transferParcel
virtual bool transferParcel(parcelType &p, const polyPatch &pp, bool &keepParticle)
Transfer parcel from cloud to surface film.
Definition: KinematicSurfaceFilm.C:618
Foam::UPtrList
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition: UPtrList.H:62
Foam::KinematicSurfaceFilm::itAbsorb
Definition: KinematicSurfaceFilm.H:89
Foam::KinematicSurfaceFilm::tangentVector
vector tangentVector(const vector &v) const
Return a vector tangential to input vector, v.
Definition: KinematicSurfaceFilm.C:89
Foam::KinematicSurfaceFilm::deltaWet_
scalar deltaWet_
Film thickness beyond which patch is assumed to be wet.
Definition: KinematicSurfaceFilm.H:151
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
Foam::KinematicSurfaceFilm::Awet_
scalar Awet_
Wet surface roughness coefficient.
Definition: KinematicSurfaceFilm.H:171
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::KinematicSurfaceFilm::splashDirection
vector splashDirection(const vector &tanVec1, const vector &tanVec2, const vector &nf) const
Return splashed parcel direction.
Definition: KinematicSurfaceFilm.C:109
Foam::KinematicSurfaceFilm::TRef_
scalar TRef_
Region Film reference temperature.
Definition: KinematicSurfaceFilm.H:133
Foam::KinematicSurfaceFilm::parcelType
CloudType::parcelType parcelType
Convenience typedef to the cloud's parcel type.
Definition: KinematicSurfaceFilm.H:112
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::KinematicSurfaceFilm
Kinematic parcel surface film model.
Definition: KinematicSurfaceFilm.H:78
Foam::KinematicSurfaceFilm::filmModel_
regionFilm * filmModel_
Pointer to filmModel.
Definition: KinematicSurfaceFilm.H:136
Foam::KinematicSurfaceFilm::absorbInteraction
void absorbInteraction(filmType &, const parcelType &p, const polyPatch &pp, const label facei, const scalar mass, bool &keepParticle)
Absorb parcel into film.
Definition: KinematicSurfaceFilm.C:194
Foam::KinematicSurfaceFilm::TypeName
TypeName("kinematicSurfaceFilm")
Runtime type information.
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::KinematicSurfaceFilm::rndGen_
Random & rndGen_
Reference to the cloud random number generator.
Definition: KinematicSurfaceFilm.H:121
Foam::KinematicSurfaceFilm::cacheFilmFields
virtual void cacheFilmFields(const label primaryPatchi, const areaFilm &)
Cache the film fields in preparation for injection.
Definition: KinematicSurfaceFilm.C:780
Foam::KinematicSurfaceFilm::clone
virtual autoPtr< SurfaceFilmModel< CloudType > > clone() const
Construct and return a clone using supplied owner cloud.
Definition: KinematicSurfaceFilm.H:251
Foam::KinematicSurfaceFilm::initFilmModels
void initFilmModels()
Initialise pointers of films.
Definition: KinematicSurfaceFilm.C:133
Foam::liquidMixtureProperties
A mixture of liquids.
Definition: liquidMixtureProperties.H:68
Foam::Vector< scalar >
Foam::List< word >
Foam::KinematicSurfaceFilm::parcelsPerSplash_
label parcelsPerSplash_
Number of new parcels resulting from splash event.
Definition: KinematicSurfaceFilm.H:159
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
Foam::KinematicSurfaceFilm::drySplashInteraction
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.
Definition: KinematicSurfaceFilm.C:274
Foam::KinematicSurfaceFilm::areaFilms_
UPtrList< areaFilm > areaFilms_
UPointers to area films.
Definition: KinematicSurfaceFilm.H:142
Foam::KinematicSurfaceFilm::pRef_
scalar pRef_
Region Film reference pressure.
Definition: KinematicSurfaceFilm.H:130
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
SurfaceFilmModel.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
sigma
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
Foam::KinematicSurfaceFilm::interactionTypeNames_
static wordList interactionTypeNames_
Names for interactionType.
Definition: KinematicSurfaceFilm.H:95
Foam::KinematicSurfaceFilm::interactionType
interactionType
Options for the interaction types.
Definition: KinematicSurfaceFilm.H:87
liquidMixtureProperties.H
Foam::KinematicSurfaceFilm::interactionType_
interactionType interactionType_
Interaction type enumeration.
Definition: KinematicSurfaceFilm.H:148
Foam::KinematicSurfaceFilm::interactionTypeEnum
interactionType interactionTypeEnum(const word &it) const
Return interaction type enum from word.
Definition: KinematicSurfaceFilm.C:50
Foam::KinematicSurfaceFilm::info
virtual void info(Ostream &os)
Write surface film info to stream.
Definition: KinematicSurfaceFilm.C:805