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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::FacePostProcessing
29 
30 Group
31  grpLagrangianIntermediateFunctionObjects
32 
33 Description
34  Records particle face quantities on used-specified face zone
35 
36  Currently supports:
37  accumulated mass
38  average mass flux
39 
40 SourceFiles
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 
53 namespace Foam
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class FacePostProcessing Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 template<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
87  List<scalarField> mass_;
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 
114 protected:
115 
116  // Protected Member Functions
117 
118  //- Write post-processing info
119  void write();
120 
121 
122 public:
123 
124  //- Runtime type information
125  TypeName("facePostProcessing");
126 
127 
128  // Constructors
129 
130  //- Construct from dictionary
132  (
133  const dictionary& dict,
134  CloudType& owner,
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 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::subModelBase::modelName
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:107
CloudFunctionObject.H
Foam::FacePostProcessing
Records particle face quantities on used-specified face zone.
Definition: FacePostProcessing.H:60
Foam::subModelBase::dict
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:113
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::CloudSubModelBase::owner
const CloudType & owner() const
Return const access to the owner cloud.
Definition: CloudSubModelBase.C:106
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::FacePostProcessing::postFace
virtual void postFace(const parcelType &p, bool &keepParticle)
Post-face hook.
Definition: FacePostProcessing.C:353
Foam::FacePostProcessing::FacePostProcessing
FacePostProcessing(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
Definition: FacePostProcessing.C:249
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::FacePostProcessing::TypeName
TypeName("facePostProcessing")
Runtime type information.
Foam::FacePostProcessing::~FacePostProcessing
virtual ~FacePostProcessing()=default
Destructor.
FacePostProcessingI.H
faceZone.H
Foam::List< label >
Foam::CloudFunctionObject
Templated cloud function object base class.
Definition: CloudFunctionObject.H:62
Foam::FacePostProcessing::write
void write()
Write post-processing info.
Definition: FacePostProcessing.C:83
Foam::FacePostProcessing::resetOnWrite
bool resetOnWrite() const
Should data be reset on write?
Definition: FacePostProcessingI.H:30
FacePostProcessing.C
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Foam::FacePostProcessing::clone
virtual autoPtr< CloudFunctionObject< CloudType > > clone() const
Construct and return a clone.
Definition: FacePostProcessing.H:141