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-2022 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(typename CloudType::parcelType::trackingData& td);
67 
68  //- Collide parcels and return true if mass has changed
69  virtual bool collideParcels
70  (
71  const scalar dt,
72  parcelType& p1,
73  parcelType& p2,
74  scalar& m1,
75  scalar& m2
76  );
77 
78  // 1 is the larger drop and 2 is the smaller
79  virtual bool collideSorted
80  (
81  const scalar dt,
82  parcelType& p1,
83  parcelType& p2,
84  scalar& m1,
85  scalar& m2
86  );
87 
88 
89 public:
90 
91  //- Runtime type information
92  TypeName("ORourke");
93 
94 
95  // Constructors
96 
97  //- Construct from dictionary
99  (
100  const dictionary& dict,
101  CloudType& cloud,
102  const word& modelName = typeName
103  );
104 
105  //- Construct copy
107 
108  //- Construct and return a clone
110  {
112  (
113  new ORourkeCollision<CloudType>(*this)
114  );
115  }
116 
117 
118  //- Destructor
119  virtual ~ORourkeCollision();
120 };
121 
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 } // End namespace Foam
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 #ifdef NoRepository
130  #include "ORourkeCollision.C"
131 #endif
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:79
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:221
Collision model by P.J. O'Rourke.
virtual void collide(typename CloudType::parcelType::trackingData &td)
Main collision routine.
virtual bool collideParcels(const scalar dt, parcelType &p1, parcelType &p2, scalar &m1, scalar &m2)
Collide parcels and return true if mass has changed.
virtual autoPtr< StochasticCollisionModel< CloudType > > clone() const
Construct and return a clone.
virtual bool collideSorted(const scalar dt, parcelType &p1, parcelType &p2, scalar &m1, scalar &m2)
TypeName("ORourke")
Runtime type information.
Switch coalescence_
Coalescence activation switch.
CloudType::parcelType parcelType
Convenience typedef to the cloud's parcel type.
ORourkeCollision(const dictionary &dict, CloudType &cloud, const word &modelName=typeName)
Construct from dictionary.
virtual ~ORourkeCollision()
Destructor.
Templated stochastic collision model class.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:61
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A cloud is a collection of lagrangian particles.
Definition: cloud.H:55
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:104
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.