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

trajectoryModel.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 "trajectoryModel.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 
00030 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00031 
00032 namespace Foam
00033 {
00034 
00035 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00036 
00037 defineTypeNameAndDebug(trajectoryCollisionModel, 0);
00038 
00039 addToRunTimeSelectionTable
00040 (
00041     collisionModel,
00042     trajectoryCollisionModel,
00043     dictionary
00044 );
00045 
00046 
00047 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00048 
00049 // Construct from components
00050 trajectoryCollisionModel::trajectoryCollisionModel
00051 (
00052     const dictionary& dict,
00053     spray& sm,
00054     Random& rndGen
00055 )
00056 :
00057     collisionModel(dict, sm, rndGen),
00058     coeffsDict_(dict.subDict(typeName + "Coeffs")),
00059     cSpace_(readScalar(coeffsDict_.lookup("cSpace"))),
00060     cTime_(readScalar(coeffsDict_.lookup("cTime"))),
00061     coalescence_(coeffsDict_.lookup("coalescence"))
00062 
00063 {}
00064 
00065 
00066 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00067 
00068 trajectoryCollisionModel::~trajectoryCollisionModel()
00069 {}
00070 
00071 
00072 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00073 
00074 void trajectoryCollisionModel::collideParcels(const scalar dt) const
00075 {
00076     if (spray_.size() < 2)
00077     {
00078         return;
00079     }
00080 
00081     spray::iterator secondParcel = spray_.begin();
00082     ++secondParcel;
00083     spray::iterator p1 = secondParcel;
00084 
00085     while (p1 != spray_.end())
00086     {
00087         spray::iterator p2 = spray_.begin();
00088 
00089         while (p2 != p1)
00090         {
00091 #           include "trajectoryCM.H"
00092 
00093             // remove coalesced droplets
00094             if (p2().m() < VSMALL) 
00095             {
00096                 spray::iterator tmpElmnt = p2;
00097                 ++tmpElmnt;
00098                 spray_.deleteParticle(p2());
00099                 p2 = tmpElmnt;
00100             }
00101             else 
00102             {
00103                 ++p2;
00104             }
00105 
00106         } // end - inner loop
00107 
00108         // remove coalesced droplets
00109         if (p1().m() < VSMALL)
00110         {
00111             spray::iterator tmpElmnt = p1;
00112             ++tmpElmnt;
00113             spray_.deleteParticle(p1());
00114             p1 = tmpElmnt;
00115         }
00116         else
00117         {
00118             ++p1;
00119         }
00120     } // end - outer loop
00121 
00122 } // end
00123 
00124 
00125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00126 
00127 } // End namespace Foam
00128 
00129 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd