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 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "BrunDrippingInjection.H"
30 #include "kinematicSingleLayer.H"
31 
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 namespace regionModels
37 {
38 namespace surfaceFilmModels
39 {
40 
41 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
42 
43 defineTypeNameAndDebug(BrunDrippingInjection, 0);
44 addToRunTimeSelectionTable(injectionModel, BrunDrippingInjection, dictionary);
45 
46 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
47 
48 BrunDrippingInjection::BrunDrippingInjection
49 (
51  const dictionary& dict
52 )
53 :
54  injectionModel(type(), film, dict),
55  ubarStar_(coeffDict_.lookupOrDefault<scalar>("ubarStar", 1.62208)),
56  dCoeff_(coeffDict_.lookupOrDefault<scalar>("dCoeff", 3.3)),
57  deltaStable_(coeffDict_.lookupOrDefault<scalar>("deltaStable", 0)),
58  diameter_(film.regionMesh().nCells(), -1.0)
59 {}
60 
61 
62 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
63 
65 {}
66 
67 
68 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
69 
71 (
72  scalarField& availableMass,
73  scalarField& massToInject,
74  scalarField& diameterToInject
75 )
76 {
77  const kinematicSingleLayer& film =
78  refCast<const kinematicSingleLayer>(this->film());
79 
80  // Calculate available dripping mass
81  tmp<volScalarField> tsinAlpha(film.gNorm()/mag(film.g()));
82  const scalarField& sinAlpha = tsinAlpha();
83  const scalarField& magSf = film.magSf();
84 
85  const scalarField& delta = film.delta();
86  const scalarField& rho = film.rho();
87  const scalarField& sigma = film.sigma();
88  const scalar magg = mag(film.g().value());
89 
90  forAll(delta, celli)
91  {
92  bool dripping = false;
93 
94  if (sinAlpha[celli] > SMALL && delta[celli] > deltaStable_)
95  {
96  const scalar rhoc = rho[celli];
97  const scalar lc = sqrt(sigma[celli]/(rhoc*magg));
98  const scalar deltaStable = max
99  (
100  3*lc*sqrt(1 - sqr(sinAlpha[celli]))
101  /(ubarStar_*sqrt(sinAlpha[celli])*sinAlpha[celli]),
102  deltaStable_
103  );
104 
105  if (delta[celli] > deltaStable)
106  {
107  const scalar ddelta = max(delta[celli] - deltaStable, 0);
108 
109  const scalar massDrip =
110  min(availableMass[celli], max(ddelta*rhoc*magSf[celli], 0));
111 
112  if (massDrip > 0)
113  {
114  const scalar diam = dCoeff_*lc;
115  diameter_[celli] = diam;
116 
117  massToInject[celli] += massDrip;
118  availableMass[celli] -= massDrip;
119 
120  diameterToInject[celli] = diam;
121  addToInjectedMass(massDrip);
122 
123  dripping = true;
124  }
125  }
126  }
127 
128  if (!dripping)
129  {
130  diameterToInject[celli] = 0;
131  massToInject[celli] = 0;
132  }
133  }
134 
136 }
137 
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 } // End namespace surfaceFilmModels
142 } // End namespace regionModels
143 } // End namespace Foam
144 
145 // ************************************************************************* //
Foam::regionModels::surfaceFilmModels::injectionModel::correct
void correct()
Correct.
Definition: injectionModel.C:81
Foam::tmp< volScalarField >
BrunDrippingInjection.H
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer
Kinematic form of single-cell layer surface film model.
Definition: kinematicSingleLayer.H:66
Foam::dimensioned::value
const Type & value() const
Return const reference to value.
Definition: dimensionedType.C:404
Foam::regionModels::surfaceFilmModels::addToRunTimeSelectionTable
addToRunTimeSelectionTable(surfaceFilmRegionModel, kinematicSingleLayer, mesh)
rho
rho
Definition: readInitialConditions.H:96
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:290
Foam::primitiveMesh::nCells
label nCells() const
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:211
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:222
Foam::regionModels::regionModel::regionMesh
const fvMesh & regionMesh() const
Return the region mesh database.
Definition: regionModelI.H:63
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:121
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:79
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:85
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:1011
Foam::regionModels::surfaceFilmModels::BrunDrippingInjection::~BrunDrippingInjection
virtual ~BrunDrippingInjection()
Destructor.
Definition: BrunDrippingInjection.C:64