FreeFOAM The Cross-Platform CFD Toolkit
trajectoryModel.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "trajectoryModel.H"
28 
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 
36 defineTypeNameAndDebug(trajectoryCollisionModel, 0);
37 
39 (
40  collisionModel,
41  trajectoryCollisionModel,
42  dictionary
43 );
44 
45 
46 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
47 
48 // Construct from components
50 (
51  const dictionary& dict,
52  spray& sm,
53  Random& rndGen
54 )
55 :
56  collisionModel(dict, sm, rndGen),
57  coeffsDict_(dict.subDict(typeName + "Coeffs")),
58  cSpace_(readScalar(coeffsDict_.lookup("cSpace"))),
59  cTime_(readScalar(coeffsDict_.lookup("cTime"))),
60  coalescence_(coeffsDict_.lookup("coalescence"))
61 
62 {}
63 
64 
65 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
66 
68 {}
69 
70 
71 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
72 
73 void trajectoryCollisionModel::collideParcels(const scalar dt) const
74 {
75  if (spray_.size() < 2)
76  {
77  return;
78  }
79 
80  spray::iterator secondParcel = spray_.begin();
81  ++secondParcel;
82  spray::iterator p1 = secondParcel;
83 
84  while (p1 != spray_.end())
85  {
87 
88  while (p2 != p1)
89  {
90 # include "trajectoryCM.H"
91 
92  // remove coalesced droplets
93  if (p2().m() < VSMALL)
94  {
95  spray::iterator tmpElmnt = p2;
96  ++tmpElmnt;
97  spray_.deleteParticle(p2());
98  p2 = tmpElmnt;
99  }
100  else
101  {
102  ++p2;
103  }
104 
105  } // end - inner loop
106 
107  // remove coalesced droplets
108  if (p1().m() < VSMALL)
109  {
110  spray::iterator tmpElmnt = p1;
111  ++tmpElmnt;
112  spray_.deleteParticle(p1());
113  p1 = tmpElmnt;
114  }
115  else
116  {
117  ++p1;
118  }
119  } // end - outer loop
120 
121 } // end
122 
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 } // End namespace Foam
127 
128 // ************************ vim: set sw=4 sts=4 et: ************************ //