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 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 #include "kinematicSingleLayer.H"
32 
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37 namespace regionModels
38 {
39 namespace surfaceFilmModels
40 {
41 
42 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
43 
46 
47 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
48 
49 BrunDrippingInjection::BrunDrippingInjection
50 (
52  const dictionary& dict
53 )
54 :
55  injectionModel(type(), film, dict),
56  ubarStar_(coeffDict_.getOrDefault<scalar>("ubarStar", 1.62208)),
57  dCoeff_(coeffDict_.getOrDefault<scalar>("dCoeff", 3.3)),
58  deltaStable_(coeffDict_.getOrDefault<scalar>("deltaStable", 0)),
59  diameter_(film.regionMesh().nCells(), -1.0)
60 {}
61 
62 
63 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
64 
66 {}
67 
68 
69 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
70 
72 (
73  scalarField& availableMass,
74  scalarField& massToInject,
75  scalarField& diameterToInject
76 )
77 {
78  const kinematicSingleLayer& film =
79  refCast<const kinematicSingleLayer>(this->film());
80 
81  // Calculate available dripping mass
82  tmp<volScalarField> tsinAlpha(film.gNorm()/mag(film.g()));
83  const scalarField& sinAlpha = tsinAlpha();
84  const scalarField& magSf = film.magSf();
85 
86  const scalarField& delta = film.delta();
87  const scalarField& rho = film.rho();
88  const scalarField& sigma = film.sigma();
89  const scalar magg = mag(film.g().value());
90 
91  forAll(delta, celli)
92  {
93  bool dripping = false;
94 
95  if (sinAlpha[celli] > SMALL && delta[celli] > deltaStable_)
96  {
97  const scalar rhoc = rho[celli];
98  const scalar lc = sqrt(sigma[celli]/(rhoc*magg));
99  const scalar deltaStable = max
100  (
101  3*lc*sqrt(1 - sqr(sinAlpha[celli]))
102  /(ubarStar_*sqrt(sinAlpha[celli])*sinAlpha[celli]),
104  );
105 
106  if (delta[celli] > deltaStable)
107  {
108  const scalar ddelta = max(delta[celli] - deltaStable, 0);
109 
110  const scalar massDrip =
111  min(availableMass[celli], max(ddelta*rhoc*magSf[celli], 0));
112 
113  if (massDrip > 0)
114  {
115  const scalar diam = dCoeff_*lc;
116  diameter_[celli] = diam;
117 
118  massToInject[celli] += massDrip;
119  availableMass[celli] -= massDrip;
120 
121  diameterToInject[celli] = diam;
122  addToInjectedMass(massDrip);
123 
124  dripping = true;
125  }
126  }
127  }
128 
129  if (!dripping)
130  {
131  diameterToInject[celli] = 0;
132  massToInject[celli] = 0;
133  }
134  }
135 
137 }
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace surfaceFilmModels
143 } // End namespace regionModels
144 } // End namespace Foam
145 
146 // ************************************************************************* //
scalar delta
const Type & value() const noexcept
Return const reference to value.
dictionary dict
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Kinematic form of single-cell layer surface film model.
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
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sqrt(const dimensionedScalar &ds)
scalar deltaStable_
Stable film thickness - drips only formed if thickness.
scalar ubarStar_
Critical non-dimensional interface velocity.
scalar dCoeff_
Coefficient relating the diameter of the drops formed to.
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
virtual const volScalarField & rho() const =0
Return the film density [kg/m3].
addToRunTimeSelectionTable(surfaceFilmRegionModel, kinematicSingleLayer, mesh)
Macros for easy insertion into run-time selection tables.
const surfaceFilmRegionModel & film() const
Return const access to the film surface film model.
#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
virtual const volScalarField & delta() const =0
Return the film thickness [m].
scalarList diameter_
Diameters of particles to inject into the dripping.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:26
void addToInjectedMass(const scalar dMass)
Add to injected mass.
const dimensionedVector & g() const
Return the acceleration due to gravity.
Base class for film injection models, handling mass transfer from the film.
virtual const volScalarField & magSf() const
Return the face area magnitudes / [m2].
A class for managing temporary objects.
Definition: HashPtrTable.H:50
virtual const volScalarField & sigma() const =0
Return the film surface tension [N/m].
defineTypeNameAndDebug(kinematicSingleLayer, 0)
Namespace for OpenFOAM.