FacePostProcessing.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 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::FacePostProcessing
29
30Group
31 grpLagrangianIntermediateFunctionObjects
32
33Description
34 Records particle face quantities on used-specified face zone
35
36 Currently supports:
37 accumulated mass
38 average mass flux
39
40SourceFiles
41 FacePostProcessing.C
42
43\*---------------------------------------------------------------------------*/
44
45#ifndef FacePostProcessing_H
46#define FacePostProcessing_H
47
48#include "CloudFunctionObject.H"
49#include "faceZone.H"
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace Foam
54{
55
56/*---------------------------------------------------------------------------*\
57 Class FacePostProcessing Declaration
58\*---------------------------------------------------------------------------*/
59
60template<class CloudType>
62:
63 public CloudFunctionObject<CloudType>
64{
65 //- Convenience typedef for parcel type
66 typedef typename CloudType::parcelType parcelType;
67
68
69 // Private Data
70
71 //- Face zone IDs
72 labelList faceZoneIDs_;
73
74 //- Surface output format
75 const word surfaceFormat_;
76
77 //- Should be reset/cleared on writing?
78 bool resetOnWrite_;
79
80 //- Flag to indicate whether data should be written to file
81 bool log_;
82
83 //- Total time
84 scalar totalTime_;
85
86 //- Mass storage
88
89 //- Mass total storage
90 List<scalarField> massTotal_;
91
92 //- Mass flow rate storage
93 List<scalarField> massFlowRate_;
94
95 //- Output file pointer per zone
96 PtrList<OFstream> outputFilePtr_;
97
98 //- Last calculation time
99 scalar timeOld_;
100
101
102 // Private Member Functions
103
104 //- Helper function to create log files
105 void makeLogFile
106 (
107 const word& zoneName,
108 const label zoneI,
109 const label nFaces,
110 const scalar totArea
111 );
112
113
114protected:
115
116 // Protected Member Functions
117
118 //- Write post-processing info
119 void write();
120
121
122public:
123
124 //- Runtime type information
125 TypeName("facePostProcessing");
126
127
128 // Constructors
129
130 //- Construct from dictionary
132 (
133 const dictionary& dict,
135 const word& modelName
136 );
137
138 //- Construct copy
140
141 //- Construct and return a clone
143 {
145 (
147 );
148 }
149
150
151 //- Destructor
152 virtual ~FacePostProcessing() = default;
153
154
155 // Member Functions
156
157 //- Should data be reset on write?
158 inline bool resetOnWrite() const;
159
160 //- Post-face hook
161 virtual void postFace(const parcelType& p, bool& keepParticle);
162};
163
164
165// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166
167} // End namespace Foam
168
169// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170
171#include "FacePostProcessingI.H"
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175#ifdef NoRepository
176 #include "FacePostProcessing.C"
177#endif
178
179// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180
181#endif
182
183// ************************************************************************* //
Templated cloud function object base class.
const CloudType & owner() const
Return const access to the owner cloud.
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 face quantities on used-specified face zone.
virtual autoPtr< CloudFunctionObject< CloudType > > clone() const
Construct and return a clone.
bool resetOnWrite() const
Should data be reset on write?
void write()
Write post-processing info.
TypeName("facePostProcessing")
Runtime type information.
virtual ~FacePostProcessing()=default
Destructor.
virtual void postFace(const parcelType &p, bool &keepParticle)
Post-face hook.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
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
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
const labelList nFaces(UPstream::listGatherValues< label >(aMesh.nFaces()))
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73