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

sprayOps.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 "spray.H"
00027 #include <dieselSpray/atomizationModel.H>
00028 #include <dieselSpray/breakupModel.H>
00029 #include <dieselSpray/collisionModel.H>
00030 #include <dieselSpray/dispersionModel.H>
00031 #include <finiteVolume/interpolationCellPoint.H>
00032 #include <OpenFOAM/processorPolyPatch.H>
00033 #include <OpenFOAM/mathematicalConstants.H>
00034 
00035 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00036 
00037 namespace Foam
00038 {
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 void spray::evolve()
00043 {
00044     sms_.setSize(rho_.size());
00045     shs_.setSize(rho_.size());
00046     forAll(srhos_, i)
00047     {
00048         srhos_[i].setSize(rho_.size());
00049     }
00050 
00051     UInterpolator_ = interpolation<vector>::New(interpolationSchemes_, U_);
00052 
00053     rhoInterpolator_ = interpolation<scalar>::New(interpolationSchemes_, rho_);
00054 
00055     pInterpolator_ = interpolation<scalar>::New(interpolationSchemes_, p_);
00056 
00057     TInterpolator_ = interpolation<scalar>::New(interpolationSchemes_, T_);
00058 
00059     calculateAmbientPressure();
00060     calculateAmbientTemperature();
00061     collisions().collideParcels(runTime_.deltaT().value());
00062     move();
00063     dispersion().disperseParcels();
00064     inject();
00065     atomizationLoop();
00066     breakupLoop();
00067 
00068     UInterpolator_.clear();
00069     rhoInterpolator_.clear();
00070     pInterpolator_.clear();
00071     TInterpolator_.clear();
00072 }
00073 
00074 
00075 void spray::move()
00076 {
00077     // Reset Spray Source Terms
00078     sms_ = vector::zero;
00079     shs_ = 0.0;
00080     forAll(srhos_, i)
00081     {
00082         srhos_[i] = 0.0;
00083     }
00084 
00085     Cloud<parcel>::move(*this);
00086 }
00087 
00088 
00089 void spray::breakupLoop()
00090 {
00091     forAllIter(spray, *this, elmnt)
00092     {
00093         // interpolate...
00094         vector velocity = UInterpolator().interpolate
00095         (
00096             elmnt().position(),
00097             elmnt().cell()
00098         );
00099 
00100         // liquidCore < 0.5 indicates discrete drops
00101         if (elmnt().liquidCore() <= 0.5)
00102         {
00103             breakup().updateParcelProperties
00104             (
00105                 elmnt(),
00106                 runTime_.deltaT().value(),
00107                 velocity,
00108                 fuels_
00109             );
00110 
00111             breakup().breakupParcel
00112             (
00113                 elmnt(),
00114                 runTime_.deltaT().value(),
00115                 velocity,
00116                 fuels_
00117             );
00118         }
00119     }
00120 }
00121 
00122 
00123 void spray::atomizationLoop()
00124 {
00125     forAllIter(spray, *this, elmnt)
00126     {
00127         // interpolate...
00128         vector velocity = UInterpolator().interpolate
00129         (
00130             elmnt().position(),
00131             elmnt().cell()
00132         );
00133 
00134         // liquidCore > 0.5 indicates a liquid core
00135         if (elmnt().liquidCore() > 0.5)
00136         {
00137             atomization().atomizeParcel
00138             (
00139                 elmnt(),
00140                 runTime_.deltaT().value(),
00141                 velocity,
00142                 fuels_
00143             );
00144         }
00145     }
00146 }
00147 
00148 
00149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00150 
00151 } // End namespace Foam
00152 
00153 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines