1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
24 \*---------------------------------------------------------------------------*/
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 template <class CloudType>
31 Foam::SHF<CloudType>::SHF
33 const dictionary& dict,
37 BreakupModel<CloudType>(dict, owner, typeName),
38 weCorrCoeff_(readScalar(this->coeffDict().lookup("weCorrCoeff"))),
39 weBuCrit_(readScalar(this->coeffDict().lookup("weBuCrit"))),
40 weBuBag_(readScalar(this->coeffDict().lookup("weBuBag"))),
41 weBuMM_(readScalar(this->coeffDict().lookup("weBuMM"))),
42 ohnCoeffCrit_(readScalar(this->coeffDict().lookup("ohnCoeffCrit"))),
43 ohnCoeffBag_(readScalar(this->coeffDict().lookup("ohnCoeffBag"))),
44 ohnCoeffMM_(readScalar(this->coeffDict().lookup("ohnCoeffMM"))),
45 ohnExpCrit_(readScalar(this->coeffDict().lookup("ohnExpCrit"))),
46 ohnExpBag_(readScalar(this->coeffDict().lookup("ohnExpBag"))),
47 ohnExpMM_(readScalar(this->coeffDict().lookup("ohnExpMM"))),
48 cInit_(readScalar(this->coeffDict().lookup("Cinit"))),
49 c1_(readScalar(this->coeffDict().lookup("C1"))),
50 c2_(readScalar(this->coeffDict().lookup("C2"))),
51 c3_(readScalar(this->coeffDict().lookup("C3"))),
52 cExp1_(readScalar(this->coeffDict().lookup("Cexp1"))),
53 cExp2_(readScalar(this->coeffDict().lookup("Cexp2"))),
54 cExp3_(readScalar(this->coeffDict().lookup("Cexp3"))),
55 weConst_(readScalar(this->coeffDict().lookup("Weconst"))),
56 weCrit1_(readScalar(this->coeffDict().lookup("Wecrit1"))),
57 weCrit2_(readScalar(this->coeffDict().lookup("Wecrit2"))),
58 coeffD_(readScalar(this->coeffDict().lookup("CoeffD"))),
59 onExpD_(readScalar(this->coeffDict().lookup("OnExpD"))),
60 weExpD_(readScalar(this->coeffDict().lookup("WeExpD"))),
61 mu_(readScalar(this->coeffDict().lookup("mu"))),
62 sigma_(readScalar(this->coeffDict().lookup("sigma"))),
63 d32Coeff_(readScalar(this->coeffDict().lookup("d32Coeff"))),
64 cDmaxBM_(readScalar(this->coeffDict().lookup("cDmaxBM"))),
65 cDmaxS_(readScalar(this->coeffDict().lookup("cDmaxS"))),
66 corePerc_(readScalar(this->coeffDict().lookup("corePerc")))
70 template <class CloudType>
71 Foam::SHF<CloudType>::SHF(const SHF<CloudType>& bum)
73 BreakupModel<CloudType>(bum),
74 weCorrCoeff_(bum.weCorrCoeff_),
75 weBuCrit_(bum.weBuCrit_),
76 weBuBag_(bum.weBuBag_),
78 ohnCoeffCrit_(bum.ohnCoeffCrit_),
79 ohnCoeffBag_(bum.ohnCoeffBag_),
80 ohnCoeffMM_(bum.ohnCoeffMM_),
81 ohnExpCrit_(bum.ohnExpCrit_),
82 ohnExpBag_(bum.ohnExpBag_),
83 ohnExpMM_(bum.ohnExpMM_),
91 weConst_(bum.weConst_),
92 weCrit1_(bum.weCrit1_),
93 weCrit2_(bum.weCrit2_),
99 d32Coeff_(bum.d32Coeff_),
100 cDmaxBM_(bum.cDmaxBM_),
101 cDmaxS_(bum.cDmaxS_),
102 corePerc_(bum.corePerc_)
106 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
108 template <class CloudType>
109 Foam::SHF<CloudType>::~SHF()
113 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
115 template<class CloudType>
116 bool Foam::SHF<CloudType>::update
137 const scalar averageParcelMass,
143 bool addChild = false;
145 scalar d03 = pow3(d);
146 scalar rhopi6 = rho*constant::mathematical::pi/6.0;
147 scalar mass0 = nParticle*rhopi6*d03;
150 scalar weGas = 0.5*rhoc*sqr(Urmag)*d/sigma;
151 scalar weLiquid = 0.5*rho*sqr(Urmag)*d/sigma;
153 // correct the Reynolds number. Reitz is using radius instead of diameter
154 scalar reLiquid = 0.5*Urmag*d/mu;
155 scalar ohnesorge = sqrt(weLiquid)/(reLiquid + VSMALL);
157 scalar weGasCorr = weGas/(1.0 + weCorrCoeff_*ohnesorge);
159 // droplet deformation characteristic time
161 scalar tChar = d/Urmag*sqrt(rho/rhoc);
163 scalar tFirst = cInit_*tChar;
166 scalar tCharSecond = 0;
169 bool multimode = false;
171 bool success = false;
174 // update the droplet characteristic time
177 if (weGas > weConst_)
181 tCharSecond = c1_*pow((weGas - weConst_), cExp1_);
183 else if(weGas >= weCrit1_ && weGas <= weCrit2_)
185 tCharSecond = c2_*pow((weGas - weConst_), cExp2_);
189 tCharSecond = c3_*pow((weGas - weConst_), cExp3_);
193 scalar weC = weBuCrit_*(1.0 + ohnCoeffCrit_*pow(ohnesorge, ohnExpCrit_));
194 scalar weB = weBuBag_*(1.0 + ohnCoeffBag_*pow(ohnesorge, ohnExpBag_));
195 scalar weMM = weBuMM_*(1.0 + ohnCoeffMM_*pow(ohnesorge, ohnExpMM_));
197 if (weGas > weC && weGas < weB)
202 if (weGas >= weB && weGas <= weMM)
212 tSecond = tCharSecond*tChar;
214 scalar tBreakUP = tFirst + tSecond;
217 scalar d32 = coeffD_*d*pow(ohnesorge, onExpD_)*pow(weGasCorr, weExpD_);
219 if (bag || multimode)
221 scalar d05 = d32Coeff_ * d32;
229 x = cDmaxBM_*rndGen.sample01<scalar>();
231 yGuess = rndGen.sample01<scalar>();
235 /(2.0*sqrt(2.0*constant::mathematical::pi)*sigma_)
236 *exp(-0.5*sqr((x - mu_)/sigma_));
250 scalar dC = weConst_*sigma/(rhoc*sqr(Urmag));
251 scalar d32Red = 4.0*(d32*dC)/(5.0*dC - d32);
253 scalar d05 = d32Coeff_ * d32Red;
261 x = cDmaxS_*rndGen.sample01<scalar>();
263 yGuess = rndGen.sample01<scalar>();
267 /(2.0*sqrt(2.0*constant::mathematical::pi)*sigma_)
268 *exp(-0.5*sqr((x - mu_)/sigma_));
278 massChild = corePerc_*mass0;
286 // correct nParticle to conserve mass
287 nParticle = mass/(rhopi6*pow3(d));
294 // ************************************************************************* //