PatchCollisionDensity.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) 2018 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::PatchCollisionDensity
28
29Description
30 Function object which generates fields of the number and rate of collisions
31 per unit area on all patches. Can optionally take a minimum speed below
32 which a collision is not counted.
33
34 Example usage:
35 \verbatim
36 patchCollisionDensity1
37 {
38 type patchCollisionDensity;
39 minSpeed 1e-3;
40 }
41 \endverbatim
42
43SourceFiles
44 PatchCollisionDensity.C
45
46\*---------------------------------------------------------------------------*/
47
48#ifndef PatchCollisionDensity_H
49#define PatchCollisionDensity_H
50
51#include "CloudFunctionObject.H"
52
53// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54
55namespace Foam
56{
57
58/*---------------------------------------------------------------------------*\
59 Class PatchCollisionDensity Declaration
60\*---------------------------------------------------------------------------*/
61
62template<class CloudType>
64:
65 public CloudFunctionObject<CloudType>
66{
67 // Private data
68
69 typedef typename CloudType::particleType parcelType;
70
71 //- The threshold for a collision
72 const scalar minSpeed_;
73
74 //- The field of the number of collisions per unit area
75 volScalarField::Boundary collisionDensity_;
76
77 //- The field of the number of collisions per unit area at the last
78 // output
79 volScalarField::Boundary collisionDensity0_;
80
81 //- The time at the last output
82 scalar time0_;
83
84
85protected:
86
87 // Protected Member Functions
88
89 //- Write post-processing info
90 void write();
91
92
93public:
94
95 //- Runtime type information
96 TypeName("patchCollisionDensity");
97
98
99 // Constructors
100
101 //- Construct from dictionary
103 (
104 const dictionary& dict,
106 const word& modelName
107 );
108
109 //- Construct copy
111
112 //- Construct and return a clone
114 {
116 (
118 );
119 }
120
121
122 //- Destructor
123 virtual ~PatchCollisionDensity() = default;
124
125
126 // Member Functions
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// ************************************************************************* //
Templated cloud function object base class.
const CloudType & owner() const
Return const access to the owner cloud.
ParticleType particleType
Definition: Cloud.H:114
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
Function object which generates fields of the number and rate of collisions per unit area on all patc...
virtual autoPtr< CloudFunctionObject< CloudType > > clone() const
Construct and return a clone.
virtual void postPatch(const parcelType &p, const polyPatch &pp, bool &keepParticle)
Post-patch hook.
TypeName("patchCollisionDensity")
Runtime type information.
void write()
Write post-processing info.
virtual ~PatchCollisionDensity()=default
Destructor.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:113
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:107
A class for handling words, derived from Foam::string.
Definition: word.H:68
volScalarField & p
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73