PatchCollisionDensity.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2018 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::PatchCollisionDensity
26 
27 Description
28  Function object which generates fields of the number and rate of collisions
29  per unit area on all patches. Can optionally take a minimum speed below
30  which a collision is not counted.
31 
32  Example usage:
33  \verbatim
34  patchCollisionDensity1
35  {
36  type patchCollisionDensity;
37  minSpeed 1e-3;
38  }
39  \endverbatim
40 
41 SourceFiles
42  PatchCollisionDensity.C
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef PatchCollisionDensity_H
47 #define PatchCollisionDensity_H
48 
49 #include "CloudFunctionObject.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class PatchCollisionDensity Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 template<class CloudType>
62 :
63  public CloudFunctionObject<CloudType>
64 {
65  // Private data
66 
67  typedef typename CloudType::particleType parcelType;
68 
69  //- The threshold for a collision
70  const scalar minSpeed_;
71 
72  //- The field of the number of collisions per unit area
73  volScalarField::Boundary collisionDensity_;
74 
75  //- The field of the number of collisions per unit area at the last
76  // output
77  volScalarField::Boundary collisionDensity0_;
78 
79  //- The time at the last output
80  scalar time0_;
81 
82 
83 protected:
84 
85  // Protected Member Functions
86 
87  //- Write post-processing info
88  void write();
89 
90 
91 public:
92 
93  //- Runtime type information
94  TypeName("patchCollisionDensity");
95 
96 
97  // Constructors
98 
99  //- Construct from dictionary
101  (
102  const dictionary& dict,
103  CloudType& owner,
104  const word& modelName
105  );
106 
107  //- Construct copy
109 
110  //- Construct and return a clone
112  {
114  (
116  );
117  }
118 
119 
120  //- Destructor
121  virtual ~PatchCollisionDensity();
122 
123 
124  // Member Functions
125 
126  // Evaluation
127 
128  //- Post-patch hook
129  virtual void postPatch
130  (
131  const parcelType& p,
132  const polyPatch& pp,
133  bool& keepParticle
134  );
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #ifdef NoRepository
145  #include "PatchCollisionDensity.C"
146 #endif
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #endif
151 
152 // ************************************************************************* //
ParcelType particleType
Definition: Cloud.H:105
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
void write()
Write post-processing info.
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:104
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
const CloudType & owner() const
Return const access to the owner cloud.
virtual ~PatchCollisionDensity()
Destructor.
virtual autoPtr< CloudFunctionObject< CloudType > > clone() const
Construct and return a clone.
TypeName("patchCollisionDensity")
Runtime type information.
A class for handling words, derived from string.
Definition: word.H:59
virtual void postPatch(const parcelType &p, const polyPatch &pp, bool &keepParticle)
Post-patch hook.
Function object which generates fields of the number and rate of collisions per unit area on all patc...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
volScalarField & p
PatchCollisionDensity(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:69
Templated cloud function object base class.
Namespace for OpenFOAM.