Loading...
Searching...
No Matches
StandardWallInteraction.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 Copyright (C) 2018-2023 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::StandardWallInteraction
29
30Group
31 grpLagrangianIntermediatePatchInteractionSubModels
32
33Description
34 Wall interaction model.
35
36 Three choices:
37 - rebound - optionally specify elasticity and restitution coefficients
38 - stick - particles assigned zero velocity
39 - escape - remove particle from the domain
40
41 Example usage:
42 \verbatim
43 StandardWallInteractionCoeffs
44 {
45 type rebound; // stick, escape
46 e 1; // optional - elasticity coeff
47 mu 0; // optional - (1 - restitution coeff)
48 }
49 \endverbatim
50
51Note
52 - \c mu=1 results in perfectly inelastic collisions.
53
54\*---------------------------------------------------------------------------*/
55
56#ifndef StandardWallInteraction_H
57#define StandardWallInteraction_H
58
60
61// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62
63namespace Foam
64{
65/*---------------------------------------------------------------------------*\
66 Class StandardWallInteraction Declaration
67\*---------------------------------------------------------------------------*/
68
69template<class CloudType>
71:
72 public PatchInteractionModel<CloudType>
73{
74protected:
75
76 // Protected data
77
78 // Reference to mesh
79 const fvMesh& mesh_;
80
81 //- Interaction type
84
85 //- Elasticity coefficient
86 scalar e_;
87
88 //- The unity minus the restitution coefficient
89 scalar mu_;
90
91
92 // Bookkeeping for particle fates
93
94 //- Number of parcels escaped
97 //- Mass of parcels escaped
99
100 //- Number of parcels stuck to patches
102
103 //- Mass of parcels stuck to patches
105
107 //- Flag to output escaped/mass particles sorted by injectorID
109
110 //- InjectorId to index map, when outputting escaped/stick/...
111 // particles sorted by injectorID
113
114
115 // Protected Member Functions
116
117 //- Output file header information
118 virtual void writeFileHeader(Ostream& os);
119
120
121public:
122
123 //- Runtime type information
124 TypeName("standardWallInteraction");
125
126
127 // Constructors
128
129 //- Construct from dictionary
131
132 //- Construct copy from owner cloud and patch interaction model
134
135 //- Construct and return a clone using supplied owner cloud
137 {
139 (
141 );
142 }
143
144
145 //- Destructor
146 virtual ~StandardWallInteraction() = default;
147
148
149 // Member Functions
150
151 //- Apply velocity correction
152 // Returns true if particle remains in same cell
153 virtual bool correct
154 (
155 typename CloudType::parcelType& p,
156 const polyPatch& pp,
157 bool& keepParticle
158 );
159
160
161 //- Write patch interaction info
162 virtual void info();
163};
164
165
166// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167
168} // End namespace Foam
169
170// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171
172#ifdef NoRepository
174#endif
175
176// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177
178#endif
179
180// ************************************************************************* //
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
A HashTable to objects of type <T> with a label key.
Definition Map.H:54
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
PatchInteractionModel(CloudType &owner)
Construct null from owner.
List< List< scalar > > massStick_
Mass of parcels stuck to patches.
List< List< label > > nStick_
Number of parcels stuck to patches.
StandardWallInteraction(const dictionary &dict, CloudType &cloud)
Construct from dictionary.
scalar mu_
The unity minus the restitution coefficient.
virtual autoPtr< PatchInteractionModel< CloudType > > clone() const
Construct and return a clone using supplied owner cloud.
TypeName("standardWallInteraction")
Runtime type information.
Map< label > injIdToIndex_
InjectorId to index map, when outputting escaped/stick/...
List< List< label > > nEscape_
Number of parcels escaped.
scalar e_
Elasticity coefficient.
virtual void info()
Write patch interaction info.
virtual void writeFileHeader(Ostream &os)
Output file header information.
virtual ~StandardWallInteraction()=default
Destructor.
List< List< scalar > > massEscape_
Mass of parcels escaped.
PatchInteractionModel< CloudType >::interactionType interactionType_
Interaction type.
bool outputByInjectorId_
Flag to output escaped/mass particles sorted by injectorID.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A cloud is a registry collection of lagrangian particles.
Definition cloud.H:56
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
A patch is a list of labels that address the faces in the global face list.
Definition polyPatch.H:73
const dictionary & dict() const
Return const access to the cloud dictionary.
volScalarField & p
thermo correct()
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
DSMCCloud< dsmcParcel > CloudType
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68