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

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