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-2019 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 - restitution coeff
48 }
49 \endverbatim
50
51\*---------------------------------------------------------------------------*/
52
53#ifndef StandardWallInteraction_H
54#define StandardWallInteraction_H
55
57
58// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59
60namespace Foam
61{
62/*---------------------------------------------------------------------------*\
63 Class StandardWallInteraction Declaration
64\*---------------------------------------------------------------------------*/
65
66template<class CloudType>
68:
69 public PatchInteractionModel<CloudType>
70{
71protected:
72
73 // Protected data
74
75 // Reference to mesh
76 const fvMesh& mesh_;
77
78 //- Interaction type
81
82 //- Elasticity coefficient
83 scalar e_;
84
85 //- Restitution coefficient
86 scalar mu_;
87
88
89 // Bookkeeping for particle fates
90
91 //- Number of parcels escaped
93
94 //- Mass of parcels escaped
96
97 //- Number of parcels stuck to patches
99
100 //- Mass of parcels stuck to patches
102
103
104 //- Flag to output escaped/mass particles sorted by injectorID
106
107 //- InjectorId to index map, when outputting escaped/stick/...
108 // particles sorted by injectorID
110
111
112 // Protected Member Functions
113
114 //- Output file header information
115 virtual void writeFileHeader(Ostream& os);
116
117
118public:
119
120 //- Runtime type information
121 TypeName("standardWallInteraction");
122
123
124 // Constructors
125
126 //- Construct from dictionary
128
129 //- Construct copy from owner cloud and patch interaction model
131
132 //- Construct and return a clone using supplied owner cloud
134 {
136 (
138 );
139 }
140
141
142 //- Destructor
143 virtual ~StandardWallInteraction() = default;
144
145
146 // Member Functions
147
148 //- Apply velocity correction
149 // Returns true if particle remains in same cell
150 virtual bool correct
151 (
152 typename CloudType::parcelType& p,
153 const polyPatch& pp,
154 bool& keepParticle
155 );
156
157
158 //- Write patch interaction info to stream
159 virtual void info(Ostream& os);
160};
161
162
163// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164
165} // End namespace Foam
166
167// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168
169#ifdef NoRepository
171#endif
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175#endif
176
177// ************************************************************************* //
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 array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
A HashTable to objects of type <T> with a label key.
Definition: Map.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Templated patch interaction model class.
List< List< scalar > > massStick_
Mass of parcels stuck to patches.
List< List< label > > nStick_
Number of parcels stuck to patches.
virtual void info(Ostream &os)
Write patch interaction info to stream.
scalar mu_
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 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:66
A cloud is a registry collection of lagrangian particles.
Definition: cloud.H:60
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:113
volScalarField & p
thermo correct()
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73