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 
44 defineTypeNameAndDebug(BrunDrippingInjection, 0);
45 addToRunTimeSelectionTable(injectionModel, BrunDrippingInjection, dictionary);
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]),
103  deltaStable_
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 // ************************************************************************* //
Foam::regionModels::surfaceFilmModels::injectionModel::correct
void correct()
Correct.
Definition: injectionModel.C:81
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
BrunDrippingInjection.H
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer
Kinematic form of single-cell layer surface film model.
Definition: kinematicSingleLayer.H:67
Foam::dimensioned::value
const Type & value() const
Return const reference to value.
Definition: dimensionedType.C:434
Foam::regionModels::surfaceFilmModels::addToRunTimeSelectionTable
addToRunTimeSelectionTable(surfaceFilmRegionModel, kinematicSingleLayer, mesh)
rho
rho
Definition: readInitialConditions.H:88
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
Foam::regionModels::surfaceFilmModels::surfaceFilmRegionModel::g
const dimensionedVector & g() const
Return the acceleration due to gravity.
Definition: surfaceFilmRegionModelI.H:41
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::primitiveMesh::nCells
label nCells() const noexcept
Number of mesh cells.
Definition: primitiveMeshI.H:96
Foam::Field< scalar >
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::gNorm
tmp< volScalarField > gNorm() const
Return the gravity normal-to-patch component contribution.
Definition: kinematicSingleLayerI.H:212
Foam::regionModels::surfaceFilmModels::surfaceFilmRegionModel
Base class for surface film models.
Definition: surfaceFilmRegionModel.H:55
Foam::regionModels::singleLayerRegion::magSf
virtual const volScalarField & magSf() const
Return the face area magnitudes / [m2].
Definition: singleLayerRegion.C:223
Foam::regionModels::regionModel::regionMesh
const fvMesh & regionMesh() const
Return the region mesh database.
Definition: regionModelI.H:64
delta
scalar delta
Definition: LISASMDCalcMethod2.H:8
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::regionModels::surfaceFilmModels::injectionModel
Base class for film injection models, handling mass transfer from the film.
Definition: injectionModel.H:58
kinematicSingleLayer.H
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::sigma
const volScalarField & sigma() const
Return const access to the surface tension [kg/s2].
Definition: kinematicSingleLayerI.H:80
Foam::regionModels::surfaceFilmModels::defineTypeNameAndDebug
defineTypeNameAndDebug(kinematicSingleLayer, 0)
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:51
Foam::sqrt
dimensionedScalar sqrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:144
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::delta
const volScalarField & delta() const
Return const access to the film thickness [m].
Definition: kinematicSingleLayerI.H:86
sigma
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::rho
virtual const volScalarField & rho() const
Return the film density [kg/m3].
Definition: kinematicSingleLayer.C:982
Foam::regionModels::surfaceFilmModels::BrunDrippingInjection::~BrunDrippingInjection
virtual ~BrunDrippingInjection()
Destructor.
Definition: BrunDrippingInjection.C:65