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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
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::ThermoSurfaceFilm
28 
29 Group
30  grpLagrangianIntermediateSurfaceFilmSubModels
31 
32 Description
33  Thermo 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  Splash model references:
40 
41  Bai and Gosman, `Mathematical modelling of wall films formed by
42  impinging sprays', SAE 960626, 1996
43 
44  Bai et al, `Modelling of gasoline spray impingement', Atom. Sprays,
45  vol 12, pp 1-27, 2002
46 
47 
48 SourceFiles
49  ThermoSurfaceFilm.C
50  ThermoSurfaceFilmI.H
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #ifndef ThermoSurfaceFilm_H
55 #define ThermoSurfaceFilm_H
56 
57 #include "SurfaceFilmModel.H"
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 namespace Foam
62 {
63 
64 /*---------------------------------------------------------------------------*\
65  Class ThermoSurfaceFilm Declaration
66 \*---------------------------------------------------------------------------*/
67 
68 template<class CloudType>
70 :
71  public SurfaceFilmModel<CloudType>
72 {
73 public:
74 
75  // Public data
76 
77  // Interaction type enumerations
78  enum interactionType
79  {
83  };
84 
85  //- Word descriptions of interaction type names
87 
88 
89  // Public Member Functions
90 
91  // Return interaction type enum from word
92  interactionType interactionTypeEnum(const word& it) const;
93 
94  // Return word from interaction type enum
95  word interactionTypeStr(const interactionType& it) const;
96 
97 
98 protected:
99 
100  // Protected data
101 
102  //- Convenience typedef to the cloud's parcel type
103  typedef typename CloudType::parcelType parcelType;
104 
105  //- Reference to the cloud random number generator
106  Random& rndGen_;
107 
108  //- Reference to the cloud thermo package
109  const SLGThermo& thermo_;
110 
111 
112  // Cached injector fields per film patch
113 
114  //- Film temperature / patch face
116 
117  //- Film specific heat capacity / patch face
119 
120 
121  // Interaction model data
122 
123  //- Interaction type enumeration
125 
126  //- Film thickness beyond which patch is assumed to be wet
127  scalar deltaWet_;
128 
129  //- Splash parcel type label - id assigned to identify parcel for
130  // post-processing. If not specified, defaults to originating cloud
131  // type
132  label splashParcelType_;
133 
134  //- Number of new parcels resulting from splash event
135  label parcelsPerSplash_;
136 
137 
138  // Surface roughness coefficient typically in the range 1300 - 5200
139  // and decreases with increasing surface roughness
140 
141  //- Dry surface roughness coefficient
142  // = 2630 for dry interaction (ref. Bai)
143  scalar Adry_;
144 
145  //- Wet surface roughness coefficient
146  // = 1320 for wet interaction (ref. Bai)
147  scalar Awet_;
148 
149 
150  //- Skin friction typically in the range 0.6 < Cf < 0.8
151  scalar Cf_;
152 
153  //- Counter for number of new splash parcels
154  label nParcelsSplashed_;
155 
156 
157  // Protected Member Functions
158 
159  //- Return a vector tangential to input vector, v
160  vector tangentVector(const vector& v) const;
161 
162  //- Return splashed parcel direction
164  (
165  const vector& tanVec1,
166  const vector& tanVec2,
167  const vector& nf
168  ) const;
169 
170 
171  // Interaction models
172 
173  //- Absorb parcel into film
174  void absorbInteraction
175  (
177  const parcelType& p,
178  const polyPatch& pp,
179  const label facei,
180  const scalar mass,
181  bool& keepParticle
182  );
183 
184  //- Bounce parcel (flip parcel normal velocity)
185  void bounceInteraction
186  (
187  parcelType& p,
188  const polyPatch& pp,
189  const label facei,
190  bool& keepParticle
191  ) const;
192 
193  //- Parcel interaction with dry surface
195  (
197  const parcelType& p,
198  const polyPatch& pp,
199  const label facei,
200  bool& keepParticle
201  );
202 
203  //- Parcel interaction with wetted surface
205  (
207  parcelType& p,
208  const polyPatch& pp,
209  const label facei,
210  bool& keepParticle
211  );
212 
213  //- Bai parcel splash interaction model
214  void splashInteraction
215  (
217  const parcelType& p,
218  const polyPatch& pp,
219  const label facei,
220  const scalar mRatio,
221  const scalar We,
222  const scalar Wec,
223  const scalar sigma,
224  bool& keepParticle
225  );
226 
227 
228  // Injection from sheet (ejection) helper functions
229 
230  //- Cache the film fields in preparation for injection
231  virtual void cacheFilmFields
232  (
233  const label filmPatchi,
234  const label primaryPatchi,
236  filmModel
237  );
238 
239  //- Set the individual parcel properties
240  virtual void setParcelProperties
241  (
242  parcelType& p,
243  const label filmFacei
244  ) const;
245 
246 
247 public:
248 
249  //- Runtime type information
250  TypeName("thermoSurfaceFilm");
251 
252 
253  // Constructors
254 
255  //- Construct from components
256  ThermoSurfaceFilm(const dictionary& dict, CloudType& owner);
257 
258  //- Construct copy
260 
261  //- Construct and return a clone using supplied owner cloud
263  {
265  (
267  );
268  }
269 
270 
271  //- Destructor
272  virtual ~ThermoSurfaceFilm();
273 
274 
275  // Member Functions
276 
277  // Evaluation
278 
279  //- Transfer parcel from cloud to surface film
280  // Returns true if parcel is to be transferred
281  virtual bool transferParcel
282  (
283  parcelType& p,
284  const polyPatch& pp,
285  bool& keepParticle
286  );
287 
288 
289  // I-O
290 
291  //- Write surface film info to stream
292  virtual void info(Ostream& os);
293 };
294 
295 
296 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
297 
298 } // End namespace Foam
299 
300 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
301 
302 #ifdef NoRepository
303  #include "ThermoSurfaceFilm.C"
304 #endif
305 
306 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
307 
308 #endif
309 
310 // ************************************************************************* //
Foam::ThermoSurfaceFilm::cacheFilmFields
virtual void cacheFilmFields(const label filmPatchi, const label primaryPatchi, const regionModels::surfaceFilmModels::surfaceFilmRegionModel &filmModel)
Cache the film fields in preparation for injection.
Definition: ThermoSurfaceFilm.C:628
Foam::ThermoSurfaceFilm::interactionType_
interactionType interactionType_
Interaction type enumeration.
Definition: ThermoSurfaceFilm.H:123
Foam::Random
Random number generator.
Definition: Random.H:59
Foam::ThermoSurfaceFilm::interactionType
interactionType
Definition: ThermoSurfaceFilm.H:77
Foam::ThermoSurfaceFilm::TFilmPatch_
scalarList TFilmPatch_
Film temperature / patch face.
Definition: ThermoSurfaceFilm.H:114
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::SLGThermo
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package,...
Definition: SLGThermo.H:64
Foam::ThermoSurfaceFilm::ThermoSurfaceFilm
ThermoSurfaceFilm(const dictionary &dict, CloudType &owner)
Construct from components.
Definition: ThermoSurfaceFilm.C:480
Foam::ThermoSurfaceFilm::Adry_
scalar Adry_
Dry surface roughness coefficient.
Definition: ThermoSurfaceFilm.H:142
Foam::ThermoSurfaceFilm::itBounce
Definition: ThermoSurfaceFilm.H:80
Foam::ThermoSurfaceFilm::deltaWet_
scalar deltaWet_
Film thickness beyond which patch is assumed to be wet.
Definition: ThermoSurfaceFilm.H:126
Foam::ThermoSurfaceFilm::TypeName
TypeName("thermoSurfaceFilm")
Runtime type information.
Foam::ThermoSurfaceFilm::splashParcelType_
label splashParcelType_
Splash parcel type label - id assigned to identify parcel for.
Definition: ThermoSurfaceFilm.H:131
Foam::ThermoSurfaceFilm::parcelType
CloudType::parcelType parcelType
Convenience typedef to the cloud's parcel type.
Definition: ThermoSurfaceFilm.H:102
Foam::ThermoSurfaceFilm
Thermo parcel surface film model.
Definition: ThermoSurfaceFilm.H:68
Foam::ThermoSurfaceFilm::wetSplashInteraction
void wetSplashInteraction(regionModels::surfaceFilmModels::surfaceFilmRegionModel &, parcelType &p, const polyPatch &pp, const label facei, bool &keepParticle)
Parcel interaction with wetted surface.
Definition: ThermoSurfaceFilm.C:266
Foam::ThermoSurfaceFilm::Cf_
scalar Cf_
Skin friction typically in the range 0.6 < Cf < 0.8.
Definition: ThermoSurfaceFilm.H:150
Foam::SurfaceFilmModel::parcelType
CloudType::parcelType parcelType
Convenience typedef to the cloud's parcel type.
Definition: SurfaceFilmModel.H:76
Foam::regionModels::surfaceFilmModels::surfaceFilmRegionModel
Base class for surface film models.
Definition: surfaceFilmRegionModel.H:55
Foam::ThermoSurfaceFilm::bounceInteraction
void bounceInteraction(parcelType &p, const polyPatch &pp, const label facei, bool &keepParticle) const
Bounce parcel (flip parcel normal velocity)
Definition: ThermoSurfaceFilm.C:180
ThermoSurfaceFilm.C
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:67
Foam::ThermoSurfaceFilm::absorbInteraction
void absorbInteraction(regionModels::surfaceFilmModels::surfaceFilmRegionModel &, const parcelType &p, const polyPatch &pp, const label facei, const scalar mass, bool &keepParticle)
Absorb parcel into film.
Definition: ThermoSurfaceFilm.C:133
Foam::ThermoSurfaceFilm::parcelsPerSplash_
label parcelsPerSplash_
Number of new parcels resulting from splash event.
Definition: ThermoSurfaceFilm.H:134
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::ThermoSurfaceFilm::Awet_
scalar Awet_
Wet surface roughness coefficient.
Definition: ThermoSurfaceFilm.H:146
Foam::ThermoSurfaceFilm::interactionTypeEnum
interactionType interactionTypeEnum(const word &it) const
Definition: ThermoSurfaceFilm.C:49
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::ThermoSurfaceFilm::clone
virtual autoPtr< SurfaceFilmModel< CloudType > > clone() const
Construct and return a clone using supplied owner cloud.
Definition: ThermoSurfaceFilm.H:261
Foam::ThermoSurfaceFilm::info
virtual void info(Ostream &os)
Write surface film info to stream.
Definition: ThermoSurfaceFilm.C:665
Foam::ThermoSurfaceFilm::CpFilmPatch_
scalarList CpFilmPatch_
Film specific heat capacity / patch face.
Definition: ThermoSurfaceFilm.H:117
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::ThermoSurfaceFilm::thermo_
const SLGThermo & thermo_
Reference to the cloud thermo package.
Definition: ThermoSurfaceFilm.H:108
Foam::ThermoSurfaceFilm::nParcelsSplashed_
label nParcelsSplashed_
Counter for number of new splash parcels.
Definition: ThermoSurfaceFilm.H:153
Foam::ThermoSurfaceFilm::rndGen_
Random & rndGen_
Reference to the cloud random number generator.
Definition: ThermoSurfaceFilm.H:105
Foam::Vector< scalar >
Foam::ThermoSurfaceFilm::setParcelProperties
virtual void setParcelProperties(parcelType &p, const label filmFacei) const
Set the individual parcel properties.
Definition: ThermoSurfaceFilm.C:651
Foam::ThermoSurfaceFilm::splashInteraction
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.
Definition: ThermoSurfaceFilm.C:343
Foam::List< word >
Foam::ThermoSurfaceFilm::itSplashBai
Definition: ThermoSurfaceFilm.H:81
Foam::ThermoSurfaceFilm::tangentVector
vector tangentVector(const vector &v) const
Return a vector tangential to input vector, v.
Definition: ThermoSurfaceFilm.C:88
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
SurfaceFilmModel.H
Foam::ThermoSurfaceFilm::splashDirection
vector splashDirection(const vector &tanVec1, const vector &tanVec2, const vector &nf) const
Return splashed parcel direction.
Definition: ThermoSurfaceFilm.C:108
Foam::ThermoSurfaceFilm::interactionTypeStr
word interactionTypeStr(const interactionType &it) const
Definition: ThermoSurfaceFilm.C:70
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::ThermoSurfaceFilm::drySplashInteraction
void drySplashInteraction(regionModels::surfaceFilmModels::surfaceFilmRegionModel &, const parcelType &p, const polyPatch &pp, const label facei, bool &keepParticle)
Parcel interaction with dry surface.
Definition: ThermoSurfaceFilm.C:210
Foam::ThermoSurfaceFilm::transferParcel
virtual bool transferParcel(parcelType &p, const polyPatch &pp, bool &keepParticle)
Transfer parcel from cloud to surface film.
Definition: ThermoSurfaceFilm.C:555
Foam::ThermoSurfaceFilm::interactionTypeNames_
static wordList interactionTypeNames_
Word descriptions of interaction type names.
Definition: ThermoSurfaceFilm.H:85
Foam::ThermoSurfaceFilm::itAbsorb
Definition: ThermoSurfaceFilm.H:79
Foam::ThermoSurfaceFilm::~ThermoSurfaceFilm
virtual ~ThermoSurfaceFilm()
Destructor.
Definition: ThermoSurfaceFilm.C:547