PairCollision.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2017 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::PairCollision
28
29Group
30 grpLagrangianIntermediateCollisionSubModels
31
32Description
33
34SourceFiles
35 PairCollision.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef PairCollision_H
40#define PairCollision_H
41
42#include "CollisionModel.H"
43#include "InteractionLists.H"
44#include "WallSiteData.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51// Forward declaration of classes
52
53template<class CloudType>
54class PairModel;
55
56template<class CloudType>
57class WallModel;
58
59
60/*---------------------------------------------------------------------------*\
61 Class PairCollision Declaration
62\*---------------------------------------------------------------------------*/
63
64template<class CloudType>
65class PairCollision
66:
67 public CollisionModel<CloudType>
68{
69 // Static data
70
71 //- Tolerance to determine flat wall interactions
72 static scalar cosPhiMinFlatWall;
73
74 //- Distance to multiply the distance to a wall with within
75 // which a duplicate flat wall interaction is defined. If
76 // cosPhiFlatWall = 1 - e, this = sqrt(2e - e^2) < sqrt(3e)
77 // for all e < 1, giving a safe tolerance (i.e. no double
78 // interactions next to each other.)
79 static scalar flatWallDuplicateExclusion;
80
81
82 // Private data
83
84 //- PairModel to calculate the interaction between two parcels
86
87 //- WallModel to calculate the interaction between the parcel and walls
89
90 //- Interactions lists determining which cells are in
91 // interaction range of each other
93
94
95 // Private member functions
96
97 //- Pre collision tasks
98 void preInteraction();
99
100 //- Interactions between parcels
101 void parcelInteraction();
102
103 //- Interactions between real (on-processor) particles
104 void realRealInteraction();
105
106 //- Interactions between real and referred (off processor) particles
107 void realReferredInteraction();
108
109 //- Interactions with walls
110 void wallInteraction();
111
112 bool duplicatePointInList
113 (
114 const DynamicList<point>& existingPoints,
115 const point& pointToTest,
116 scalar duplicateRangeSqr
117 ) const;
118
119 bool duplicatePointInList
120 (
121 const DynamicList<point>& existingPoints,
122 const point& pointToTest,
123 const scalarList& duplicateRangeSqr
124 ) const;
125
126 //- Post collision tasks
127 void postInteraction();
128
129 //- Calculate the pair force between parcels
130 void evaluatePair
131 (
132 typename CloudType::parcelType& pA,
133 typename CloudType::parcelType& pB
134 ) const;
135
136 //- Calculate the wall forces on a parcel
137 void evaluateWall
138 (
139 typename CloudType::parcelType& p,
140 const List<point>& flatSitePoints,
141 const List<WallSiteData<vector>>& flatSiteData,
142 const List<point>& sharpSitePoints,
143 const List<WallSiteData<vector>>& sharpSiteData
144 ) const;
145
146
147public:
148
149 //- Runtime type information
150 TypeName("pairCollision");
151
152
153 // Constructors
154
155 //- Construct from components
157
158 //- Construct copy
160
161 //- Construct and return a clone
163 {
165 (
166 new PairCollision<CloudType>(*this)
167 );
168 }
169
170
171 //- Destructor
172 virtual ~PairCollision();
173
174
175 // Member Functions
176
177 //- Return the number of times to subcycle the current
178 // timestep to meet the criteria of the collision model.
179 virtual label nSubCycles() const;
180
181 // Collision function
182 virtual void collide();
183};
184
185
186// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187
188} // End namespace Foam
189
190// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191
192#ifdef NoRepository
193 #include "PairCollision.C"
194#endif
195
196// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197
198#endif
199
200// ************************************************************************* //
const CloudType & owner() const
Return const access to the owner cloud.
Templated collision model class.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:72
Builds direct interaction list, specifying which local (real) cells are potentially in range of each ...
virtual label nSubCycles() const
Return the number of times to subcycle the current.
virtual ~PairCollision()
Destructor.
virtual autoPtr< CollisionModel< CloudType > > clone() const
Construct and return a clone.
virtual void collide()
TypeName("pairCollision")
Runtime type information.
Stores the patch ID and templated data to represent a collision with a wall to be passed to the wall ...
Definition: WallSiteData.H:67
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:113
volScalarField & p
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73