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 \*---------------------------------------------------------------------------*/
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 template <class CloudType>
31 Foam::TAB<CloudType>::TAB
33 const dictionary& dict,
37 BreakupModel<CloudType>(dict, owner, typeName),
38 Cmu_(BreakupModel<CloudType>::TABCmu_),
39 Comega_(BreakupModel<CloudType>::TABComega_),
40 WeCrit_(BreakupModel<CloudType>::TABWeCrit_),
41 SMDCalcMethod_(this->coeffDict().lookup("SMDCalculationMethod"))
43 // calculate the inverse function of the Rossin-Rammler Distribution
44 const scalar xx0 = 12.0;
46 1.0/(1.0-exp(-xx0)*(1.0 + xx0 + sqr(xx0)/2.0 + pow3(xx0)/6.0));
50 scalar xx = 0.12*(n + 1);
52 (1.0 - exp(-xx)*(1.0 + xx + sqr(xx)/2.0 + pow3(xx)/6.0))*rrd100;
55 if (!BreakupModel<CloudType>::solveOscillationEq_)
57 Info<< "Warning: solveOscillationEq is set to "
58 << BreakupModel<CloudType>::solveOscillationEq_ << nl
59 << " Setting it to true in order for the TAB model to work."
61 BreakupModel<CloudType>::solveOscillationEq_ = true;
64 if (SMDCalcMethod_ == "method1")
68 else if (SMDCalcMethod_ == "method2")
75 Info<< "Warning: SMDCalculationMethod unknown. Options are "
76 "(method1 | method2). Using method2" << endl;
81 template <class CloudType>
82 Foam::TAB<CloudType>::TAB(const TAB<CloudType>& bum)
84 BreakupModel<CloudType>(bum),
88 SMDCalcMethod_(bum.SMDCalcMethod_)
92 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
94 template <class CloudType>
95 Foam::TAB<CloudType>::~TAB()
99 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
101 template<class CloudType>
102 bool Foam::TAB<CloudType>::update
123 const scalar averageParcelMass,
133 scalar semiMass = nParticle*pow3(d);
135 // inverse of characteristic viscous damping time
136 scalar rtd = 0.5*Cmu_*mu/(rho*r2);
138 // oscillation frequency (squared)
139 scalar omega2 = Comega_*sigma/(rho*r3) - rtd*rtd;
143 scalar omega = sqrt(omega2);
144 scalar We = rhoc*sqr(Urmag)*r/sigma;
145 scalar Wetmp = We/WeCrit_;
147 scalar y1 = y - Wetmp;
148 scalar y2 = yDot/omega;
150 scalar a = sqrt(y1*y1 + y2*y2);
152 // scotty we may have break-up
157 // constrain phic within -1 to 1
158 phic = max(min(phic, 1), -1);
160 scalar phit = acos(phic);
165 phi = 2.0*constant::mathematical::pi - phit;
173 if ((Wetmp - a < -1) && (yDot < 0))
178 scalar theta = acos((coste-Wetmp)/a);
182 if (2*constant::mathematical::pi-theta >= phi)
186 theta += 2*constant::mathematical::pi;
188 tb = (theta-phi)/omega;
194 yDot = -a*omega*sin(omega*tb + phi);
199 // update droplet size
203 r/(1.0 + (4.0/3.0)*sqr(y) + rho*r3/(8*sigma)*sqr(yDot));
211 #include "TABSMDCalcMethod1.H"
216 #include "TABSMDCalcMethod2.H"
232 // reset droplet distortion parameters
237 // update the nParticle count to conserve mass
238 nParticle = semiMass/pow3(d);
240 // Do not add child parcel
245 // ************************************************************************* //