ThermoSurfaceFilm.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 | Copyright (C) 2011-2017 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 parcelss 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
102 
103  //- Reference to the cloud thermo package
104  const SLGThermo& thermo_;
105 
106 
107  // Cached injector fields per film patch
108 
109  //- Film temperature / patch face
111 
112  //- Film specific heat capacity / patch face
114 
115 
116  // Interaction model data
117 
118  //- Interaction type enumeration
120 
121  //- Film thickness beyond which patch is assumed to be wet
122  scalar deltaWet_;
123 
124  //- Splash parcel type label - id assigned to identify parcel for
125  // post-processing. If not specified, defaults to originating cloud
126  // type
128 
129  //- Number of new parcels resulting from splash event
131 
132 
133  // Surface roughness coefficient typically in the range 1300 - 5200
134  // and decreases with increasing surface roughness
135 
136  //- Dry surface roughness coefficient
137  // = 2630 for dry interaction (ref. Bai)
138  scalar Adry_;
139 
140  //- Wet surface roughness coefficient
141  // = 1320 for wet interaction (ref. Bai)
142  scalar Awet_;
143 
144 
145  //- Skin friction typically in the range 0.6 < Cf < 0.8
146  scalar Cf_;
147 
148  //- Counter for number of new splash parcels
150 
151 
152  // Protected Member Functions
153 
154  //- Return a vector tangential to input vector, v
155  vector tangentVector(const vector& v) const;
156 
157  //- Return splashed parcel direction
159  (
160  const vector& tanVec1,
161  const vector& tanVec2,
162  const vector& nf
163  ) const;
164 
165 
166  // Interaction models
167 
168  //- Absorb parcel into film
169  void absorbInteraction
170  (
172  const parcelType& p,
173  const polyPatch& pp,
174  const label facei,
175  const scalar mass,
176  bool& keepParticle
177  );
178 
179  //- Bounce parcel (flip parcel normal velocity)
180  void bounceInteraction
181  (
182  parcelType& p,
183  const polyPatch& pp,
184  const label facei,
185  bool& keepParticle
186  ) const;
187 
188  //- Parcel interaction with dry surface
190  (
192  const parcelType& p,
193  const polyPatch& pp,
194  const label facei,
195  bool& keepParticle
196  );
197 
198  //- Parcel interaction with wetted surface
200  (
202  parcelType& p,
203  const polyPatch& pp,
204  const label facei,
205  bool& keepParticle
206  );
207 
208  //- Bai parcel splash interaction model
209  void splashInteraction
210  (
212  const parcelType& p,
213  const polyPatch& pp,
214  const label facei,
215  const scalar mRatio,
216  const scalar We,
217  const scalar Wec,
218  const scalar sigma,
219  bool& keepParticle
220  );
221 
222 
223  // Injection from sheet (ejection) helper functions
224 
225  //- Cache the film fields in preparation for injection
226  virtual void cacheFilmFields
227  (
228  const label filmPatchi,
229  const label primaryPatchi,
231  filmModel
232  );
233 
234  //- Set the individual parcel properties
235  virtual void setParcelProperties
236  (
237  parcelType& p,
238  const label filmFacei
239  ) const;
240 
241 
242 public:
243 
244  //- Runtime type information
245  TypeName("thermoSurfaceFilm");
246 
247 
248  // Constructors
249 
250  //- Construct from components
252 
253  //- Construct copy
255 
256  //- Construct and return a clone using supplied owner cloud
258  {
260  (
262  );
263  }
264 
265 
266  //- Destructor
267  virtual ~ThermoSurfaceFilm();
268 
269 
270  // Member Functions
271 
272  // Evaluation
273 
274  //- Transfer parcel from cloud to surface film
275  // Returns true if parcel is to be transferred
276  virtual bool transferParcel
277  (
278  parcelType& p,
279  const polyPatch& pp,
280  bool& keepParticle
281  );
282 
283 
284  // I-O
285 
286  //- Write surface film info to stream
287  virtual void info(Ostream& os);
288 };
289 
290 
291 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
292 
293 } // End namespace Foam
294 
295 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
296 
297 #ifdef NoRepository
298  #include "ThermoSurfaceFilm.C"
299 #endif
300 
301 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
302 
303 #endif
304 
305 // ************************************************************************* //
scalar Awet_
Wet surface roughness coefficient.
Thermo parcel surface film model.
scalar Cf_
Skin friction typically in the range 0.6 < Cf < 0.8.
void wetSplashInteraction(regionModels::surfaceFilmModels::surfaceFilmModel &filmModel, parcelType &p, const polyPatch &pp, const label facei, bool &keepParticle)
Parcel interaction with wetted surface.
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
void splashInteraction(regionModels::surfaceFilmModels::surfaceFilmModel &filmModel, 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.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
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.
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m2/K4].
Random number generator.
Definition: cachedRandom.H:63
scalarList TFilmPatch_
Film temperature / patch face.
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
const CloudType & owner() const
Return const access to the owner cloud.
virtual void info(Ostream &os)
Write surface film info to stream.
interactionType interactionType_
Interaction type enumeration.
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
void absorbInteraction(regionModels::surfaceFilmModels::surfaceFilmModel &filmModel, const parcelType &p, const polyPatch &pp, const label facei, const scalar mass, bool &keepParticle)
Absorb parcel into film.
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package, and provides:
Definition: SLGThermo.H:62
const SLGThermo & thermo_
Reference to the cloud thermo package.
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:218
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
Templated wall surface film model class.
cachedRandom & rndGen_
Reference to the cloud random number generator.
void bounceInteraction(parcelType &p, const polyPatch &pp, const label facei, bool &keepParticle) const
Bounce parcel (flip parcel normal velocity)
vector tangentVector(const vector &v) const
Return a vector tangential to input vector, v.
void drySplashInteraction(regionModels::surfaceFilmModels::surfaceFilmModel &filmModel, const parcelType &p, const polyPatch &pp, const label facei, bool &keepParticle)
Parcel interaction with dry surface.
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
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.
scalar deltaWet_
Film thickness beyond which patch is assumed to be wet.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:69
virtual void cacheFilmFields(const label filmPatchi, const label primaryPatchi, const regionModels::surfaceFilmModels::surfaceFilmModel &filmModel)
Cache the film fields in preparation for injection.
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.