1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 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 \*---------------------------------------------------------------------------*/
29 #include "ORourkeCollisionModel.H"
30 #include "addToRunTimeSelectionTable.H"
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
39 defineTypeNameAndDebug(ORourkeCollisionModel, 0);
41 addToRunTimeSelectionTable
44 ORourkeCollisionModel,
49 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
51 // Construct from components
52 ORourkeCollisionModel::ORourkeCollisionModel
54 const dictionary& dict,
59 collisionModel(dict, sm, rndGen),
61 coeffsDict_(dict.subDict(typeName + "Coeffs")),
62 coalescence_(coeffsDict_.lookup("coalescence"))
66 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
68 ORourkeCollisionModel::~ORourkeCollisionModel()
72 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
74 void ORourkeCollisionModel::collideParcels(const scalar dt) const
77 if (spray_.size() < 2)
82 spray::iterator secondParcel = spray_.begin();
84 spray::iterator p1 = secondParcel;
86 while (p1 != spray_.end())
88 label cell1 = p1().cell();
90 spray::iterator p2 = spray_.begin();
94 label cell2 = p2().cell();
96 // No collision if parcels are not in the same cell
99 # include "sameCell.H"
100 } // if - parcels in same cell
102 // remove coalesced droplet
103 if (p2().m() < VSMALL)
105 spray::iterator tmpElmnt = p2;
107 spray_.deleteParticle(p2());
117 // remove coalesced droplet
118 if (p1().m() < VSMALL)
120 spray::iterator tmpElmnt = p1;
122 spray_.deleteParticle(p1());
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 } // End namespace Foam
138 // ************************************************************************* //