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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::StandardWallInteraction
29 
30 Group
31  grpLagrangianIntermediatePatchInteractionSubModels
32 
33 Description
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 
51 Note
52  - \c mu=1 results in perfectly inelastic collisions.
53 
54 \*---------------------------------------------------------------------------*/
55 
56 #ifndef StandardWallInteraction_H
57 #define StandardWallInteraction_H
58 
59 #include "PatchInteractionModel.H"
60 
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 
63 namespace Foam
64 {
65 /*---------------------------------------------------------------------------*\
66  Class StandardWallInteraction Declaration
67 \*---------------------------------------------------------------------------*/
68 
69 template<class CloudType>
71 :
72  public PatchInteractionModel<CloudType>
73 {
74 protected:
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
96 
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
108  bool outputByInjectorId_;
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 
121 public:
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
173  #include "StandardWallInteraction.C"
174 #endif
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #endif
179 
180 // ************************************************************************* //
virtual void info()
Write patch interaction info.
scalar mu_
The unity minus the restitution coefficient.
virtual void writeFileHeader(Ostream &os)
Output file header information.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
List< List< label > > nStick_
Number of parcels stuck to patches.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:56
virtual bool correct(typename CloudType::parcelType &p, const polyPatch &pp, bool &keepParticle)
Apply velocity correction.
List< List< scalar > > massStick_
Mass of parcels stuck to patches.
virtual autoPtr< PatchInteractionModel< CloudType > > clone() const
Construct and return a clone using supplied owner cloud.
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:104
Templated patch interaction model class.
PatchInteractionModel< CloudType >::interactionType interactionType_
Interaction type.
A cloud is a registry collection of lagrangian particles.
Definition: cloud.H:53
scalar e_
Elasticity coefficient.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:290
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
OBJstream os(runTime.globalPath()/outputName)
List< List< scalar > > massEscape_
Mass of parcels escaped.
bool outputByInjectorId_
Flag to output escaped/mass particles sorted by injectorID.
virtual ~StandardWallInteraction()=default
Destructor.
Map< label > injIdToIndex_
InjectorId to index map, when outputting escaped/stick/...
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
StandardWallInteraction(const dictionary &dict, CloudType &cloud)
Construct from dictionary.
List< List< label > > nEscape_
Number of parcels escaped.
TypeName("standardWallInteraction")
Runtime type information.
volScalarField & p
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:69
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:67
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
Namespace for OpenFOAM.