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

breakupModel.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 #include "breakupModel.H"
00029 
00030 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00031 
00032 namespace Foam
00033 {
00034 
00035 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00036 
00037 defineTypeNameAndDebug(breakupModel, 0);
00038 
00039 defineRunTimeSelectionTable(breakupModel, dictionary);
00040 
00041 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00042 
00043 // Construct from components
00044 breakupModel::breakupModel
00045 (
00046     const dictionary& dict,
00047     spray& sm
00048 )
00049 :
00050     dict_(dict),
00051     spray_(sm),
00052     rndGen_(sm.rndGen()),
00053     includeOscillation_(dict_.lookup("includeOscillation")),
00054     TABcoeffsDict_(dict.subDict("TABCoeffs")),
00055     y0_(0.0),
00056     yDot0_(0.0),
00057     TABComega_(0.0),
00058     TABCmu_(0.0),
00059     TABWeCrit_(0.0)
00060 {
00061     if (includeOscillation_)
00062     {
00063         y0_ = readScalar(TABcoeffsDict_.lookup("y0"));
00064         yDot0_ = readScalar(TABcoeffsDict_.lookup("yDot0"));
00065         TABComega_ = readScalar(TABcoeffsDict_.lookup("Comega"));
00066         TABCmu_ = readScalar(TABcoeffsDict_.lookup("Cmu"));
00067         TABWeCrit_ = readScalar(TABcoeffsDict_.lookup("WeCrit"));
00068     }
00069 }
00070 
00071 
00072 // * * * * * * * * * * * * * * * * Destructor    * * * * * * * * * * * * * * //
00073 
00074 breakupModel::~breakupModel()
00075 {}
00076 
00077 // * * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * //
00078 
00079 void breakupModel::updateParcelProperties
00080 (
00081     parcel& p,
00082     const scalar deltaT,
00083     const vector& Ug,
00084     const liquidMixture& fuels
00085 ) const
00086 {
00087 
00088     if(includeOscillation_)
00089     {
00090     
00091         scalar T = p.T();
00092         scalar pc = spray_.p()[p.cell()];
00093         scalar r = 0.5 * p.d();
00094         scalar r2 = r*r;
00095         scalar r3 = r*r2;
00096     
00097         scalar rho = fuels.rho(pc, T, p.X());
00098         scalar sigma = fuels.sigma(pc, T, p.X());
00099         scalar mu = fuels.mu(pc, T, p.X());
00100     
00101         // inverse of characteristic viscous damping time    
00102         scalar rtd = 0.5*TABCmu_*mu/(rho*r2);
00103         
00104         // oscillation frequency (squared)
00105         scalar omega2 = TABComega_ * sigma /(rho*r3) - rtd*rtd;
00106         
00107         if(omega2 > 0)
00108         {
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/TABWeCrit_;
00114 
00115             scalar y1 = p.dev() - Wetmp;
00116             scalar y2 = p.ddev()/omega;
00117                        
00118             // update distortion parameters
00119             scalar c = cos(omega*deltaT);
00120             scalar s = sin(omega*deltaT);
00121             scalar e = exp(-rtd*deltaT);
00122             y2 = (p.ddev() + y1*rtd)/omega;
00123             
00124             p.dev() = Wetmp + e*(y1*c + y2*s);
00125             if (p.dev() < 0)
00126             {
00127                 p.dev() = 0.0;
00128                 p.ddev() = 0.0;
00129             }
00130             else 
00131             {
00132                 p.ddev() = (Wetmp-p.dev())*rtd + e*omega*(y2*c - y1*s);
00133             }
00134         }
00135         else
00136         {
00137             // reset droplet distortion parameters
00138             p.dev() = 0;
00139             p.ddev() = 0;
00140         }
00141 
00142     }
00143     
00144 }
00145 
00146 
00147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00148 
00149 } // End namespace Foam
00150 
00151 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd