ParticleTracks.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) 2019-2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::ParticleTracks
29
30Group
31 grpLagrangianIntermediateFunctionObjects
32
33Description
34 Records particle state (all variables) on each call to postFace
35
36SourceFiles
37 ParticleTracks.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef ParticleTracks_H
42#define ParticleTracks_H
43
44#include "CloudFunctionObject.H"
45#include "labelPairHashes.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52/*---------------------------------------------------------------------------*\
53 Class ParticleTracks Declaration
54\*---------------------------------------------------------------------------*/
55
56template<class CloudType>
58:
59 public CloudFunctionObject<CloudType>
60{
61 //- Convenience typedef for parcel type
62 typedef typename CloudType::parcelType parcelType;
63
64
65 // Private Data
66
67 //- Number of face-hit intervals between storing parcel data
68 label trackInterval_;
69
70 //- Maximum number of particles to store per track
71 label maxSamples_;
72
73 //- Should data should be reset/cleared on writing?
74 bool resetOnWrite_;
75
76 //- Table of number of times a particle has hit a face
77 labelPairLookup faceHitCounter_;
78
79 //- Pointer to the cloud storage
81
82
83protected:
84
85 // Protected Member Functions
86
87 //- Write post-processing info
88 void write();
89
90
91public:
92
93 //- Runtime type information
94 TypeName("particleTracks");
95
96
97 // Constructors
98
99 //- Construct from dictionary
101 (
102 const dictionary& dict,
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 ~ParticleTracks() = default;
122
123
124 // Member Functions
125
126 // Access
127
128 //- Return const access to the track interval
129 inline label trackInterval() const;
130
131 //- Return const access to the max samples
132 inline label maxSamples() const;
133
134 //- Should data be reset on write?
135 inline bool resetOnWrite() const;
136
137 //- Return the table of number of times a particle has hit a face
138 inline const labelPairLookup& faceHitCounter() const;
139
140 //- Return const access to the cloud
141 inline const Cloud<parcelType>& cloud() const;
142
143
144 // Evaluation
145
146 //- Pre-evolve hook
147 virtual void preEvolve
148 (
149 const typename parcelType::trackingData& td
150 );
151
152 //- Post-face hook
153 virtual void postFace(const parcelType& p, bool& keepParticle);
154};
155
156
157// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158
159} // End namespace Foam
160
161// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162
163#include "ParticleTracksI.H"
164
165// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166
167#ifdef NoRepository
168 #include "ParticleTracks.C"
169#endif
170
171// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172
173#endif
174
175// ************************************************************************* //
Templated cloud function object base class.
const CloudType & owner() const
Return const access to the owner cloud.
Base cloud calls templated on particle type.
Definition: Cloud.H:68
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Records particle state (all variables) on each call to postFace.
virtual autoPtr< CloudFunctionObject< CloudType > > clone() const
Construct and return a clone.
TypeName("particleTracks")
Runtime type information.
bool resetOnWrite() const
Should data be reset on write?
const Cloud< parcelType > & cloud() const
Return const access to the cloud.
label trackInterval() const
Return const access to the track interval.
void write()
Write post-processing info.
virtual ~ParticleTracks()=default
Destructor.
virtual void preEvolve(const typename parcelType::trackingData &td)
Pre-evolve hook.
label maxSamples() const
Return const access to the max samples.
virtual void postFace(const parcelType &p, bool &keepParticle)
Post-face hook.
const labelPairLookup & faceHitCounter() const
Return the table of number of times a particle has hit a face.
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
Class used to pass data into container.
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
A HashTable to objects of type <T> with a labelPair key. The hashing is based on labelPair (FixedList...
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73