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 | Copyright (C) 2011-2012 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::StandardWallInteraction
26 
27 Description
28  Wall interaction model. Three choices:
29  - rebound - optionally specify elasticity and resitution coefficients
30  - stick - particles assigined zero velocity
31  - escape - remove particle from the domain
32 
33  Example usage:
34 
35  StandardWallInteractionCoeffs
36  {
37  type rebound; // stick, escape
38  e 1; // optional - elasticity coeff
39  mu 0; // optional - restitution coeff
40  }
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef StandardWallInteraction_H
45 #define StandardWallInteraction_H
46 
47 #include "PatchInteractionModel.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 /*---------------------------------------------------------------------------*\
54  Class StandardWallInteraction Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 template<class CloudType>
59 :
60  public PatchInteractionModel<CloudType>
61 {
62 protected:
63 
64  // Protected data
65 
66  //- Interaction type
69 
70  //- Elasticity coefficient
71  scalar e_;
72 
73  //- Restitution coefficient
74  scalar mu_;
75 
76 
77  // Counters for particle fates
78 
79  //- Number of parcels escaped
81 
82  //- Mass of parcels escaped
83  scalar massEscape_;
84 
85  //- Number of parcels stuck to patches
86  label nStick_;
87 
88  //- Mass of parcels stuck to patches
89  scalar massStick_;
90 
91 
92 public:
93 
94  //- Runtime type information
95  TypeName("standardWallInteraction");
96 
97 
98  // Constructors
99 
100  //- Construct from dictionary
102 
103  //- Construct copy from owner cloud and patch interaction model
105 
106  //- Construct and return a clone using supplied owner cloud
108  {
110  (
112  );
113  }
114 
115 
116  //- Destructor
117  virtual ~StandardWallInteraction();
118 
119 
120  // Member Functions
121 
122  //- Apply velocity correction
123  // Returns true if particle remains in same cell
124  virtual bool correct
125  (
126  typename CloudType::parcelType& p,
127  const polyPatch& pp,
128  bool& keepParticle,
129  const scalar trackFraction,
130  const tetIndices& tetIs
131  );
132 
133 
134  // I-O
135 
136  //- Write patch interaction info to stream
137  virtual void info(Ostream& os);
138 };
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #ifdef NoRepository
148 # include "StandardWallInteraction.C"
149 #endif
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 #endif
154 
155 // ************************************************************************* //
PatchInteractionModel.H
Foam::StandardWallInteraction::correct
virtual bool correct(typename CloudType::parcelType &p, const polyPatch &pp, bool &keepParticle, const scalar trackFraction, const tetIndices &tetIs)
Apply velocity correction.
Definition: StandardWallInteraction.C:105
p
p
Definition: pEqn.H:62
Foam::StandardWallInteraction::TypeName
TypeName("standardWallInteraction")
Runtime type information.
Foam::StandardWallInteraction
Wall interaction model. Three choices:
Definition: StandardWallInteraction.H:57
StandardWallInteraction.C
Foam::StandardWallInteraction::~StandardWallInteraction
virtual ~StandardWallInteraction()
Destructor.
Definition: StandardWallInteraction.C:97
Foam::PatchInteractionModel
Templated patch interaction model class.
Definition: KinematicCloud.H:82
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::StandardWallInteraction::info
virtual void info(Ostream &os)
Write patch interaction info to stream.
Definition: StandardWallInteraction.C:185
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Foam::StandardWallInteraction::clone
virtual autoPtr< PatchInteractionModel< CloudType > > clone() const
Construct and return a clone using supplied owner cloud.
Definition: StandardWallInteraction.H:106
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:68
Foam::StandardWallInteraction::nEscape_
label nEscape_
Number of parcels escaped.
Definition: StandardWallInteraction.H:79
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::StandardWallInteraction::massStick_
scalar massStick_
Mass of parcels stuck to patches.
Definition: StandardWallInteraction.H:88
Foam::StandardWallInteraction::e_
scalar e_
Elasticity coefficient.
Definition: StandardWallInteraction.H:70
Foam::StandardWallInteraction::interactionType_
PatchInteractionModel< CloudType >::interactionType interactionType_
Interaction type.
Definition: StandardWallInteraction.H:67
Foam::tetIndices
Storage and named access for the indices of a tet which is part of the decomposition of a cell.
Definition: tetIndices.H:73
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::cloud
A cloud is a collection of lagrangian particles.
Definition: cloud.H:51
Foam::StandardWallInteraction::nStick_
label nStick_
Number of parcels stuck to patches.
Definition: StandardWallInteraction.H:85
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:217
Foam::StandardWallInteraction::massEscape_
scalar massEscape_
Mass of parcels escaped.
Definition: StandardWallInteraction.H:82
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::StandardWallInteraction::StandardWallInteraction
StandardWallInteraction(const dictionary &dict, CloudType &cloud)
Construct from dictionary.
Definition: StandardWallInteraction.C:32
Foam::StandardWallInteraction::mu_
scalar mu_
Restitution coefficient.
Definition: StandardWallInteraction.H:73