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

TAB.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 "TAB.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 #include "mathematicalConstants.H"
00030 
00031 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00032 
00033 namespace Foam
00034 {
00035 
00036 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00037 
00038 defineTypeNameAndDebug(TAB, 0);
00039 
00040 addToRunTimeSelectionTable
00041 (
00042     breakupModel,
00043     TAB,
00044     dictionary
00045 );
00046 
00047 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00048 
00049 // Construct from components
00050 TAB::TAB
00051 (
00052     const dictionary& dict,
00053     spray& sm
00054 )
00055 :
00056     breakupModel(dict, sm),
00057     coeffsDict_(dict.subDict(typeName + "Coeffs")),
00058     Cmu_(readScalar(coeffsDict_.lookup("Cmu"))),
00059     Comega_(readScalar(coeffsDict_.lookup("Comega"))),
00060     WeCrit_(readScalar(coeffsDict_.lookup("WeCrit")))
00061 {
00062 
00063     // calculate the inverse function of the Rossin-Rammler Distribution
00064     const scalar xx0 = 12.0;
00065     const scalar rrd100 = 1.0/(1.0-exp(-xx0)*(1+xx0+pow(xx0, 2)/2+pow(xx0, 3)/6));
00066 
00067     for(label n=0; n<100; n++)
00068     {
00069         scalar xx = 0.12*(n+1);
00070         rrd_[n] = (1-exp(-xx)*(1 + xx + pow(xx, 2)/2 + pow(xx, 3)/6))*rrd100;
00071     }
00072 }
00073 
00074 
00075 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00076 
00077 TAB::~TAB()
00078 {}
00079 
00080 
00081 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00082 
00083 void TAB::breakupParcel
00084 (
00085     parcel& p,
00086     const scalar deltaT,
00087     const vector& Ug,
00088     const liquidMixture& fuels
00089 ) const
00090 {
00091 
00092     scalar T = p.T();
00093     scalar pc = spray_.p()[p.cell()];
00094     scalar r = 0.5*p.d();
00095     scalar r2 = r*r;
00096     scalar r3 = r*r2;
00097 
00098     scalar rho = fuels.rho(pc, T, p.X());
00099     scalar sigma = fuels.sigma(pc, T, p.X());
00100     scalar mu = fuels.mu(pc, T, p.X());
00101 
00102     // inverse of characteristic viscous damping time
00103     scalar rtd = 0.5*Cmu_*mu/(rho*r2);
00104     
00105     // oscillation frequency (squared)
00106     scalar omega2 = Comega_*sigma/(rho*r3) - rtd*rtd;
00107 
00108     if (omega2 > 0)
00109     {
00110         scalar omega = sqrt(omega2);
00111         scalar rhog = spray_.rho()[p.cell()];
00112         scalar We = p.We(Ug, rhog, sigma);
00113         scalar Wetmp = We/WeCrit_;
00114 
00115         scalar y1 = p.dev() - Wetmp;
00116         scalar y2 = p.ddev()/omega;
00117 
00118         scalar a = sqrt(y1*y1 + y2*y2);
00119 
00120         // scotty we may have break-up
00121         if (a+Wetmp > 1.0)
00122         {
00123             scalar phic = y1/a;
00124 
00125             // constrain phic within -1 to 1
00126             phic = max(min(phic, 1), -1);
00127 
00128             scalar phit = acos(phic);
00129             scalar phi = phit;
00130             scalar quad = -y2/a;
00131             if (quad < 0)
00132             {
00133                 phi = 2*mathematicalConstant::pi - phit;
00134             }
00135             
00136             scalar tb = 0;
00137             
00138             if (mag(p.dev()) < 1.0)
00139             {
00140                 scalar coste = 1.0;
00141                 if
00142                 (
00143                     (Wetmp - a < -1)
00144                  && (p.ddev() < 0)
00145                 )
00146                 {
00147                     coste = -1.0;
00148                 }
00149                 
00150                 scalar theta = acos((coste-Wetmp)/a);
00151                 
00152                 if (theta < phi)
00153                 {
00154                     if (2*mathematicalConstant::pi-theta >= phi)
00155                     {
00156                         theta = -theta;
00157                     }
00158                     theta += 2*mathematicalConstant::pi;
00159                 }
00160                 tb = (theta-phi)/omega;
00161 
00162                 // breakup occurs
00163                 if (deltaT > tb)
00164                 {
00165                     p.dev() = 1.0;
00166                     p.ddev() = -a*omega*sin(omega*tb + phi);
00167                 }
00168 
00169             }
00170 
00171             // update droplet size
00172             if (deltaT > tb)
00173             {
00174                 scalar rs = r/
00175                 (
00176                     1 
00177                   + (4.0/3.0)*pow(p.dev(), 2)
00178                   + rho*r3/(8*sigma)*pow(p.ddev(), 2)
00179                 );
00180                 
00181                 label n = 0;
00182                 bool found = false;
00183                 scalar random = rndGen_.scalar01();
00184                 while (!found && (n<99))
00185                 {
00186                     if (rrd_[n]>random)
00187                     {
00188                         found = true;
00189                     }
00190                     n++;
00191 
00192                 }
00193                 scalar rNew = 0.04*n*rs;
00194                 if (rNew < r)
00195                 {
00196                     p.d() = 2*rNew;
00197                     p.dev() = 0;
00198                     p.ddev() = 0;
00199                 }
00200 
00201             }
00202 
00203         }
00204        
00205     }
00206     else
00207     {
00208         // reset droplet distortion parameters
00209         p.dev() = 0;
00210         p.ddev() = 0;
00211     }
00212 
00213 }
00214 
00215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00216 
00217 } // End namespace Foam
00218 
00219 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd