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-------------------------------------------------------------------------------
11License
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
32
33// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34
35namespace Foam
36{
37namespace regionModels
38{
39namespace surfaceFilmModels
40{
41
42// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
43
46
47// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
48
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{
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
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
const Type & value() const
Return const reference to value.
virtual const volScalarField & magSf() const
Return the face area magnitudes / [m2].
scalar dCoeff_
Coefficient relating the diameter of the drops formed to.
scalar deltaStable_
Stable film thickness - drips only formed if thickness.
scalar ubarStar_
Critical non-dimensional interface velocity.
scalarList diameter_
Diameters of particles to inject into the dripping.
const surfaceFilmRegionModel & film() const
Return const access to the film surface film model.
Base class for film injection models, handling mass transfer from the film.
void addToInjectedMass(const scalar dMass)
Add to injected mass.
Kinematic form of single-cell layer surface film model.
virtual const volScalarField & sigma() const =0
Return the film surface tension [N/m].
virtual const volScalarField & rho() const =0
Return the film density [kg/m3].
const dimensionedVector & g() const
Return the acceleration due to gravity.
virtual const volScalarField & delta() const =0
Return the film thickness [m].
A class for managing temporary objects.
Definition: tmp.H:65
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
Namespace for OpenFOAM.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
dimensionedSymmTensor sqr(const dimensionedVector &dv)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:598
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
dictionary dict
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333