ORourkeCollision.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2021 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 
59  //- Coalescence activation switch
61 
62 
63  // Protected Member Functions
64 
65  //- Main collision routine
66  virtual void collide
67  (
68  typename CloudType::parcelType::trackingData& td,
69  const scalar dt
70  );
71 
72  //- Collide parcels and return true if mass has changed
73  virtual bool collideParcels
74  (
75  const scalar dt,
76  parcelType& p1,
77  parcelType& p2,
78  scalar& m1,
79  scalar& m2
80  );
81 
82  // 1 is the larger drop and 2 is the smaller
83  virtual bool collideSorted
84  (
85  const scalar dt,
86  parcelType& p1,
87  parcelType& p2,
88  scalar& m1,
89  scalar& m2
90  );
91 
92 
93 public:
94 
95  //- Runtime type information
96  TypeName("ORourke");
97 
98 
99  // Constructors
100 
101  //- Construct from dictionary
103  (
104  const dictionary& dict,
105  CloudType& cloud,
106  const word& modelName = typeName
107  );
108 
109  //- Construct copy
111 
112  //- Construct and return a clone
114  {
116  (
117  new ORourkeCollision<CloudType>(*this)
118  );
119  }
120 
121 
122  //- Destructor
123  virtual ~ORourkeCollision();
124 };
125 
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 } // End namespace Foam
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #ifdef NoRepository
134  #include "ORourkeCollision.C"
135 #endif
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #endif
140 
141 // ************************************************************************* //
ORourkeCollision(const dictionary &dict, CloudType &cloud, const word &modelName=typeName)
Construct from dictionary.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
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/any.
Definition: Switch.H:60
virtual void collide(typename CloudType::parcelType::trackingData &td, const scalar dt)
Main collision routine.
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:104
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
virtual ~ORourkeCollision()
Destructor.
virtual autoPtr< StochasticCollisionModel< CloudType > > clone() const
Construct and return a clone.
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:221
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)
Collision model by P.J. O&#39;Rourke.
TypeName("ORourke")
Runtime type information.
Templated stochastic collision model class.
Definition: MomentumCloud.H:89
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
Switch coalescence_
Coalescence activation switch.
Namespace for OpenFOAM.