This function object calculates the flux across selections of faces. More...
Public Types | |
enum | modeType { mdFaceZone, mdFaceZoneAndDirection, mdCellZoneAndDirection } |
Face mode type. More... | |
Public Member Functions | |
TypeName ("fluxSummary") | |
Runtime type information. More... | |
fluxSummary (const word &name, const objectRegistry &, const dictionary &, const bool loadFromFiles=false) | |
Construct for given objectRegistry and dictionary. More... | |
virtual | ~fluxSummary () |
Destructor. More... | |
virtual const word & | name () const |
Return name of the set of field min/max. More... | |
virtual void | read (const dictionary &) |
Read the field min/max data. More... | |
virtual void | execute () |
Execute, currently does nothing. More... | |
virtual void | end () |
Execute at the final time-loop, currently does nothing. More... | |
virtual void | timeSet () |
Called when time was set at the end of the Time::operator++. More... | |
virtual void | write () |
Write the fluxSummary. More... | |
virtual void | updateMesh (const mapPolyMesh &) |
Update for changes of mesh. More... | |
virtual void | movePoints (const polyMesh &) |
Update for changes of mesh. More... | |
![]() | |
functionObjectFile (const objectRegistry &obr, const word &prefix) | |
Construct null. More... | |
functionObjectFile (const objectRegistry &obr, const word &prefix, const word &fileName, const dictionary &dict) | |
Construct from components and read options from dictionary. More... | |
virtual | ~functionObjectFile () |
Destructor. More... | |
void | read (const dictionary &dict) |
Read. More... | |
OFstream & | file () |
Return access to the file (if only 1) More... | |
bool | writeToFile () const |
Return true if can write to file. More... | |
void | writeCommented (Ostream &os, const string &str) const |
Write a commented string to stream. More... | |
void | writeTabbed (Ostream &os, const string &str) const |
Write a tabbed string to stream. More... | |
void | writeHeader (Ostream &os, const string &str) const |
Write a commented header to stream. More... | |
void | writeTime (Ostream &os) const |
Write the current time to stream. More... | |
template<class Type > | |
void | writeHeaderValue (Ostream &os, const string &property, const Type &value) const |
Write a (commented) header property and value pair. More... | |
label | charWidth () const |
Return width of character stream output. More... | |
Static Public Attributes | |
static const NamedEnum< modeType, 3 > | modeTypeNames_ |
Mode type names. More... | |
![]() | |
static const word | outputPrefix = "postProcessing" |
Directory prefix. More... | |
static label | addChars = 7 |
Additional characters for writing. More... | |
Protected Member Functions | |
void | initialiseFaceZone (const word &faceZoneName, DynamicList< word > &faceZoneNames, DynamicList< List< label > > &faceID, DynamicList< List< label > > &facePatchID, DynamicList< List< scalar > > &faceSign) const |
Initialise face set from face zone. More... | |
void | initialiseFaceZoneAndDirection (const word &faceZoneName, const vector &refDir, DynamicList< vector > &dir, DynamicList< word > &faceZoneNames, DynamicList< List< label > > &faceID, DynamicList< List< label > > &facePatchID, DynamicList< List< scalar > > &faceSign) const |
Initialise face set from face zone and direction. More... | |
void | initialiseCellZoneAndDirection (const word &cellZoneName, const vector &refDir, DynamicList< vector > &dir, DynamicList< word > &faceZoneNames, DynamicList< List< label > > &faceID, DynamicList< List< label > > &facePatchID, DynamicList< List< scalar > > &faceSign) const |
Initialise face set from cell zone and direction. More... | |
void | initialiseFaceArea () |
Initialise the total area per derived faceZone. More... | |
virtual void | writeFileHeader (const word &fzName, const scalar area, const vector &refDir, Ostream &os) const |
Output file header information. More... | |
fluxSummary (const fluxSummary &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const fluxSummary &) |
Disallow default bitwise assignment. More... | |
![]() | |
virtual void | initStream (Ostream &os) const |
Initialise the output stream for writing. More... | |
virtual fileName | baseFileDir () const |
Return the base directory for output. More... | |
virtual fileName | baseTimeDir () const |
Return the base directory for the current time value. More... | |
virtual autoPtr< OFstream > | createFile (const word &name) const |
Return an autoPtr to a new file. More... | |
virtual void | resetFile (const word &name) |
Reset internal file pointer to new file with new name. More... | |
virtual Omanip< int > | valueWidth (const label offset=0) const |
Return the value width when writing to stream with optional offset. More... | |
functionObjectFile (const functionObjectFile &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const functionObjectFile &) |
Disallow default bitwise assignment. More... | |
Protected Attributes | |
word | name_ |
Name of function object. More... | |
const objectRegistry & | obr_ |
Reference to the database. More... | |
bool | active_ |
on/off switch More... | |
Switch | log_ |
Switch to send output to Info as well. More... | |
modeType | mode_ |
Mode for face determination. More... | |
scalar | scaleFactor_ |
Scale factor. More... | |
word | phiName_ |
Name of flux field, default = phi. More... | |
List< word > | faceZoneName_ |
Region names. More... | |
List< vector > | refDir_ |
Reference direction. More... | |
List< List< label > > | faceID_ |
Face IDs. More... | |
List< List< label > > | facePatchID_ |
Face patch IDs. More... | |
List< List< scalar > > | faceSign_ |
Face flip map signs. More... | |
List< scalar > | faceArea_ |
Sum of face areas. More... | |
PtrList< OFstream > | filePtrs_ |
Output file per face zone. More... | |
scalar | tolerance_ |
Tolerance applied when matching face normals. More... | |
![]() | |
bool | writeToFile_ |
Flag to enable/disable writing to file. More... | |
This function object calculates the flux across selections of faces.
Output comprises, per set of faces, the:
Example of function object specification:
fluxSummary1 { type fluxSummary; functionObjectLibs ("libutilityFunctionObjects.so"); ... write yes; log yes; mode cellZoneAndDirection; cellZoneAndDirection ( (porosity (1 0 0)) ); scaleFactor 1.2; }
Function object usage
Property | Description | Required | Default value |
---|---|---|---|
type | type name: fluxSummary | yes | |
write | write flux data to file | no | yes |
log | write flux data to standard output | no | yes |
mode | mode to generate faces to test | yes | |
scaleFactor | optional factor to scale result | no | 1 |
The mode is one of:
Output data is written to files of the form <timeDir>/<faceZoneName>.dat
Definition at line 137 of file fluxSummary.H.
enum modeType |
Face mode type.
Enumerator | |
---|---|
mdFaceZone | |
mdFaceZoneAndDirection | |
mdCellZoneAndDirection |
Definition at line 146 of file fluxSummary.H.
|
protected |
Disallow default bitwise copy construct.
fluxSummary | ( | const word & | name, |
const objectRegistry & | obr, | ||
const dictionary & | dict, | ||
const bool | loadFromFiles = false |
||
) |
Construct for given objectRegistry and dictionary.
Allow the possibility to load fields from files
Definition at line 580 of file fluxSummary.C.
References dict, Foam::endl(), Foam::read(), and WarningInFunction.
|
virtual |
Destructor.
Definition at line 619 of file fluxSummary.C.
|
protected |
Initialise face set from face zone.
Definition at line 64 of file fluxSummary.C.
References DynamicList::append(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, faceZone::flipMap(), forAll, mesh, List::size(), polyPatch::start(), and polyPatch::whichFace().
|
protected |
Initialise face set from face zone and direction.
Definition at line 153 of file fluxSummary.C.
References DynamicList::append(), GeometricField::boundaryField(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::mag(), mesh, n, List::size(), polyPatch::start(), and polyPatch::whichFace().
|
protected |
Initialise face set from cell zone and direction.
Definition at line 262 of file fluxSummary.C.
References List::append(), DynamicList::append(), Foam::calc(), polyPatch::coupled(), Foam::endl(), Foam::exit(), PrimitivePatch< Face, FaceList, PointField, PointType >::faceEdges(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::identity(), Foam::Info, globalIndex::isLocal(), Foam::labelMax, Foam::mag(), mesh, n, Foam::name(), PrimitivePatch< Face, FaceList, PointField, PointType >::nEdges(), Foam::nl, Foam::reduce(), Foam::returnReduce(), List::size(), polyPatch::start(), globalIndex::toGlobal(), globalIndex::toLocal(), Foam::type(), WarningInFunction, and OBJstream::write().
|
protected |
Initialise the total area per derived faceZone.
Definition at line 543 of file fluxSummary.C.
References GeometricField::boundaryField(), fluxSummary::faceArea_, fluxSummary::faceID_, fluxSummary::facePatchID_, forAll, mesh, fluxSummary::obr_, Foam::returnReduce(), and List::setSize().
|
protectedvirtual |
Output file header information.
Definition at line 760 of file fluxSummary.C.
References Foam::endl(), and Foam::tab.
|
protected |
Disallow default bitwise assignment.
TypeName | ( | "fluxSummary" | ) |
Runtime type information.
|
inlinevirtual |
Return name of the set of field min/max.
Definition at line 293 of file fluxSummary.H.
References fluxSummary::name_.
|
virtual |
Read the field min/max data.
Definition at line 625 of file fluxSummary.C.
References Foam::abort(), dict, Foam::endl(), Foam::FatalIOError, FatalIOErrorInFunction, forAll, Foam::Info, dictionary::lookup(), dictionary::lookupOrDefault(), modeTypeNames_, Foam::nl, functionObjectFile::read(), dictionary::readIfPresent(), and Foam::type().
|
virtual |
Execute, currently does nothing.
Definition at line 794 of file fluxSummary.C.
|
virtual |
Execute at the final time-loop, currently does nothing.
Definition at line 800 of file fluxSummary.C.
|
virtual |
Called when time was set at the end of the Time::operator++.
Definition at line 806 of file fluxSummary.C.
|
virtual |
Write the fluxSummary.
Definition at line 812 of file fluxSummary.C.
References Foam::abort(), GeometricField::boundaryField(), Foam::dimMass, Foam::dimTime, Foam::dimVolume, Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::Info, Foam::nl, phi, Foam::reduce(), token::TAB, and Foam::type().
|
inlinevirtual |
Update for changes of mesh.
Definition at line 314 of file fluxSummary.H.
|
inlinevirtual |
Update for changes of mesh.
Definition at line 318 of file fluxSummary.H.
|
static |
Mode type names.
Definition at line 154 of file fluxSummary.H.
|
protected |
Name of function object.
Also used as the name of the output directory
Definition at line 163 of file fluxSummary.H.
Referenced by fluxSummary::name().
|
protected |
Reference to the database.
Definition at line 166 of file fluxSummary.H.
Referenced by fluxSummary::initialiseFaceArea().
|
protected |
on/off switch
Definition at line 169 of file fluxSummary.H.
|
protected |
Switch to send output to Info as well.
Definition at line 172 of file fluxSummary.H.
|
protected |
Mode for face determination.
Definition at line 175 of file fluxSummary.H.
|
protected |
Scale factor.
Definition at line 178 of file fluxSummary.H.
|
protected |
Name of flux field, default = phi.
Definition at line 181 of file fluxSummary.H.
Region names.
Definition at line 187 of file fluxSummary.H.
Reference direction.
Definition at line 190 of file fluxSummary.H.
Face IDs.
Definition at line 193 of file fluxSummary.H.
Referenced by fluxSummary::initialiseFaceArea().
Face patch IDs.
Definition at line 196 of file fluxSummary.H.
Referenced by fluxSummary::initialiseFaceArea().
Face flip map signs.
Definition at line 199 of file fluxSummary.H.
|
protected |
Sum of face areas.
Definition at line 202 of file fluxSummary.H.
Referenced by fluxSummary::initialiseFaceArea().
Output file per face zone.
Definition at line 205 of file fluxSummary.H.
|
protected |
Tolerance applied when matching face normals.
Definition at line 209 of file fluxSummary.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.