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 -------------------------------------------------------------------------------
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 - restitution coeff
48  }
49  \endverbatim
50 
51 \*---------------------------------------------------------------------------*/
52 
53 #ifndef StandardWallInteraction_H
54 #define StandardWallInteraction_H
55 
56 #include "PatchInteractionModel.H"
57 
58 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 
60 namespace Foam
61 {
62 /*---------------------------------------------------------------------------*\
63  Class StandardWallInteraction Declaration
64 \*---------------------------------------------------------------------------*/
65 
66 template<class CloudType>
68 :
69  public PatchInteractionModel<CloudType>
70 {
71 protected:
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
105  bool outputByInjectorId_;
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 
118 public:
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
170  #include "StandardWallInteraction.C"
171 #endif
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #endif
176 
177 // ************************************************************************* //
PatchInteractionModel.H
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::StandardWallInteraction::nStick_
List< List< label > > nStick_
Number of parcels stuck to patches.
Definition: StandardWallInteraction.H:97
Foam::StandardWallInteraction::outputByInjectorId_
bool outputByInjectorId_
Flag to output escaped/mass particles sorted by injectorID.
Definition: StandardWallInteraction.H:104
Foam::StandardWallInteraction::TypeName
TypeName("standardWallInteraction")
Runtime type information.
Foam::StandardWallInteraction
Wall interaction model.
Definition: StandardWallInteraction.H:66
Foam::Map< label >
Foam::StandardWallInteraction::injIdToIndex_
Map< label > injIdToIndex_
InjectorId to index map, when outputting escaped/stick/...
Definition: StandardWallInteraction.H:108
StandardWallInteraction.C
Foam::PatchInteractionModel
Templated patch interaction model class.
Definition: KinematicCloud.H:89
Foam::StandardWallInteraction::info
virtual void info(Ostream &os)
Write patch interaction info to stream.
Definition: StandardWallInteraction.C:260
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::StandardWallInteraction::clone
virtual autoPtr< PatchInteractionModel< CloudType > > clone() const
Construct and return a clone using supplied owner cloud.
Definition: StandardWallInteraction.H:132
Foam::StandardWallInteraction::massEscape_
List< List< scalar > > massEscape_
Mass of parcels escaped.
Definition: StandardWallInteraction.H:94
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
Foam::StandardWallInteraction::massStick_
List< List< scalar > > massStick_
Mass of parcels stuck to patches.
Definition: StandardWallInteraction.H:100
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::StandardWallInteraction::writeFileHeader
virtual void writeFileHeader(Ostream &os)
Output file header information.
Definition: StandardWallInteraction.C:34
Foam::StandardWallInteraction::e_
scalar e_
Elasticity coefficient.
Definition: StandardWallInteraction.H:82
Foam::StandardWallInteraction::interactionType_
PatchInteractionModel< CloudType >::interactionType interactionType_
Interaction type.
Definition: StandardWallInteraction.H:79
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::cloud
A cloud is a registry collection of lagrangian particles.
Definition: cloud.H:57
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
Foam::StandardWallInteraction::~StandardWallInteraction
virtual ~StandardWallInteraction()=default
Destructor.
Foam::StandardWallInteraction::correct
virtual bool correct(typename CloudType::parcelType &p, const polyPatch &pp, bool &keepParticle)
Apply velocity correction.
Definition: StandardWallInteraction.C:153
Foam::StandardWallInteraction::mesh_
const fvMesh & mesh_
Definition: StandardWallInteraction.H:75
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Foam::PatchInteractionModel::interactionType
interactionType
Definition: PatchInteractionModel.H:73
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::StandardWallInteraction::StandardWallInteraction
StandardWallInteraction(const dictionary &dict, CloudType &cloud)
Construct from dictionary.
Definition: StandardWallInteraction.C:58
Foam::StandardWallInteraction::nEscape_
List< List< label > > nEscape_
Number of parcels escaped.
Definition: StandardWallInteraction.H:91
Foam::StandardWallInteraction::mu_
scalar mu_
Restitution coefficient.
Definition: StandardWallInteraction.H:85