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-2018 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
69  (
70  typename CloudType::parcelType::trackingData& td,
71  const scalar dt
72  );
73 
74  //- Collide parcels and return true if mass has changed
75  virtual bool collideParcels
76  (
77  const scalar dt,
78  parcelType& p1,
79  parcelType& p2,
80  scalar& m1,
81  scalar& m2
82  );
83 
84  // 1 is the larger drop and 2 is the smaller
85  virtual bool collideSorted
86  (
87  const scalar dt,
88  parcelType& p1,
89  parcelType& p2,
90  scalar& m1,
91  scalar& m2
92  );
93 
94 
95 public:
96 
97  //- Runtime type information
98  TypeName("ORourke");
99 
100 
101  // Constructors
102 
103  //- Construct from dictionary
105  (
106  const dictionary& dict,
107  CloudType& cloud,
108  const word& modelName = typeName
109  );
110 
111  //- Construct copy
113 
114  //- Construct and return a clone
116  {
118  (
119  new ORourkeCollision<CloudType>(*this)
120  );
121  }
122 
123 
124  //- Destructor
125  virtual ~ORourkeCollision();
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #ifdef NoRepository
136  #include "ORourkeCollision.C"
137 #endif
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
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:158
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:215
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:52
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:69
Switch coalescence_
Coalescence activation switch.
Namespace for OpenFOAM.