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

ETAB.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 "ETAB.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 #include "mathematicalConstants.H"
00030 
00031 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00032 
00033 namespace Foam
00034 {
00035 
00036 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00037 
00038 defineTypeNameAndDebug(ETAB, 0);
00039 
00040 addToRunTimeSelectionTable
00041 (
00042     breakupModel,
00043     ETAB,
00044     dictionary
00045 );
00046 
00047 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00048 
00049 // Construct from components
00050 ETAB::ETAB
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     k1_(readScalar(coeffsDict_.lookup("k1"))),
00061     k2_(readScalar(coeffsDict_.lookup("k2"))),
00062     WeCrit_(readScalar(coeffsDict_.lookup("WeCrit"))),
00063     WeTransition_(readScalar(coeffsDict_.lookup("WeTransition"))),
00064     AWe_(0.0)
00065 {
00066     scalar k21 = k2_/k1_;
00067     AWe_ = (k21*sqrt(WeTransition_) - 1.0)/pow(WeTransition_, 4.0);
00068 }
00069 
00070 
00071 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00072 
00073 ETAB::~ETAB()
00074 {}
00075 
00076 
00077 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00078 
00079 void ETAB::breakupParcel
00080 (
00081     parcel& p,
00082     const scalar deltaT,
00083     const vector& Ug,
00084     const liquidMixture& fuels
00085 ) const
00086 {
00087 
00088     scalar T  = p.T();
00089     scalar pc  = spray_.p()[p.cell()];
00090     scalar r  = 0.5*p.d();
00091     scalar r2 = r*r;
00092     scalar r3 = r*r2;
00093 
00094     scalar rho   = fuels.rho(pc, T, p.X());
00095     scalar sigma = fuels.sigma(pc, T, p.X());
00096     scalar mu    = fuels.mu(pc, T, p.X());
00097 
00098     // inverse of characteristic viscous damping time
00099     scalar rtd = 0.5*Cmu_*mu/(rho*r2);
00100 
00101     // oscillation frequency (squared)
00102     scalar omega2 = Comega_*sigma/(rho*r3) - rtd*rtd;
00103 
00104     if (omega2 > 0)
00105     {
00106         scalar omega = sqrt(omega2);
00107         scalar romega = 1.0/omega;
00108 
00109         scalar rhog = spray_.rho()[p.cell()];
00110         scalar We = p.We(Ug, rhog, sigma);
00111         scalar Wetmp = We/WeCrit_;
00112 
00113         scalar y1 = p.dev() - Wetmp;
00114         scalar y2 = p.ddev()*romega;
00115 
00116         scalar a = sqrt(y1*y1 + y2*y2);
00117 
00118         // scotty we may have break-up
00119         if (a+Wetmp > 1.0)
00120         {
00121             scalar phic = y1/a;
00122 
00123             // constrain phic within -1 to 1
00124             phic = max(min(phic, 1), -1);
00125 
00126             scalar phit = acos(phic);
00127             scalar phi = phit;
00128             scalar quad = -y2/a;
00129             if (quad < 0)
00130             {
00131                 phi = 2*mathematicalConstant::pi - phit;
00132             }
00133 
00134             scalar tb = 0;
00135 
00136             if (mag(p.dev()) < 1.0)
00137             {
00138                 scalar theta = acos((1.0 - Wetmp)/a);
00139 
00140                 if (theta < phi)
00141                 {
00142                     if (2*mathematicalConstant::pi-theta >= phi)
00143                     {
00144                         theta = -theta;
00145                     }
00146                     theta += 2*mathematicalConstant::pi;
00147                 }
00148                 tb = (theta-phi)*romega;
00149 
00150                 // breakup occurs
00151                 if (deltaT > tb)
00152                 {
00153                     p.dev() = 1.0;
00154                     p.ddev() = -a*omega*sin(omega*tb + phi);
00155                 }
00156             }
00157 
00158             // update droplet size
00159             if (deltaT > tb)
00160             {
00161                 scalar sqrtWe = AWe_*pow(We, 4.0) + 1.0;
00162                 scalar Kbr = k1_*omega*sqrtWe;
00163 
00164                 if (We > WeTransition_)
00165                 {
00166                     sqrtWe = sqrt(We);
00167                     Kbr =k2_*omega*sqrtWe;
00168                 }
00169 
00170                 scalar rWetmp = 1.0/Wetmp;
00171                 scalar cosdtbu = max(-1.0, min(1.0, 1.0-rWetmp));
00172                 scalar dtbu = romega*acos(cosdtbu);
00173                 scalar decay = exp(-Kbr*dtbu);
00174 
00175                 scalar rNew = decay*r;
00176                 if (rNew < r)
00177                 {
00178                     p.d() = 2*rNew;
00179                     p.dev() = 0;
00180                     p.ddev() = 0;
00181                 }
00182             }
00183         }
00184     }
00185     else
00186     {
00187         // reset droplet distortion parameters
00188         p.dev() = 0;
00189         p.ddev() = 0;
00190     }
00191 }
00192 
00193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00194 
00195 } // End namespace Foam
00196 
00197 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd