OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

LISA.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-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 \*---------------------------------------------------------------------------*/
00026 
00027 #include "error.H"
00028 
00029 #include "LISA.H"
00030 #include "addToRunTimeSelectionTable.H"
00031 #include "basicMultiComponentMixture.H"
00032 
00033 #include "RosinRammler.H"
00034 
00035 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00036 
00037 namespace Foam
00038 {
00039 
00040 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00041 
00042 defineTypeNameAndDebug(LISA, 0);
00043 
00044 addToRunTimeSelectionTable
00045 (
00046     atomizationModel,
00047     LISA,
00048     dictionary
00049 );
00050 
00051 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00052 
00053 // Construct from components
00054 LISA::LISA
00055 (
00056     const dictionary& dict,
00057     spray& sm
00058 )
00059 :
00060     atomizationModel(dict, sm),
00061     coeffsDict_(dict.subDict(typeName+"Coeffs")),
00062     rndGen_(sm.rndGen()),
00063     Cl_(readScalar(coeffsDict_.lookup("Cl"))),
00064     cTau_(readScalar(coeffsDict_.lookup("cTau"))),
00065     Q_(readScalar(coeffsDict_.lookup("Q"))),
00066     J_(readScalar(coeffsDict_.lookup("J")))
00067 {}
00068 
00069 
00070 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00071 
00072 LISA::~LISA()
00073 {}
00074 
00075 
00076 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00077 
00078 void LISA::atomizeParcel
00079 (
00080     parcel& p,
00081     const scalar deltaT,
00082     const vector& vel,
00083     const liquidMixture& fuels
00084 ) const
00085 {
00086 
00087 
00088     const PtrList<volScalarField>& Y = spray_.composition().Y();
00089 
00090     label Ns = Y.size();
00091     label cellI = p.cell();
00092     scalar pressure = spray_.p()[cellI];
00093     scalar temperature = spray_.T()[cellI];
00094     scalar Taverage = p.T() + (temperature - p.T())/3.0;
00095     scalar Winv = 0.0;
00096 
00097     for(label i=0; i<Ns; i++)
00098     {
00099         Winv += Y[i][cellI]/spray_.gasProperties()[i].W();
00100     }
00101 
00102     scalar R = specie::RR*Winv;
00103 
00104     // ideal gas law to evaluate density
00105     scalar rhoAverage = pressure/R/Taverage;
00106     //scalar nuAverage = muAverage/rhoAverage;
00107     scalar sigma = fuels.sigma(pressure, p.T(), p.X());
00108 
00109     // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00110     //     The We and Re numbers are to be evaluated using the 1/3 rule.
00111     // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00112 
00113     scalar WeberNumber = p.We(vel, rhoAverage, sigma);
00114 
00115     scalar tau = 0.0;
00116     scalar dL = 0.0;
00117     scalar k = 0.0;
00118     scalar muFuel = fuels.mu(pressure, p.T(), p.X());
00119     scalar rhoFuel = fuels.rho(1.0e+5, p.T(), p.X());
00120     scalar nuFuel = muFuel/rhoFuel;
00121 
00122     vector uDir = p.U()/mag(p.U());
00123 
00124     scalar uGas = mag(vel & uDir);
00125     vector Ug = uGas*uDir;
00126 
00127 /*
00128     TL
00129     It might be the relative velocity between Liquid and Gas, but I use the
00130     absolute velocity of the parcel as suggested by the authors
00131 */
00132 
00133 //    scalar U = mag(p.Urel(vel));
00134     scalar U = mag(p.U());
00135 
00136     p.ct() += deltaT;
00137 
00138     scalar Q = rhoAverage/rhoFuel;
00139 
00140     const injectorType& it =
00141         spray_.injectors()[label(p.injector())].properties();
00142 
00143     if (it.nHoles() > 1)
00144     {
00145         Info << "Warning: This atomization model is not suitable for multihole injector." << endl
00146              << "Only the first hole will be used." << endl;
00147     }
00148 
00149     const vector itPosition = it.position(0);
00150     scalar pWalk = mag(p.position() - itPosition);
00151 
00152 //  Updating liquid sheet tickness... that is the droplet diameter
00153 
00154     const vector direction = it.direction(0, spray_.runTime().value());
00155 
00156     scalar h = (p.position() - itPosition) & direction;
00157 
00158     scalar d = sqrt(sqr(pWalk)-sqr(h));
00159 
00160     scalar time = pWalk/mag(p.U());
00161 
00162     scalar elapsedTime = spray_.runTime().value();
00163 
00164     scalar massFlow = it.massFlowRate(max(0.0,elapsedTime-time));
00165 
00166     scalar hSheet = massFlow/(mathematicalConstant::pi*d*rhoFuel*mag(p.U()));
00167 
00168     p.d() = min(hSheet,p.d());
00169 
00170     if(WeberNumber > 27.0/16.0)
00171     {
00172 
00173         scalar kPos = 0.0;
00174         scalar kNeg = Q*pow(U, 2.0)*rhoFuel/sigma;
00175 
00176         scalar derivativePos = sqrt
00177         (
00178             Q*pow(U,2.0)
00179         );
00180 
00181         scalar derivativeNeg =
00182         (
00183             8.0*pow(nuFuel, 2.0)*pow(kNeg, 3.0)
00184             + Q*pow(U, 2.0)*kNeg
00185             - 3.0*sigma/2.0/rhoFuel*pow(kNeg, 2.0)
00186         )
00187         /
00188         sqrt
00189         (
00190             4.0*pow(nuFuel, 2.0)*pow(kNeg, 4.0)
00191             + Q*pow(U, 2.0)*pow(kNeg, 2.0)
00192             - sigma*pow(kNeg, 3.0)/rhoFuel
00193         )
00194         -
00195         4.0*nuFuel*kNeg;
00196 
00197         scalar kOld = 0.0;
00198 
00199 
00200         for(label i=0; i<40; i++)
00201         {
00202 
00203             k = kPos - (derivativePos/((derivativeNeg-derivativePos)/(kNeg-kPos)));
00204 
00205             scalar derivativek =
00206             (
00207                 8.0*pow(nuFuel, 2.0)*pow(k, 3.0)
00208                 + Q*pow(U, 2.0)*k
00209                 - 3.0*sigma/2.0/rhoFuel*pow(k, 2.0)
00210             )
00211             /
00212             sqrt
00213             (
00214                 4.0*pow(nuFuel, 2.0)*pow(k, 4.0)
00215                 + Q*pow(U, 2.0)*pow(k, 2.0)
00216                 - sigma*pow(k, 3.0)/rhoFuel
00217             )
00218             -
00219             4.0*nuFuel*k;
00220 
00221             if(derivativek > 0)
00222             {
00223                 derivativePos = derivativek;
00224                 kPos = k;
00225             }
00226             else
00227             {
00228                 derivativeNeg = derivativek;
00229                 kNeg = k;
00230             }
00231 
00232             if(mag(k-kOld)/k < 1e-4)
00233             {
00234                 break;
00235             }
00236 
00237             kOld = k;
00238 
00239         }
00240 
00241         scalar omegaS =
00242         - 2.0 * nuFuel * pow(k, 2.0)
00243         + sqrt
00244         (
00245                 4.0*pow(nuFuel, 2.0)*pow(k, 4.0)
00246             +   Q*pow(U, 2.0)*pow(k, 2.0)
00247             -   sigma*pow(k, 3.0)/rhoFuel
00248         );
00249 
00250         tau = cTau_/omegaS;
00251 
00252         dL = sqrt(8.0*p.d()/k);
00253 
00254     }
00255     else
00256     {
00257 
00258         k =
00259         rhoAverage*pow(U, 2.0)
00260         /
00261         2.0*sigma;
00262 
00263         scalar J = pWalk*p.d()/2.0;
00264 
00265         tau = pow(3.0*cTau_,2.0/3.0)*cbrt(J*sigma/(sqr(Q)*pow(U,4.0)*rhoFuel));
00266 
00267         dL = sqrt(4.0*p.d()/k);
00268     }
00269 
00270 
00271 
00272     scalar kL =
00273         1.0
00274         /
00275         (
00276             dL *
00277             pow(0.5 + 1.5 * muFuel/pow((rhoFuel*sigma*dL), 0.5), 0.5)
00278         );
00279 
00280     scalar dD = cbrt(3.0*mathematicalConstant::pi*pow(dL, 2.0)/kL);
00281 
00282     scalar lisaExp = 0.27;
00283     scalar ambientPressure = 1.0e+5;
00284 
00285     scalar pRatio = spray_.ambientPressure()/ambientPressure;
00286 
00287     dD = dD*pow(pRatio,lisaExp);
00288 
00289 //  modifications to take account of the flash boiling on primary breakUp
00290 
00291     scalar pExp = 0.135;
00292 
00293     scalar chi = 0.0;
00294 
00295     label Nf = fuels.components().size();
00296 
00297     scalar Td = p.T();
00298 
00299     for(label i = 0; i < Nf ; i++)
00300     {
00301 
00302         if(fuels.properties()[i].pv(spray_.ambientPressure(), Td) >= 0.999*spray_.ambientPressure())
00303         {
00304 
00305 //          The fuel is boiling.....
00306 //          Calculation of the boiling temperature
00307 
00308             scalar tBoilingSurface = Td;
00309 
00310             label Niter = 200;
00311 
00312             for(label k=0; k< Niter ; k++)
00313             {
00314                 scalar pBoil = fuels.properties()[i].pv(pressure, tBoilingSurface);
00315 
00316                 if(pBoil > pressure)
00317                 {
00318                     tBoilingSurface = tBoilingSurface - (Td-temperature)/Niter;
00319                 }
00320                 else
00321                 {
00322                     break;
00323                 }
00324             }
00325 
00326             scalar hl = fuels.properties()[i].hl(spray_.ambientPressure(), tBoilingSurface);
00327             scalar iTp = fuels.properties()[i].h(spray_.ambientPressure(), Td) - spray_.ambientPressure()/fuels.properties()[i].rho(spray_.ambientPressure(), Td);
00328             scalar iTb = fuels.properties()[i].h(spray_.ambientPressure(), tBoilingSurface) - spray_.ambientPressure()/fuels.properties()[i].rho(spray_.ambientPressure(), tBoilingSurface);
00329 
00330             chi += p.X()[i]*(iTp-iTb)/hl;
00331 
00332         }
00333     }
00334 
00335     //  bounding chi
00336 
00337     chi = max(chi, 0.0);
00338     chi = min(chi, 1.0);
00339 
00340     //  modifing dD to take account of flash boiling
00341 
00342     dD = dD*(1.0 - chi*pow(pRatio, -pExp));
00343 
00344     scalar lBU = Cl_ * mag(p.U())*tau;
00345 
00346     if(pWalk > lBU)
00347     {
00348 
00349         p.liquidCore() = 0.0;
00350 
00351 //      calculate the new diameter with a Rosin Rammler distribution
00352 
00353         scalar minValue = min(p.d(),dD/10.0);
00354 
00355         scalar maxValue = dD;
00356 
00357         if(maxValue - minValue < SMALL)
00358         {
00359             minValue = p.d()/10.0;
00360         }
00361 
00362         scalar range = maxValue - minValue;
00363 
00364         scalar y = 0;
00365         scalar x = 0;
00366 
00367         bool success = false;
00368 
00369         while(!success)
00370         {
00371 
00372             x = minValue + range*rndGen_.scalar01();
00373             y = rndGen_.scalar01();
00374 
00375             scalar p = 0.0;
00376 
00377             scalar nExp = 1;
00378 
00379             scalar xx = pow(x/dD, nExp);
00380 
00381             p = xx*exp(-xx);
00382 
00383             if (y<p)
00384             {
00385                 success = true;
00386             }
00387 
00388         }
00389 
00390 //  New droplet diameter
00391 
00392         p.d() = x;
00393         p.ct() = 0.0;
00394 
00395     }
00396 
00397 
00398 }
00399 
00400 
00401 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00402 
00403 } // End namespace Foam
00404 
00405 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd