1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
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 \*---------------------------------------------------------------------------*/
26 #include "ORourkeCollision.H"
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 template <class CloudType>
31 Foam::ORourkeCollision<CloudType>::ORourkeCollision
33 const dictionary& dict,
37 StochasticCollisionModel<CloudType>(dict, owner, typeName),
38 coalescence_(this->coeffDict().lookup("coalescence"))
42 template <class CloudType>
43 Foam::ORourkeCollision<CloudType>::ORourkeCollision
45 const ORourkeCollision<CloudType>& cm
48 StochasticCollisionModel<CloudType>(cm),
49 coalescence_(cm.coalescence_)
53 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
55 template <class CloudType>
56 Foam::ORourkeCollision<CloudType>::~ORourkeCollision()
60 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
62 template<class CloudType>
63 bool Foam::ORourkeCollision<CloudType>::update
91 // check if parcels belong to same cell
92 if ((celli != cellj) || (m1 < VSMALL) || (m2 < VSMALL))
97 bool coalescence = false;
99 scalar magVrel = mag(U1-U2);
100 scalar sumD = d1 + d2;
101 scalar nu0 = 0.25*constant::mathematical::pi*sumD*sumD*magVrel*dt/volj;
102 scalar nMin = min(N1, N2);
103 scalar nu = nMin*nu0;
104 scalar collProb = exp(-nu);
105 scalar xx = rndGen.sample01<scalar>();
112 coalescence = collideSorted
142 coalescence = collideSorted
175 template<class CloudType>
176 bool Foam::ORourkeCollision<CloudType>::collideSorted
179 cachedRandom& rndGen,
204 bool coalescence = false;
206 vector vRel = U1 - U2;
207 scalar magVRel = mag(vRel);
209 scalar mdMin = m2/N2;
211 scalar mTot = m1 + m2;
213 scalar gamma = d1/max(d2, 1.0e-12);
214 scalar f = gamma*gamma*gamma + 2.7*gamma - 2.4*gamma*gamma;
216 vector momMax = m1*U1;
217 vector momMin = m2*U2;
219 // use mass-averaged temperature to calculate We number
220 scalar Tm = (T1*m1 + T2*m2)/mTot;
222 // interpolate the averaged surface tension
223 scalar sigma = sigma1 + (sigma2 - sigma1)*(Tm - T1)/(T2 - T1);
225 sigma = max(1.0e-6, sigma);
226 scalar Vtot = m1/rho1 + m2/rho2;
227 scalar rho = mTot/Vtot;
229 scalar dMean = sqrt(d1*d2);
230 scalar WeColl = max(1.0e-12, 0.5*rho*magVRel*magVRel*dMean/sigma);
232 scalar coalesceProb = min(1.0, 2.4*f/WeColl);
234 scalar prob = rndGen.sample01<scalar>();
237 if (prob < coalesceProb && coalescence_)
240 // How 'many' of the droplets coalesce
241 scalar nProb = prob*N2/N1;
243 // Conservation of mass, momentum and energy
245 scalar dm = N1*nProb*mdMin;
247 scalar V2 = constant::mathematical::pi*pow3(d2)/6.0;
252 T1 = (Tm*mTot - m2*T2)/m1;
254 U1 =(momMax + (1.0 - m2/m2Org)*momMin)/m1;
256 // update the liquid mass fractions
257 Y1 = (m1Org*Y1 + dm*Y2)/m1;
259 // Grazing collision (no coalescence)
262 scalar gf = sqrt(prob) - sqrt(coalesceProb);
263 scalar denom = 1.0 - sqrt(coalesceProb);
270 // if gf negative, this means that coalescence is turned off
271 // and these parcels should have coalesced
274 // gf -> 1 => v1p -> p1().U() ...
275 // gf -> 0 => v1p -> momentum/(m1+m2)
277 vector mr = m1*U1 + m2*U2;
278 vector v1p = (mr + m2*gf*vRel)/(m1+m2);
279 vector v2p = (mr - m1*gf*vRel)/(m1+m2);
284 U2 = (N1*v2p + (N2-N1)*U2)/N2;
288 U1 = (N2*v1p + (N1-N2)*U1)/N1;
298 // ************************************************************************* //