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-2022 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 mass and rates
29  thereof of collisions per unit area on all patches. Can optionally take a
30  minimum speed below 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 numberCollisionDensity_;
74 
75  //- The field of the number of collisions per unit area at the last
76  // output
77  volScalarField::Boundary numberCollisionDensity0_;
78 
79  //- The field of the mass of collisions per unit area
80  volScalarField::Boundary massCollisionDensity_;
81 
82  //- The field of the mass of collisions per unit area at the last
83  // output
84  volScalarField::Boundary massCollisionDensity0_;
85 
86  //- The time at the last output
87  scalar time0_;
88 
89 
90 protected:
91 
92  // Protected Member Functions
93 
94  //- Write post-processing info
95  void write();
96 
97 
98 public:
99 
100  //- Runtime type information
101  TypeName("patchCollisionDensity");
102 
103 
104  // Constructors
105 
106  //- Construct from dictionary
108  (
109  const dictionary& dict,
110  CloudType& owner,
111  const word& modelName
112  );
113 
114  //- Construct copy
116 
117  //- Construct and return a clone
119  {
121  (
123  );
124  }
125 
126 
127  //- Destructor
128  virtual ~PatchCollisionDensity();
129 
130 
131  // Member Functions
132 
133  // Evaluation
134 
135  //- Pre-evolve hook
136  virtual void preEvolve();
137 
138  //- Post-patch hook
139  virtual void postPatch(const parcelType& p, const polyPatch& pp);
140 };
141 
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 } // End namespace Foam
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 #ifdef NoRepository
150  #include "PatchCollisionDensity.C"
151 #endif
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #endif
156 
157 // ************************************************************************* //
Templated cloud function object base class.
const CloudType & owner() const
Return const access to the owner cloud.
ParcelType particleType
Definition: Cloud.H:128
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:79
Generic GeometricBoundaryField class.
Function object which generates fields of the number and mass and rates thereof of collisions per uni...
PatchCollisionDensity(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
virtual void postPatch(const parcelType &p, const polyPatch &pp)
Post-patch hook.
virtual ~PatchCollisionDensity()
Destructor.
TypeName("patchCollisionDensity")
Runtime type information.
void write()
Write post-processing info.
virtual autoPtr< CloudFunctionObject< CloudType > > clone() const
Construct and return a clone.
virtual void preEvolve()
Pre-evolve hook.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:70
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:104
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
volScalarField & p