BrunDrippingInjection.C
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) 2016-2017 OpenFOAM Foundation
9  Copyright (C) 2020-2022 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "BrunDrippingInjection.H"
31 
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 namespace regionModels
37 {
38 namespace areaSurfaceFilmModels
39 {
40 
41 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
42 
43 defineTypeNameAndDebug(BrunDrippingInjection, 0);
45 (
46  injectionModel,
47  BrunDrippingInjection,
49 );
50 
51 
52 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
53 
54 BrunDrippingInjection::BrunDrippingInjection
55 (
56  liquidFilmBase& film,
57  const dictionary& dict
58 )
59 :
60  injectionModel(type(), film, dict),
61  ubarStar_
62  (
63  coeffDict_.getCheckOrDefault<scalar>
64  (
65  "ubarStar",
66  1.62208,
67  scalarMinMax::ge(SMALL)
68  )
69  ),
70  dCoeff_(coeffDict_.getOrDefault<scalar>("dCoeff", 3.3)),
71  deltaStable_(coeffDict_.getOrDefault<scalar>("deltaStable", 0)),
72  diameter_(film.regionMesh().nFaces(), -1.0)
73 {}
74 
75 
76 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
77 
79 (
80  scalarField& availableMass,
81  scalarField& massToInject,
82  scalarField& diameterToInject
83 )
84 {
85  // Calculate available dripping mass
86  tmp<areaScalarField> tsinAlpha = -film().gn()/mag(film().g());
87  const scalarField& sinAlpha = tsinAlpha();
88 
89  const areaScalarField& delta = film().h();
90  const areaScalarField& rho = film().rho();
91  const areaScalarField& sigma = film().sigma();
92  const scalar magg = mag(film().g().value());
93 
94  forAll(delta, facei)
95  {
96  bool dripping = false;
97 
98  if (sinAlpha[facei] > SMALL && delta[facei] > deltaStable_)
99  {
100  const scalar rhoc = rho[facei];
101  const scalar lc = sqrt(sigma[facei]/(rhoc*magg));
102  const scalar deltaStable = max
103  (
104  3*lc*sqrt(1 - sqr(sinAlpha[facei]))
105  /(ubarStar_*sqrt(sinAlpha[facei])*sinAlpha[facei]),
107  );
108 
109  if (delta[facei] > deltaStable)
110  {
111  const scalar massDrip =
112  availableMass[facei]*(delta[facei] - deltaStable);
113 
114  if (massDrip > 0)
115  {
116  const scalar diam = dCoeff_*lc;
117  diameter_[facei] = diam;
118 
119  massToInject[facei] += massDrip;
120  availableMass[facei] -= massDrip;
121 
122  diameterToInject[facei] = diam;
123  addToInjectedMass(massDrip);
124 
125  dripping = true;
126  }
127  }
128  }
129 
130  if (!dripping)
131  {
132  diameterToInject[facei] = 0;
133  massToInject[facei] = 0;
134  }
135  }
136 
138 }
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace areaSurfaceFilmModels
144 } // End namespace regionModels
145 } // End namespace Foam
146 
147 // ************************************************************************* //
scalar delta
dictionary dict
void addToInjectedMass(const scalar dMass)
Add to injected mass.
scalar deltaStable_
Stable film thickness - drips only formed if thickness exceeds this threshold value.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const areaScalarField & h() const
Access const reference h.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:40
virtual const areaScalarField & sigma() const =0
Access const reference sigma.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sqrt(const dimensionedScalar &ds)
scalar dCoeff_
Coefficient relating the diameter of the drops formed to the capillary length.
defineTypeNameAndDebug(kinematicThinFilm, 0)
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
Base class for film injection models, handling mass transfer from the film.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:421
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: POSIX.C:799
scalarList diameter_
Diameters of particles to inject into the dripping.
addToRunTimeSelectionTable(liquidFilmBase, kinematicThinFilm, dictionary)
scalar ubarStar_
Critical non-dimensional interface velocity.
const uniformDimensionedVectorField & g
const areaScalarField & gn() const
Access const reference gn.
virtual const areaScalarField & rho() const =0
Access const reference rho.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.
const liquidFilmBase & film() const
Return const access to the film surface film model.