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 | Copyright (C) 2011-2013 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::FacePostProcessing
26 
27 Description
28  Records particle face quantities on used-specified face zone
29 
30  Currently supports:
31  accummulated mass
32  average mass flux
33 
34 SourceFiles
35  FacePostProcessing.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef FacePostProcessing_H
40 #define FacePostProcessing_H
41 
42 #include "CloudFunctionObject.H"
43 #include "faceZone.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class FacePostProcessing Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class CloudType>
56 :
57  public CloudFunctionObject<CloudType>
58 {
59  // Private Data
60 
61  // Typedefs
62 
63  //- Convenience typedef for parcel type
64  typedef typename CloudType::parcelType parcelType;
65 
66 
67  //- Face zone IDs
69 
70  //- Surface output format
71  const word surfaceFormat_;
72 
73  //- Flag to indicate whether data should be reset/cleared on writing
75 
76  //- Total time
77  scalar totalTime_;
78 
79  //- Mass storage
81 
82  //- Mass total storage
84 
85  //- Mass flow rate storage
87 
88  //- Flag to indicate whether data should be written to file
89  Switch log_;
90 
91  //- Output file pointer per zone
93 
94  //- Last calculation time
95  scalar timeOld_;
96 
97 
98  // Private Member Functions
99 
100  //- Helper function to create log files
101  void makeLogFile
102  (
103  const word& zoneName,
104  const label zoneI,
105  const label nFaces,
106  const scalar totArea
107  );
108 
109 
110 protected:
111 
112  // Protected Member Functions
113 
114  //- Write post-processing info
115  void write();
116 
117 
118 public:
119 
120  //- Runtime type information
121  TypeName("facePostProcessing");
122 
123 
124  // Constructors
125 
126  //- Construct from dictionary
128  (
129  const dictionary& dict,
130  CloudType& owner,
131  const word& modelName
132  );
133 
134  //- Construct copy
136 
137  //- Construct and return a clone
139  {
141  (
143  );
144  }
145 
146 
147  //- Destructor
148  virtual ~FacePostProcessing();
149 
150 
151  // Member Functions
152 
153  // Access
154 
155  //- Return const access to the reset on write flag
156  inline const Switch& resetOnWrite() const;
157 
158 
159  // Evaluation
160 
161  //- Post-face hook
162  virtual void postFace
163  (
164  const parcelType& p,
165  const label faceI,
166  bool& keepParticle
167  );
168 };
169 
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #include "FacePostProcessingI.H"
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #ifdef NoRepository
182 # include "FacePostProcessing.C"
183 #endif
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
Foam::FacePostProcessing::makeLogFile
void makeLogFile(const word &zoneName, const label zoneI, const label nFaces, const scalar totArea)
Helper function to create log files.
Definition: FacePostProcessing.C:36
Foam::FacePostProcessing::mass_
List< scalarField > mass_
Mass storage.
Definition: FacePostProcessing.H:79
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:60
p
p
Definition: pEqn.H:62
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::FacePostProcessing::log_
Switch log_
Flag to indicate whether data should be written to file.
Definition: FacePostProcessing.H:88
Foam::FacePostProcessing::massTotal_
List< scalarField > massTotal_
Mass total storage.
Definition: FacePostProcessing.H:82
Foam::CloudSubModelBase::owner
const CloudType & owner() const
Return const access to the owner cloud.
Definition: CloudSubModelBase.C:103
Foam::subModelBase::modelName
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:104
Foam::FacePostProcessing::timeOld_
scalar timeOld_
Last calculation time.
Definition: FacePostProcessing.H:94
CloudFunctionObject.H
Foam::FacePostProcessing
Records particle face quantities on used-specified face zone.
Definition: FacePostProcessing.H:54
Foam::FacePostProcessing::~FacePostProcessing
virtual ~FacePostProcessing()
Destructor.
Definition: FacePostProcessing.C:356
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::subModelBase::dict
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
Foam::FacePostProcessing::faceZoneIDs_
labelList faceZoneIDs_
Face zone IDs.
Definition: FacePostProcessing.H:67
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:68
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::FacePostProcessing::outputFilePtr_
PtrList< OFstream > outputFilePtr_
Output file pointer per zone.
Definition: FacePostProcessing.H:91
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::FacePostProcessing::resetOnWrite
const Switch & resetOnWrite() const
Return const access to the reset on write flag.
Definition: FacePostProcessingI.H:28
Foam::FacePostProcessing::FacePostProcessing
FacePostProcessing(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
Definition: FacePostProcessing.C:252
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::FacePostProcessing::surfaceFormat_
const word surfaceFormat_
Surface output format.
Definition: FacePostProcessing.H:70
Foam::FacePostProcessing::TypeName
TypeName("facePostProcessing")
Runtime type information.
Foam::FacePostProcessing::resetOnWrite_
Switch resetOnWrite_
Flag to indicate whether data should be reset/cleared on writing.
Definition: FacePostProcessing.H:73
FacePostProcessingI.H
Foam::FacePostProcessing::postFace
virtual void postFace(const parcelType &p, const label faceI, bool &keepParticle)
Post-face hook.
Definition: FacePostProcessing.C:364
faceZone.H
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::CloudFunctionObject
Templated cloud function object base class.
Definition: CloudFunctionObject.H:56
Foam::FacePostProcessing::massFlowRate_
List< scalarField > massFlowRate_
Mass flow rate storage.
Definition: FacePostProcessing.H:85
Foam::FacePostProcessing::write
void write()
Write post-processing info.
Definition: FacePostProcessing.C:78
Foam::FacePostProcessing::totalTime_
scalar totalTime_
Total time.
Definition: FacePostProcessing.H:76
FacePostProcessing.C
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:217
Foam::FacePostProcessing::parcelType
CloudType::parcelType parcelType
Convenience typedef for parcel type.
Definition: FacePostProcessing.H:63
Foam::FacePostProcessing::clone
virtual autoPtr< CloudFunctionObject< CloudType > > clone() const
Construct and return a clone.
Definition: FacePostProcessing.H:137