dripping.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) 2011-2024 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 "dripping.H"
28 
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 namespace filmEjectionModels
34 {
35 
36 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
37 
40 
41 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42 
44 (
45  const dictionary& dict,
46  const solvers::isothermalFilm& film
47 )
48 :
49  ejectionModel(dict, film),
50  deltaStable_
51  (
52  dict.optionalSubDict(typeName + "Coeffs")
53  .lookup<scalar>("deltaStable")
54  ),
55  minParticlesPerParcel_
56  (
57  dict.optionalSubDict(typeName + "Coeffs")
58  .lookupOrDefault("minParticlesPerParcel", 1)
59  ),
60  parcelDistribution_
61  (
63  (
64  dimLength,
65  dict.optionalSubDict(typeName + "Coeffs")
66  .subDict("parcelDistribution"),
67  0,
68  0
69  )
70  )
71 {}
72 
73 
74 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
75 
77 {}
78 
79 
80 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
81 
83 {
84  const scalar piBy6 = constant::mathematical::pi/6;
85 
86  const scalarField gnHat(film_.nHat() & (-film_.g));
87  const scalarField& magSf = film_.magSf;
88 
89  const scalarField& delta = film_.delta;
90  const scalarField& rho = film_.rho;
91 
92  const scalar deltaT = film_.mesh.time().deltaTValue();
93 
94  forAll(delta, celli)
95  {
96  rate_[celli] = 0;
97  diameter_[celli] = 0;
98 
99  // Calculate available dripping mass
100  if (gnHat[celli] > small && delta[celli] > deltaStable_)
101  {
102  const scalar ddelta = delta[celli] - deltaStable_;
103  const scalar massDrip = ddelta*rho[celli]*magSf[celli];
104 
105  // Sample dripped droplet diameter
106  diameter_[celli] = parcelDistribution_->sample();
107 
108  // Calculate the minimum mass of a parcel
109  const scalar minMass =
110  minParticlesPerParcel_
111  *rho[celli]*piBy6*pow3(diameter_[celli]);
112 
113  if (massDrip > minMass)
114  {
115  // Calculate rate of dripping
116  rate_[celli] = ddelta/(deltaT*delta[celli]);
117  }
118  }
119  }
120 }
121 
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 } // End namespace filmEjectionModels
126 } // End namespace Foam
127 
128 // ************************************************************************* //
scalar delta
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
Macros for easy insertion into run-time selection tables.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Base class for statistical distributions.
Definition: distribution.H:76
Dripping film to cloud ejection transfer model.
Definition: dripping.H:88
virtual ~dripping()
Destructor.
Definition: dripping.C:76
virtual void correct()
Correct.
Definition: dripping.C:82
dripping(const dictionary &dict, const solvers::isothermalFilm &film)
Construct from dictionary and film model.
Definition: dripping.C:44
Solver module for flow of compressible isothermal liquid films.
addToRunTimeSelectionTable(ejectionModel, BrunDripping, dictionary)
defineTypeNameAndDebug(BrunDripping, 0)
Namespace for OpenFOAM.
dimensionedScalar pow3(const dimensionedScalar &ds)
const dimensionSet dimLength
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
dictionary dict