ORourkeCollision.H
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) 2011-2016 OpenFOAM Foundation
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 Class
25  Foam::ORourkeCollision
26 
27 Description
28  Collision model by P.J. O'Rourke.
29 
30 
31 \*---------------------------------------------------------------------------*/
32 
33 #ifndef ORourkeCollision_H
34 #define ORourkeCollision_H
35 
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43 /*---------------------------------------------------------------------------*\
44  Class ORourkeCollision Declaration
45 \*---------------------------------------------------------------------------*/
46 
47 template<class CloudType>
48 class ORourkeCollision
49 :
50  public StochasticCollisionModel<CloudType>
51 {
52 protected:
53 
54  // Protected Data
55 
56  //- Convenience typedef to the cloud's parcel type
57  typedef typename CloudType::parcelType parcelType;
58 
60 
61  //- Coalescence activation switch
63 
64 
65  // Protected Member Functions
66 
67  //- Main collision routine
68  virtual void collide(const scalar dt);
69 
70  //- Collide parcels and return true if mass has changed
71  virtual bool collideParcels
72  (
73  const scalar dt,
74  parcelType& p1,
75  parcelType& p2,
76  scalar& m1,
77  scalar& m2
78  );
79 
80  // 1 is the larger drop and 2 is the smaller
81  virtual bool collideSorted
82  (
83  const scalar dt,
84  parcelType& p1,
85  parcelType& p2,
86  scalar& m1,
87  scalar& m2
88  );
89 
90 
91 public:
92 
93  //- Runtime type information
94  TypeName("ORourke");
95 
96 
97  // Constructors
98 
99  //- Construct from dictionary
101  (
102  const dictionary& dict,
103  CloudType& cloud,
104  const word& modelName = typeName
105  );
106 
107  //- Construct copy
109 
110  //- Construct and return a clone
112  {
114  (
115  new ORourkeCollision<CloudType>(*this)
116  );
117  }
118 
119 
120  //- Destructor
121  virtual ~ORourkeCollision();
122 };
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #ifdef NoRepository
132  #include "ORourkeCollision.C"
133 #endif
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #endif
138 
139 // ************************************************************************* //
ORourkeCollision(const dictionary &dict, CloudType &cloud, const word &modelName=typeName)
Construct from dictionary.
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:104
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none.
Definition: Switch.H:60
virtual ~ORourkeCollision()
Destructor.
A class for handling words, derived from string.
Definition: word.H:59
A cloud is a collection of lagrangian particles.
Definition: cloud.H:51
virtual bool collideParcels(const scalar dt, parcelType &p1, parcelType &p2, scalar &m1, scalar &m2)
Collide parcels and return true if mass has changed.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:217
virtual autoPtr< StochasticCollisionModel< CloudType > > clone() const
Construct and return a clone.
virtual void collide(const scalar dt)
Main collision routine.
CloudType::parcelType parcelType
Convenience typedef to the cloud&#39;s parcel type.
virtual bool collideSorted(const scalar dt, parcelType &p1, parcelType &p2, scalar &m1, scalar &m2)
const liquidMixtureProperties & liquids_
Collision model by P.J. O&#39;Rourke.
TypeName("ORourke")
Runtime type information.
Templated stochastic collision model class.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:68
Switch coalescence_
Coalescence activation switch.
Namespace for OpenFOAM.