ThermoSurfaceFilm.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-2021 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::ThermoSurfaceFilm
26 
27 Description
28  Thermo parcel surface film 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  Splash model references:
35 
36  Bai and Gosman, `Mathematical modelling of wall films formed by
37  impinging sprays', SAE 960626, 1996
38 
39  Bai et al, `Modelling of gasoline spray impingement', Atom. Sprays,
40  vol 12, pp 1-27, 2002
41 
42 
43 SourceFiles
44  ThermoSurfaceFilm.C
45  ThermoSurfaceFilmI.H
46 
47 \*---------------------------------------------------------------------------*/
48 
49 #ifndef ThermoSurfaceFilm_H
50 #define ThermoSurfaceFilm_H
51 
52 #include "SurfaceFilmModel.H"
53 
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 
56 namespace Foam
57 {
58 
59 /*---------------------------------------------------------------------------*\
60  Class ThermoSurfaceFilm Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 template<class CloudType>
65 :
66  public SurfaceFilmModel<CloudType>
67 {
68 public:
69 
70  // Public data
71 
72  // Interaction type enumerations
73  enum interactionType
74  {
78  };
79 
80  //- Word descriptions of interaction type names
82 
83 
84  // Public Member Functions
85 
86  // Return interaction type enum from word
87  interactionType interactionTypeEnum(const word& it) const;
88 
89  // Return word from interaction type enum
90  word interactionTypeStr(const interactionType& it) const;
91 
92 
93 protected:
94 
95  // Protected data
96 
97  //- Convenience typedef to the cloud's parcel type
98  typedef typename CloudType::parcelType parcelType;
99 
100  //- Reference to the cloud random number generator
101  Random& rndGen_;
102 
103 
104  // Cached injector fields per film patch
105 
106  //- Film temperature / patch face
108 
109  //- Film specific heat capacity / patch face
111 
112 
113  // Interaction model data
114 
115  //- Interaction type enumeration
117 
118  //- Film thickness beyond which patch is assumed to be wet
119  scalar deltaWet_;
120 
121  //- Splash parcel type label - id assigned to identify parcel for
122  // post-processing. If not specified, defaults to originating cloud
123  // type
125 
126  //- Number of new parcels resulting from splash event
128 
129 
130  // Surface roughness coefficient typically in the range 1300 - 5200
131  // and decreases with increasing surface roughness
132 
133  //- Dry surface roughness coefficient
134  // = 2630 for dry interaction (ref. Bai)
135  scalar Adry_;
136 
137  //- Wet surface roughness coefficient
138  // = 1320 for wet interaction (ref. Bai)
139  scalar Awet_;
140 
141 
142  //- Skin friction typically in the range 0.6 < Cf < 0.8
143  scalar Cf_;
144 
145  //- Counter for number of new splash parcels
147 
148 
149  // Protected Member Functions
150 
151  //- Return splashed parcel direction
153  (
154  const vector& tanVec1,
155  const vector& tanVec2,
156  const vector& nf
157  ) const;
158 
159 
160  // Interaction models
161 
162  //- Absorb parcel into film
163  void absorbInteraction
164  (
166  const parcelType& p,
167  const polyPatch& pp,
168  const label facei,
169  const scalar mass,
170  bool& keepParticle
171  );
172 
173  //- Bounce parcel (flip parcel normal velocity)
174  void bounceInteraction
175  (
176  parcelType& p,
177  const polyPatch& pp,
178  const label facei,
179  bool& keepParticle
180  ) const;
181 
182  //- Parcel interaction with dry surface
184  (
186  const parcelType& p,
187  const polyPatch& pp,
188  const label facei,
189  bool& keepParticle
190  );
191 
192  //- Parcel interaction with wetted surface
194  (
196  parcelType& p,
197  const polyPatch& pp,
198  const label facei,
199  bool& keepParticle
200  );
201 
202  //- Bai parcel splash interaction model
203  void splashInteraction
204  (
206  const parcelType& p,
207  const polyPatch& pp,
208  const label facei,
209  const scalar mRatio,
210  const scalar We,
211  const scalar Wec,
212  const scalar sigma,
213  bool& keepParticle
214  );
215 
216 
217  // Injection from sheet (ejection) helper functions
218 
219  //- Cache the film fields in preparation for injection
220  virtual void cacheFilmFields
221  (
222  const label filmPatchi,
223  const label primaryPatchi,
225  filmModel
226  );
227 
228  //- Set the individual parcel properties
229  virtual void setParcelProperties
230  (
231  parcelType& p,
232  const label filmFacei
233  ) const;
234 
235 
236 public:
237 
238  //- Runtime type information
239  TypeName("thermoSurfaceFilm");
240 
241 
242  // Constructors
243 
244  //- Construct from components
246 
247  //- Construct copy
249 
250  //- Construct and return a clone using supplied owner cloud
252  {
254  (
256  );
257  }
258 
259 
260  //- Destructor
261  virtual ~ThermoSurfaceFilm();
262 
263 
264  // Member Functions
265 
266  // Evaluation
267 
268  //- Transfer parcel from cloud to surface film
269  // Returns true if parcel is to be transferred
270  virtual bool transferParcel
271  (
272  parcelType& p,
273  const polyPatch& pp,
274  bool& keepParticle
275  );
276 
277 
278  // I-O
279 
280  //- Write surface film info to stream
281  virtual void info(Ostream& os);
282 };
283 
284 
285 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
286 
287 } // End namespace Foam
288 
289 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
290 
291 #ifdef NoRepository
292  #include "ThermoSurfaceFilm.C"
293 #endif
294 
295 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
296 
297 #endif
298 
299 // ************************************************************************* //
scalar Awet_
Wet surface roughness coefficient.
Thermo parcel surface film model.
scalar Cf_
Skin friction typically in the range 0.6 < Cf < 0.8.
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
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
virtual void setParcelProperties(parcelType &p, const label filmFacei) const
Set the individual parcel properties.
virtual autoPtr< SurfaceFilmModel< CloudType > > clone() const
Construct and return a clone using supplied owner cloud.
ThermoSurfaceFilm(const dictionary &dict, CloudType &owner)
Construct from components.
scalar Adry_
Dry surface roughness coefficient.
virtual ~ThermoSurfaceFilm()
Destructor.
scalarList TFilmPatch_
Film temperature / patch face.
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
void drySplashInteraction(regionModels::surfaceFilmModels::surfaceFilmRegionModel &, const parcelType &p, const polyPatch &pp, const label facei, bool &keepParticle)
Parcel interaction with dry surface.
const CloudType & owner() const
Return const access to the owner cloud.
virtual void info(Ostream &os)
Write surface film info to stream.
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m^2/K^4].
interactionType interactionType_
Interaction type enumeration.
void absorbInteraction(regionModels::surfaceFilmModels::surfaceFilmRegionModel &, const parcelType &p, const polyPatch &pp, const label facei, const scalar mass, bool &keepParticle)
Absorb parcel into film.
interactionType interactionTypeEnum(const word &it) const
static wordList interactionTypeNames_
Word descriptions of interaction type names.
A class for handling words, derived from string.
Definition: word.H:59
virtual void cacheFilmFields(const label filmPatchi, const label primaryPatchi, const regionModels::surfaceFilmModels::surfaceFilmRegionModel &filmModel)
Cache the film fields in preparation for injection.
Random number generator.
Definition: Random.H:57
vector splashDirection(const vector &tanVec1, const vector &tanVec2, const vector &nf) const
Return splashed parcel direction.
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:54
void bounceInteraction(parcelType &p, const polyPatch &pp, const label facei, bool &keepParticle) const
Bounce parcel (flip parcel normal velocity)
void splashInteraction(regionModels::surfaceFilmModels::surfaceFilmRegionModel &, 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.
label parcelsPerSplash_
Number of new parcels resulting from splash event.
label nParcelsSplashed_
Counter for number of new splash parcels.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Random & rndGen_
Reference to the cloud random number generator.
TypeName("thermoSurfaceFilm")
Runtime type information.
volScalarField & p
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
word interactionTypeStr(const interactionType &it) const
virtual bool transferParcel(parcelType &p, const polyPatch &pp, bool &keepParticle)
Transfer parcel from cloud to surface film.
void wetSplashInteraction(regionModels::surfaceFilmModels::surfaceFilmRegionModel &, parcelType &p, const polyPatch &pp, const label facei, bool &keepParticle)
Parcel interaction with wetted surface.
scalar deltaWet_
Film thickness beyond which patch is assumed to be wet.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
label splashParcelType_
Splash parcel type label - id assigned to identify parcel for.
scalarList CpFilmPatch_
Film specific heat capacity / patch face.
CloudType::parcelType parcelType
Convenience typedef to the cloud&#39;s parcel type.
Namespace for OpenFOAM.