1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "ORourkeCollisionModel.H"
27 #include "addToRunTimeSelectionTable.H"
28 #include "mathematicalConstants.H"
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 defineTypeNameAndDebug(ORourkeCollisionModel, 0);
36 addToRunTimeSelectionTable
39 ORourkeCollisionModel,
45 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
47 Foam::ORourkeCollisionModel::ORourkeCollisionModel
49 const dictionary& dict,
54 collisionModel(dict, sm, rndGen),
56 coeffsDict_(dict.subDict(typeName + "Coeffs")),
57 coalescence_(coeffsDict_.lookup("coalescence"))
61 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
63 Foam::ORourkeCollisionModel::~ORourkeCollisionModel()
67 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
69 void Foam::ORourkeCollisionModel::collideParcels(const scalar dt) const
71 if (spray_.size() < 2)
76 spray::iterator secondParcel = spray_.begin();
78 spray::iterator p1 = secondParcel;
80 while (p1 != spray_.end())
82 label cell1 = p1().cell();
84 spray::iterator p2 = spray_.begin();
88 label cell2 = p2().cell();
90 // No collision if parcels are not in the same cell
96 // remove coalesced droplet
97 if (p2().m() < VSMALL)
99 spray::iterator tmpElmnt = p2;
101 spray_.deleteParticle(p2());
110 // remove coalesced droplet
111 if (p1().m() < VSMALL)
113 spray::iterator tmpElmnt = p1;
115 spray_.deleteParticle(p1());
126 // ************************************************************************* //