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 | Copyright (C) 2016-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 \*---------------------------------------------------------------------------*/
25 
26 #include "BrunDrippingInjection.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(BrunDrippingInjection, 0);
42 addToRunTimeSelectionTable(injectionModel, BrunDrippingInjection, dictionary);
43 
44 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45 
46 BrunDrippingInjection::BrunDrippingInjection
47 (
48  surfaceFilmModel& film,
49  const dictionary& dict
50 )
51 :
52  injectionModel(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& massToInject,
72  scalarField& diameterToInject
73 )
74 {
75  const kinematicSingleLayer& film =
76  refCast<const kinematicSingleLayer>(this->film());
77 
78  // Calculate available dripping mass
79  tmp<volScalarField> tsinAlpha(film.gNorm()/mag(film.g()));
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  const scalarField& sigma = film.sigma();
86  const scalar magg = mag(film.g().value());
87 
88  forAll(delta, celli)
89  {
90  bool dripping = false;
91 
92  if (sinAlpha[celli] > SMALL && delta[celli] > deltaStable_)
93  {
94  const scalar rhoc = rho[celli];
95  const scalar lc = sqrt(sigma[celli]/(rhoc*magg));
96  const scalar deltaStable = max
97  (
98  3*lc*sqrt(1 - sqr(sinAlpha[celli]))
99  /(ubarStar_*sqrt(sinAlpha[celli])*sinAlpha[celli]),
101  );
102 
103  if (delta[celli] > deltaStable)
104  {
105  const scalar ddelta = max(delta[celli] - deltaStable, 0);
106 
107  const scalar massDrip =
108  min(availableMass[celli], max(ddelta*rhoc*magSf[celli], 0));
109 
110  if (massDrip > 0)
111  {
112  const scalar diam = dCoeff_*lc;
113  diameter_[celli] = diam;
114 
115  massToInject[celli] += massDrip;
116  availableMass[celli] -= massDrip;
117 
118  diameterToInject[celli] = diam;
119  addToInjectedMass(massDrip);
120 
121  dripping = true;
122  }
123  }
124  }
125 
126  if (!dripping)
127  {
128  diameterToInject[celli] = 0;
129  massToInject[celli] = 0;
130  }
131  }
132 
134 }
135 
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 } // End namespace surfaceFilmModels
140 } // End namespace regionModels
141 } // End namespace Foam
142 
143 // ************************************************************************* //
scalar delta
const surfaceFilmModel & film() const
Return const access to the film surface film model.
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:428
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
label nCells() const
dimensionedScalar sqrt(const dimensionedScalar &ds)
const dimensionedVector & g() const
Return the accleration due to gravity.
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m2/K4].
tmp< volScalarField > gNorm() const
Return the gravity normal-to-patch component contribution.
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.
Macros for easy insertion into run-time selection tables.
addToRunTimeSelectionTable(surfaceFilmModel, kinematicSingleLayer, mesh)
const Type & value() const
Return const reference to value.
const fvMesh & regionMesh() const
Return the region mesh database.
Definition: regionModelI.H:61
scalarList diameter_
Diameters of particles to inject into the dripping.
void addToInjectedMass(const scalar dMass)
Add to injected mass.
Base class for film injection models, handling mass transfer from the film.
const volScalarField & delta() const
Return const access to the film thickness [m].
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:485
virtual const volScalarField & magSf() const
Return the face area magnitudes / [m2].
const volScalarField & sigma() const
Return const access to the surface tension [kg/s2].
dimensioned< scalar > mag(const dimensioned< Type > &)
virtual const volScalarField & rho() const
Return the film density [kg/m3].
A class for managing temporary objects.
Definition: PtrList.H:53
defineTypeNameAndDebug(kinematicSingleLayer, 0)
Namespace for OpenFOAM.