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

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