Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
fluxSummary Class Reference

This function object calculates the flux across selections of faces. More...

Inheritance diagram for fluxSummary:
Inheritance graph
[legend]
Collaboration diagram for fluxSummary:
Collaboration graph
[legend]

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 wordname () 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...
 
- Public Member Functions inherited from functionObjectFile
 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...
 
OFstreamfile ()
 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 Public Attributes inherited from functionObjectFile
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...
 
- Protected Member Functions inherited from functionObjectFile
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< OFstreamcreateFile (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 objectRegistryobr_
 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< wordfaceZoneName_
 Region names. More...
 
List< vectorrefDir_
 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< OFstreamfilePtrs_
 Output file per face zone. More...
 
scalar tolerance_
 Tolerance applied when matching face normals. More...
 
- Protected Attributes inherited from functionObjectFile
bool writeToFile_
 Flag to enable/disable writing to file. More...
 

Detailed Description

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

See also
Foam::functionObject Foam::OutputFilterFunctionObject
Source files

Definition at line 137 of file fluxSummary.H.

Member Enumeration Documentation

◆ modeType

enum modeType

Face mode type.

Enumerator
mdFaceZone 
mdFaceZoneAndDirection 
mdCellZoneAndDirection 

Definition at line 146 of file fluxSummary.H.

Constructor & Destructor Documentation

◆ fluxSummary() [1/2]

fluxSummary ( const fluxSummary )
protected

Disallow default bitwise copy construct.

◆ fluxSummary() [2/2]

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.

Here is the call graph for this function:

◆ ~fluxSummary()

~fluxSummary ( )
virtual

Destructor.

Definition at line 619 of file fluxSummary.C.

Member Function Documentation

◆ initialiseFaceZone()

void initialiseFaceZone ( const word faceZoneName,
DynamicList< word > &  faceZoneNames,
DynamicList< List< label > > &  faceID,
DynamicList< List< label > > &  facePatchID,
DynamicList< List< scalar > > &  faceSign 
) const
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().

Here is the call graph for this function:

◆ initialiseFaceZoneAndDirection()

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
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().

Here is the call graph for this function:

◆ initialiseCellZoneAndDirection()

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
protected

◆ initialiseFaceArea()

void initialiseFaceArea ( )
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().

Here is the call graph for this function:

◆ writeFileHeader()

void writeFileHeader ( const word fzName,
const scalar  area,
const vector refDir,
Ostream os 
) const
protectedvirtual

Output file header information.

Definition at line 760 of file fluxSummary.C.

References Foam::endl(), and Foam::tab.

Here is the call graph for this function:

◆ operator=()

void operator= ( const fluxSummary )
protected

Disallow default bitwise assignment.

◆ TypeName()

TypeName ( "fluxSummary"  )

Runtime type information.

◆ name()

virtual const word& name ( ) const
inlinevirtual

Return name of the set of field min/max.

Definition at line 293 of file fluxSummary.H.

References fluxSummary::name_.

◆ read()

void read ( const dictionary dict)
virtual

◆ execute()

void execute ( )
virtual

Execute, currently does nothing.

Definition at line 794 of file fluxSummary.C.

◆ end()

void end ( )
virtual

Execute at the final time-loop, currently does nothing.

Definition at line 800 of file fluxSummary.C.

◆ timeSet()

void timeSet ( )
virtual

Called when time was set at the end of the Time::operator++.

Definition at line 806 of file fluxSummary.C.

◆ write()

void write ( )
virtual

◆ updateMesh()

virtual void updateMesh ( const mapPolyMesh )
inlinevirtual

Update for changes of mesh.

Definition at line 314 of file fluxSummary.H.

◆ movePoints()

virtual void movePoints ( const polyMesh )
inlinevirtual

Update for changes of mesh.

Definition at line 318 of file fluxSummary.H.

Field Documentation

◆ modeTypeNames_

const Foam::NamedEnum< Foam::fluxSummary::modeType, 3 > modeTypeNames_
static

Mode type names.

Definition at line 154 of file fluxSummary.H.

◆ name_

word name_
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().

◆ obr_

const objectRegistry& obr_
protected

Reference to the database.

Definition at line 166 of file fluxSummary.H.

Referenced by fluxSummary::initialiseFaceArea().

◆ active_

bool active_
protected

on/off switch

Definition at line 169 of file fluxSummary.H.

◆ log_

Switch log_
protected

Switch to send output to Info as well.

Definition at line 172 of file fluxSummary.H.

◆ mode_

modeType mode_
protected

Mode for face determination.

Definition at line 175 of file fluxSummary.H.

◆ scaleFactor_

scalar scaleFactor_
protected

Scale factor.

Definition at line 178 of file fluxSummary.H.

◆ phiName_

word phiName_
protected

Name of flux field, default = phi.

Definition at line 181 of file fluxSummary.H.

◆ faceZoneName_

List<word> faceZoneName_
protected

Region names.

Definition at line 187 of file fluxSummary.H.

◆ refDir_

List<vector> refDir_
protected

Reference direction.

Definition at line 190 of file fluxSummary.H.

◆ faceID_

List<List<label> > faceID_
protected

Face IDs.

Definition at line 193 of file fluxSummary.H.

Referenced by fluxSummary::initialiseFaceArea().

◆ facePatchID_

List<List<label> > facePatchID_
protected

Face patch IDs.

Definition at line 196 of file fluxSummary.H.

Referenced by fluxSummary::initialiseFaceArea().

◆ faceSign_

List<List<scalar> > faceSign_
protected

Face flip map signs.

Definition at line 199 of file fluxSummary.H.

◆ faceArea_

List<scalar> faceArea_
protected

Sum of face areas.

Definition at line 202 of file fluxSummary.H.

Referenced by fluxSummary::initialiseFaceArea().

◆ filePtrs_

PtrList<OFstream> filePtrs_
protected

Output file per face zone.

Definition at line 205 of file fluxSummary.H.

◆ tolerance_

scalar tolerance_
protected

Tolerance applied when matching face normals.

Definition at line 209 of file fluxSummary.H.


The documentation for this class was generated from the following files: