FaceInteraction.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) 2021 OpenCFD Ltd.
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::FaceInteraction
28
29Group
30 grpLagrangianIntermediateFunctionObjects
31
32Description
33 Face zone-based particle interactions.
34
35 \verbatim
36 faceInteraction1
37 {
38 type faceInteraction;
39
40 // List of (faceZone interactionType)
41 faceZones
42 (
43 (faceZone1 stick)
44 (faceZone2 escape)
45 (faceZone3 rebound)
46 );
47
48 // Optional limiting to diameter range
49 dMin 0;
50 dMax 1;
51
52 writeToFile yes; // default = yes
53 }
54 \endverbatim
55
56 File written per faceZone as:
57
58 postProcessing/lagrangian/cloudName/modelName/time/modelName_faceZone.dat
59
60SourceFiles
61 FaceInteraction.C
62
63\*---------------------------------------------------------------------------*/
64
65#ifndef FaceInteraction_H
66#define FaceInteraction_H
67
68#include "CloudFunctionObject.H"
69#include "Enum.H"
70#include "boundBox.H"
71
72// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73
74namespace Foam
75{
76
77/*---------------------------------------------------------------------------*\
78 Class FaceInteraction Declaration
79\*---------------------------------------------------------------------------*/
80
81template<class CloudType>
83:
84 public CloudFunctionObject<CloudType>,
86{
87public:
88
89 // Public Data Types
90
91 //- Convenience typedef for parcel type
92 typedef typename CloudType::parcelType parcelType;
93
94 //- Enumeration defining the interaction types
95 enum class interactionType
96 {
97 ESCAPE,
98 STICK,
99 REBOUND
100 };
101
102 //- Names for the interaction types
104
105
106private:
107
108 // Private Data
109
110 //- Face zone IDs
111 labelList faceZoneIDs_;
112
113 //- Face zone bounding boxes
114 List<boundBox> faceZoneBBs_;
115
116 //- Face zone particle interaction type
117 List<interactionType> faceZoneInteraction_;
118
119 //- File per zone
120 PtrList<OFstream> filePtrs_;
121
122 //- Number of escape particles per zone
123 labelList nEscapeParticles_;
124
125 //- Number of stick particles per zone
126 labelList nStickParticles_;
127
128 //- Number of rebound particles per zone
129 labelList nReboundParticles_;
130
131 //- Minimum diameter threshold
132 scalar dMin_;
133
134 //- Maximum diameter threshold
135 scalar dMax_;
136
137
138protected:
139
140 // Protected Member Functions
141
142 //- Return true if this particle will be assessed
143 bool processParticle(const parcelType& p, const label localZonei);
144
145 //- Write post-processing info
146 void write();
147
148
149public:
150
151 //- Runtime type information
152 TypeName("faceInteraction");
153
154
155 // Constructors
156
157 //- Construct from dictionary
159 (
160 const dictionary& dict,
162 const word& modelName
163 );
164
165 //- Construct copy
167
168 //- Construct and return a clone
170 {
172 (
174 );
175 }
176
177
178 //- Destructor
179 virtual ~FaceInteraction() = default;
180
181
182 // Member Functions
183
184 //- Post-face hook
185 virtual void postFace(const parcelType& p, bool& keepParticle);
186};
187
188
189// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190
191} // End namespace Foam
192
193// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194
195#ifdef NoRepository
196 #include "FaceInteraction.C"
197#endif
198
199// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200
201#endif
202
203// ************************************************************************* //
Templated cloud function object base class.
const CloudType & owner() const
Return const access to the owner cloud.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
Face zone-based particle interactions.
virtual autoPtr< CloudFunctionObject< CloudType > > clone() const
Construct and return a clone.
static const Enum< interactionType > interactionTypeNames_
Names for the interaction types.
TypeName("faceInteraction")
Runtime type information.
interactionType
Enumeration defining the interaction types.
@ STICK
particles stick to the faceZone faces
@ ESCAPE
particles escape/are removed
@ REBOUND
particles rebound from the faceZone faces
bool processParticle(const parcelType &p, const label localZonei)
Return true if this particle will be assessed.
void write()
Write post-processing info.
virtual ~FaceInteraction()=default
Destructor.
CloudType::parcelType parcelType
Convenience typedef for parcel type.
virtual void postFace(const parcelType &p, bool &keepParticle)
Post-face hook.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
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
Base class for writing single files from the function objects.
Definition: writeFile.H:120
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:113
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:107
A class for handling words, derived from Foam::string.
Definition: word.H:68
volScalarField & p
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73