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

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