CloudFilmTransfer.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::CloudFilmTransfer
26 
27 Description
28  Thermo parcel<->film transfer model.
29 
30  Responsible for:
31  - injecting parcels from the film model into the cloud, e.g. for dripping
32  - parcel interaction with the film, e.g absorb, bounce, splash
33 
34  References:
35  \verbatim
36  Bai, C., & Gosman, A. D. (1996).
37  Mathematical modelling of wall films formed by impinging sprays.
38  SAE transactions, 782-796.
39 
40  Bai, C. X., Rusche, H., & Gosman, A. D. (2002).
41  Modeling of gasoline spray impingement.
42  Atomization and Sprays, 12(1-3).
43  \endverbatim
44 
45 SourceFiles
46  CloudFilmTransfer.C
47 
48 \*---------------------------------------------------------------------------*/
49 
50 #ifndef CloudFilmTransfer_H
51 #define CloudFilmTransfer_H
52 
53 #include "SurfaceFilmModel.H"
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace Foam
58 {
59 
60 // Forward declaration of classes
61 class Random;
62 
63 namespace fv
64 {
65  class filmCloudTransfer;
66 }
67 
68 
69 /*---------------------------------------------------------------------------*\
70  Class CloudFilmTransferBase Declaration
71 \*---------------------------------------------------------------------------*/
72 
74 {
75 public:
76 
77  //- Interaction types
78  enum class interactionType
79  {
80  absorb,
81  bounce,
82  splashBai
83  };
84 
85  //- Interaction type names
87 };
88 
89 
90 /*---------------------------------------------------------------------------*\
91  Class CloudFilmTransfer Declaration
92 \*---------------------------------------------------------------------------*/
93 
94 template<class CloudType>
96 :
97  public SurfaceFilmModel<CloudType>,
99 {
100  // Private Member Functions
101 
102  //- Return pointers to the film transfer fvModels
103  UPtrList<fv::filmCloudTransfer>& filmTransferPtrs() const;
104 
105 
106 protected:
107 
108  // Protected Data
109 
110  //- Convenience typedef to the cloud's parcel type
111  typedef typename CloudType::parcelType parcelType;
112 
113  //- Reference to the cloud random number generator
114  Random& rndGen_;
115 
116 
117  // Film models
118 
119  //- Pointers to the films
121 
122  //- List of film patches
123  mutable labelList filmPatches_;
124 
125 
126  // Cached injector fields per film patch
127 
128  //- Film velocity / patch face
130 
131  //- Film density / patch face
133 
134  //- Film temperature / patch face
136 
137  //- Film specific heat capacity / patch face
139 
140 
141  // Interaction model data
142 
143  //- Interaction type enumeration
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
153 
154  //- Number of new parcels resulting from splash event
156 
157 
158  // Surface roughness coefficient typically in the range 1300 - 5200
159  // and decreases with increasing surface roughness
160 
161  //- Dry surface roughness coefficient
162  // = 2630 for dry interaction (ref. Bai)
163  scalar Adry_;
164 
165  //- Wet surface roughness coefficient
166  // = 1320 for wet interaction (ref. Bai)
167  scalar Awet_;
168 
169 
170  //- Skin friction typically in the range 0.6 < Cf < 0.8
171  scalar Cf_;
172 
173  //- Counter for number of new splash parcels
175 
176 
177  // Protected Member Functions
178 
179  //- Return splashed parcel direction
181  (
182  const vector& tanVec1,
183  const vector& tanVec2,
184  const vector& nf
185  ) const;
186 
187 
188  // Interaction models
189 
190  //- Absorb parcel into film
191  void absorbInteraction
192  (
194  const parcelType& p,
195  const polyPatch& pp,
196  const label facei,
197  const scalar mass,
198  bool& keepParticle
199  );
200 
201  //- Bounce parcel (flip parcel normal velocity)
202  void bounceInteraction
203  (
204  parcelType& p,
205  const polyPatch& pp,
206  const label facei,
207  bool& keepParticle
208  ) const;
209 
210  //- Parcel interaction with dry surface
212  (
214  const parcelType& p,
215  const polyPatch& pp,
216  const label facei,
217  bool& keepParticle
218  );
219 
220  //- Parcel interaction with wetted surface
222  (
224  parcelType& p,
225  const polyPatch& pp,
226  const label facei,
227  bool& keepParticle
228  );
229 
230  //- Bai parcel splash interaction model
231  void splashInteraction
232  (
234  const parcelType& p,
235  const polyPatch& pp,
236  const label facei,
237  const scalar mRatio,
238  const scalar We,
239  const scalar Wec,
240  const scalar sigma,
241  bool& keepParticle
242  );
243 
244  //- Return pointers to the films
245  virtual const labelList& filmPatches() const;
246 
247  //- Cache the film fields in preparation for injection
248  virtual void cacheFilmFields(const label filmi);
249 
250  //- Set the individual parcel properties
251  virtual void setParcelProperties
252  (
253  parcelType& p,
254  const label filmFacei
255  ) const;
256 
257 
258 public:
259 
260  //- Runtime type information
261  TypeName("cloudFilmTransfer");
262 
263 
264  // Constructors
265 
266  //- Construct from components
268 
269  //- Construct copy
271 
272  //- Construct and return a clone using supplied owner cloud
274  {
276  (
278  );
279  }
280 
281 
282  //- Destructor
283  virtual ~CloudFilmTransfer();
284 
285 
286  // Member Functions
287 
288  // Evaluation
289 
290  //- Transfer parcel from cloud to film
291  // Returns true if parcel is to be transferred
292  virtual bool transferParcel
293  (
294  parcelType& p,
295  const polyPatch& pp,
296  bool& keepParticle
297  );
298 
299 
300  // I-O
301 
302  //- Write film info to stream
303  virtual void info(Ostream& os);
304 };
305 
306 
307 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
308 
309 } // End namespace Foam
310 
311 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
312 
313 #ifdef NoRepository
314  #include "CloudFilmTransfer.C"
315 #endif
316 
317 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
318 
319 #endif
320 
321 // ************************************************************************* //
interactionType
Interaction types.
static const NamedEnum< interactionType, 3 > interactionTypeNames_
Interaction type names.
Thermo parcel<->film transfer model.
virtual void setParcelProperties(parcelType &p, const label filmFacei) const
Set the individual parcel properties.
label splashParcelType_
Splash parcel type label - id assigned to identify parcel for.
TypeName("cloudFilmTransfer")
Runtime type information.
scalarField rhoFilmPatch_
Film density / patch face.
virtual void cacheFilmFields(const label filmi)
Cache the film fields in preparation for injection.
virtual const labelList & filmPatches() const
Return pointers to the films.
scalar Cf_
Skin friction typically in the range 0.6 < Cf < 0.8.
void drySplashInteraction(fv::filmCloudTransfer &, const parcelType &p, const polyPatch &pp, const label facei, bool &keepParticle)
Parcel interaction with dry surface.
Random & rndGen_
Reference to the cloud random number generator.
virtual autoPtr< SurfaceFilmModel< CloudType > > clone() const
Construct and return a clone using supplied owner cloud.
scalar Awet_
Wet surface roughness coefficient.
virtual void info(Ostream &os)
Write film info to stream.
scalarField CpFilmPatch_
Film specific heat capacity / patch face.
void splashInteraction(fv::filmCloudTransfer &, 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.
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)
void absorbInteraction(fv::filmCloudTransfer &, const parcelType &p, const polyPatch &pp, const label facei, const scalar mass, bool &keepParticle)
Absorb parcel into film.
scalar Adry_
Dry surface roughness coefficient.
scalar deltaWet_
Film thickness beyond which patch is assumed to be wet.
interactionType interactionType_
Interaction type enumeration.
virtual ~CloudFilmTransfer()
Destructor.
vectorField UFilmPatch_
Film velocity / patch face.
CloudFilmTransfer(const dictionary &dict, CloudType &owner)
Construct from components.
scalarField TFilmPatch_
Film temperature / patch face.
void wetSplashInteraction(fv::filmCloudTransfer &, parcelType &p, const polyPatch &pp, const label facei, bool &keepParticle)
Parcel interaction with wetted surface.
labelList filmPatches_
List of film patches.
label parcelsPerSplash_
Number of new parcels resulting from splash event.
CloudType::parcelType parcelType
Convenience typedef to the cloud's parcel type.
virtual bool transferParcel(parcelType &p, const polyPatch &pp, bool &keepParticle)
Transfer parcel from cloud to film.
label nParcelsSplashed_
Counter for number of new splash parcels.
UPtrList< fv::filmCloudTransfer > filmTransfers_
Pointers to the films.
const CloudType & owner() const
Return const access to the owner cloud.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:79
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:221
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
Random number generator.
Definition: Random.H:58
Templated wall surface film model class.
CloudType::parcelType parcelType
Convenience typedef to the cloud's parcel type.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: UPtrList.H:66
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Film<->cloud transfer model.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:70
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m^2/K^4].
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
labelList fv(nPoints)
volScalarField & p