1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "trajectoryModel.H"
28 #include "addToRunTimeSelectionTable.H"
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
37 defineTypeNameAndDebug(trajectoryCollisionModel, 0);
39 addToRunTimeSelectionTable
42 trajectoryCollisionModel,
47 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
49 // Construct from components
50 trajectoryCollisionModel::trajectoryCollisionModel
52 const dictionary& dict,
57 collisionModel(dict, sm, rndGen),
58 coeffsDict_(dict.subDict(typeName + "Coeffs")),
59 cSpace_(readScalar(coeffsDict_.lookup("cSpace"))),
60 cTime_(readScalar(coeffsDict_.lookup("cTime"))),
61 coalescence_(coeffsDict_.lookup("coalescence"))
66 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
68 trajectoryCollisionModel::~trajectoryCollisionModel()
72 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
74 void trajectoryCollisionModel::collideParcels(const scalar dt) const
76 if (spray_.size() < 2)
81 spray::iterator secondParcel = spray_.begin();
83 spray::iterator p1 = secondParcel;
85 while (p1 != spray_.end())
87 spray::iterator p2 = spray_.begin();
91 # include "trajectoryCM.H"
93 // remove coalesced droplets
94 if (p2().m() < VSMALL)
96 spray::iterator tmpElmnt = p2;
98 spray_.deleteParticle(p2());
106 } // end - inner loop
108 // remove coalesced droplets
109 if (p1().m() < VSMALL)
111 spray::iterator tmpElmnt = p1;
113 spray_.deleteParticle(p1());
120 } // end - outer loop
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 } // End namespace Foam
129 // ************************************************************************* //