BrunDrippingEjection.C
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) 2016-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 \*---------------------------------------------------------------------------*/
25 
26 #include "BrunDrippingEjection.H"
28 #include "kinematicSingleLayer.H"
29 
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 namespace regionModels
35 {
36 namespace surfaceFilmModels
37 {
38 
39 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
40 
41 defineTypeNameAndDebug(BrunDrippingEjection, 0);
42 addToRunTimeSelectionTable(ejectionModel, BrunDrippingEjection, dictionary);
43 
44 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45 
47 (
49  const dictionary& dict
50 )
51 :
52  ejectionModel(type(), film, dict),
53  ubarStar_(coeffDict_.lookupOrDefault("ubarStar", 1.62208)),
54  dCoeff_(coeffDict_.lookupOrDefault("dCoeff", 3.3)),
55  deltaStable_(coeffDict_.lookupOrDefault("deltaStable", scalar(0))),
56  diameter_(film.regionMesh().nCells(), -1.0)
57 {}
58 
59 
60 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
61 
63 {}
64 
65 
66 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
67 
69 (
70  scalarField& availableMass,
71  scalarField& massToEject,
72  scalarField& diameterToEject
73 )
74 {
75  const kinematicSingleLayer& film =
76  refCast<const kinematicSingleLayer>(this->film());
77 
78  // Calculate available dripping mass
79  tmp<volScalarField> tsinAlpha((film.g()/mag(film.g())) & film.nHat());
80  const scalarField& sinAlpha = tsinAlpha();
81  const scalarField& magSf = film.magSf();
82 
83  const scalarField& delta = film.delta();
84  const scalarField& rho = film.rho();
85 
86  const tmp<volScalarField> tsigma = film.sigma();
87  const volScalarField::Internal& sigma = tsigma();
88 
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  massToEject[celli] += massDrip;
119  availableMass[celli] -= massDrip;
120 
121  diameterToEject[celli] = diam;
122  addToEjectedMass(massDrip);
123 
124  dripping = true;
125  }
126  }
127  }
128 
129  if (!dripping)
130  {
131  diameterToEject[celli] = 0;
132  massToEject[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
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
Kinematic form of single-cell layer surface film model.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
BrunDrippingEjection(surfaceFilmRegionModel &film, const dictionary &dict)
Construct from surface film model.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Base class for film ejection models, handling mass transfer from the film.
Definition: ejectionModel.H:56
scalarList diameter_
Diameters of particles to eject into the dripping.
label nCells() const
dimensionedScalar sqrt(const dimensionedScalar &ds)
scalar ubarStar_
Critical non-dimensional interface velocity.
Macros for easy insertion into run-time selection tables.
const surfaceFilmRegionModel & film() const
Return const access to the film surface film model.
scalar dCoeff_
Coefficient relating the diameter of the drops formed to.
addToRunTimeSelectionTable(ejectionModel, BrunDrippingEjection, dictionary)
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m^2/K^4].
const Type & value() const
Return const reference to value.
const volVectorField & nHat() const
Return the patch normal vectors.
const fvMesh & regionMesh() const
Return the region mesh database.
Definition: regionModelI.H:55
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
const dimensionedVector & g() const
Return the acceleration due to gravity.
volScalarField rhoc(IOobject(rhocValue.name(), runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, rhocValue)
void addToEjectedMass(const scalar dMass)
Add to ejected mass.
Definition: ejectionModel.C:44
const volScalarField & delta() const
Return const access to the film thickness [m].
tmp< volScalarField > sigma() const
Return the surface tension coefficient [kg/s^2].
const volScalarField::Internal & magSf() const
Return the face area magnitudes [m^2].
scalar deltaStable_
Stable film thickness - drips only formed if thickness.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
dimensioned< scalar > mag(const dimensioned< Type > &)
const volScalarField & rho() const
Return the film density [kg/m^3].
A class for managing temporary objects.
Definition: PtrList.H:53
defineTypeNameAndDebug(kinematicSingleLayer, 0)
Namespace for OpenFOAM.