FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

SHF.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #include "SHF.H"
00027 #include <OpenFOAM/addToRunTimeSelectionTable.H>
00028 #include <OpenFOAM/mathematicalConstants.H>
00029 
00030 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00031 
00032 namespace Foam
00033 {
00034 
00035 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00036 
00037 defineTypeNameAndDebug(SHF, 0);
00038 
00039 addToRunTimeSelectionTable
00040 (
00041     breakupModel,
00042     SHF,
00043     dictionary
00044 );
00045 
00046 
00047 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00048 
00049 // Construct from components
00050 SHF::SHF
00051 (
00052     const dictionary& dict,
00053     spray& sm
00054 )
00055 :
00056     breakupModel(dict, sm),
00057     coeffsDict_(dict.subDict(typeName + "Coeffs")),
00058     g_(sm.g()),
00059     rndGen_(sm.rndGen()),
00060     weCorrCoeff_(readScalar(coeffsDict_.lookup("weCorrCoeff"))),
00061     weBuCrit_(readScalar(coeffsDict_.lookup("weBuCrit"))),
00062     weBuBag_(readScalar(coeffsDict_.lookup("weBuBag"))),
00063     weBuMM_(readScalar(coeffsDict_.lookup("weBuMM"))),
00064     ohnCoeffCrit_(readScalar(coeffsDict_.lookup("ohnCoeffCrit"))),
00065     ohnCoeffBag_(readScalar(coeffsDict_.lookup("ohnCoeffBag"))),
00066     ohnCoeffMM_(readScalar(coeffsDict_.lookup("ohnCoeffMM"))),
00067     ohnExpCrit_(readScalar(coeffsDict_.lookup("ohnExpCrit"))),
00068     ohnExpBag_(readScalar(coeffsDict_.lookup("ohnExpBag"))),
00069     ohnExpMM_(readScalar(coeffsDict_.lookup("ohnExpMM"))),
00070     cInit_(readScalar(coeffsDict_.lookup("Cinit"))),
00071     c1_(readScalar(coeffsDict_.lookup("C1"))),
00072     c2_(readScalar(coeffsDict_.lookup("C2"))),
00073     c3_(readScalar(coeffsDict_.lookup("C3"))),
00074     cExp1_(readScalar(coeffsDict_.lookup("Cexp1"))),
00075     cExp2_(readScalar(coeffsDict_.lookup("Cexp2"))),
00076     cExp3_(readScalar(coeffsDict_.lookup("Cexp3"))),
00077     weConst_(readScalar(coeffsDict_.lookup("Weconst"))),
00078     weCrit1_(readScalar(coeffsDict_.lookup("Wecrit1"))),
00079     weCrit2_(readScalar(coeffsDict_.lookup("Wecrit2"))),
00080     coeffD_(readScalar(coeffsDict_.lookup("CoeffD"))),
00081     onExpD_(readScalar(coeffsDict_.lookup("OnExpD"))),
00082     weExpD_(readScalar(coeffsDict_.lookup("WeExpD"))),
00083     mu_(readScalar(coeffsDict_.lookup("mu"))),
00084     sigma_(readScalar(coeffsDict_.lookup("sigma"))),
00085     d32Coeff_(readScalar(coeffsDict_.lookup("d32Coeff"))),
00086     cDmaxBM_(readScalar(coeffsDict_.lookup("cDmaxBM"))),
00087     cDmaxS_(readScalar(coeffsDict_.lookup("cDmaxS"))),
00088     corePerc_(readScalar(coeffsDict_.lookup("corePerc")))
00089 {}
00090 
00091 
00092 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00093 
00094 SHF::~SHF()
00095 {}
00096 
00097 
00098 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00099 
00100 void SHF::breakupParcel
00101 (
00102     parcel& p,
00103     const scalar deltaT,
00104     const vector& vel,
00105     const liquidMixture& fuels
00106 ) const
00107 {
00108 
00109     label celli = p.cell();
00110     scalar T = p.T();
00111     scalar pc = spray_.p()[celli];
00112 
00113     scalar sigma = fuels.sigma(pc, T, p.X());
00114     scalar rhoLiquid = fuels.rho(pc, T, p.X());
00115     scalar muLiquid = fuels.mu(pc, T, p.X());
00116     scalar rhoGas = spray_.rho()[celli];
00117 
00118     scalar weGas      = p.We(vel, rhoGas, sigma);
00119     scalar weLiquid   = p.We(vel, rhoLiquid, sigma);
00120 
00121     // correct the Reynolds number. Reitz is using radius instead of diameter
00122 
00123     scalar reLiquid   = p.Re(rhoLiquid, vel, muLiquid);
00124     scalar ohnesorge  = sqrt(weLiquid)/(reLiquid + VSMALL);
00125 
00126     vector acceleration = p.Urel(vel)/p.tMom();
00127     vector trajectory = p.U()/mag(p.U());
00128 
00129     vector vRel = p.Urel(vel);
00130 
00131     scalar weGasCorr = weGas/(1.0 + weCorrCoeff_ * ohnesorge);
00132 
00133     // droplet deformation characteristic time
00134 
00135     scalar tChar = p.d()/mag(vRel)*sqrt(rhoLiquid/rhoGas);
00136 
00137     scalar tFirst = cInit_ * tChar;
00138 
00139     scalar tSecond = 0;
00140     scalar tCharSecond = 0;
00141 
00142     bool bag = false;
00143     bool multimode = false;
00144     bool shear = false;
00145     bool success = false;
00146 
00147 
00148     //  updating the droplet characteristic time
00149     p.ct() += deltaT;
00150 
00151     if(weGas > weConst_)
00152     {
00153         if(weGas < weCrit1_)
00154         {
00155             tCharSecond = c1_*pow((weGas - weConst_),cExp1_);
00156         }
00157         else if(weGas >= weCrit1_ && weGas <= weCrit2_)
00158         {
00159             tCharSecond = c2_*pow((weGas - weConst_),cExp2_);
00160         }
00161         else
00162         {
00163             tCharSecond = c3_*pow((weGas - weConst_),cExp3_);
00164         }
00165     }
00166 
00167     scalar weC = weBuCrit_*(1.0+ohnCoeffCrit_*pow(ohnesorge,ohnExpCrit_));
00168     scalar weB = weBuBag_*(1.0+ohnCoeffBag_*pow(ohnesorge, ohnExpBag_));
00169     scalar weMM = weBuMM_*(1.0+ohnCoeffMM_*pow(ohnesorge, ohnExpMM_));
00170 
00171     if(weGas > weC && weGas < weB)
00172     {
00173         bag = true;
00174     }
00175 
00176     if(weGas >= weB && weGas <= weMM)
00177     {
00178         multimode = true;
00179     }
00180 
00181     if(weGas > weMM)
00182     {
00183         shear = true;
00184     }
00185 
00186     tSecond = tCharSecond * tChar;
00187 
00188     scalar tBreakUP = tFirst + tSecond;
00189     if(p.ct() > tBreakUP)
00190     {
00191 
00192         scalar d32 = coeffD_*p.d()*pow(ohnesorge,onExpD_)*pow(weGasCorr,weExpD_);
00193 
00194         if(bag || multimode)
00195         {
00196 
00197             scalar d05 = d32Coeff_ * d32;
00198 
00199             scalar x = 0.0;
00200             scalar y = 0.0;
00201             scalar d = 0.0;
00202 
00203             while(!success)
00204             {
00205                 x = cDmaxBM_*rndGen_.scalar01();
00206                 d = sqr(x)*d05;
00207                 y = rndGen_.scalar01();
00208 
00209                 scalar p = x/(2.0*sqrt(2.0*mathematicalConstant::pi)*sigma_)*exp(-0.5*sqr((x-mu_)/sigma_));
00210 
00211                 if (y<p)
00212                 {
00213                     success = true;
00214                 }
00215             }
00216 
00217             p.d() = d;
00218             p.ct() = 0.0;
00219         }
00220 
00221         if(shear)
00222         {
00223             scalar dC = weConst_*sigma/(rhoGas*sqr(mag(vRel)));
00224             scalar d32Red = 4.0*(d32 * dC)/(5.0 * dC - d32);
00225             scalar initMass = p.m();
00226 
00227             scalar d05 = d32Coeff_ * d32Red;
00228 
00229             scalar x = 0.0;
00230             scalar y = 0.0;
00231             scalar d = 0.0;
00232 
00233             while(!success)
00234             {
00235 
00236                 x = cDmaxS_*rndGen_.scalar01();
00237                 d = sqr(x)*d05;
00238                 y = rndGen_.scalar01();
00239 
00240                 scalar p = x/(2.0*sqrt(2.0*mathematicalConstant::pi)*sigma_)*exp(-0.5*sqr((x-mu_)/sigma_));
00241 
00242                 if (y<p)
00243                 {
00244                     success = true;
00245                 }
00246             }
00247 
00248             p.d() = dC;
00249             p.m() = corePerc_ * initMass;
00250 
00251             spray_.addParticle
00252             (
00253                 new parcel
00254                 (
00255                     spray_,
00256                     p.position(),
00257                     p.cell(),
00258                     p.n(),
00259                     d,
00260                     p.T(),
00261                     (1.0 - corePerc_)* initMass,
00262                     0.0,
00263                     0.0,
00264                     0.0,
00265                     -GREAT,
00266                     p.tTurb(),
00267                     0.0,
00268                     scalar(p.injector()),
00269                     p.U(),
00270                     p.Uturb(),
00271                     p.X(),
00272                     p.fuelNames()
00273                 )
00274             );
00275 
00276             p.ct() = 0.0;
00277         }
00278     }
00279 }
00280 
00281 
00282 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00283 
00284 } // End namespace Foam
00285 
00286 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines