Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
blendingFactor Class Reference

This function object provides information on the mode of operation of blended convection schemes. More...

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

Public Member Functions

 TypeName ("blendingFactor")
 Runtime type information. More...
 
 blendingFactor (const word &name, const objectRegistry &, const dictionary &, const bool loadFromFiles=false)
 Construct for given objectRegistry and dictionary. More...
 
virtual ~blendingFactor ()
 Destructor. More...
 
virtual const wordname () const
 Return name of the set of blendingFactor. More...
 
virtual void read (const dictionary &)
 Read the blendingFactor 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 ()
 Calculate the blendingFactor and write. 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 functionObjectState
 functionObjectState (const objectRegistry &obr, const word &name)
 Construct from components. More...
 
virtual ~functionObjectState ()
 Destructor. More...
 
const wordname () const
 Return the name. More...
 
bool active () const
 Return the active flag. More...
 
const IOdictionarystateDict () const
 Return access to the state dictionary. More...
 
dictionarypropertyDict ()
 Return access to the property dictionary. More...
 
template<class Type >
bool setActive ()
 Set the active status by querying objectRegistry type. More...
 
bool foundProperty (const word &entryName) const
 Return true if the property exists. More...
 
template<class Type >
Type getProperty (const word &entryName, const Type &defaultValue=pTraits< Type >::zero) const
 Retrieve generic property. More...
 
template<class Type >
void getProperty (const word &entryName, Type &value) const
 Retrieve generic property. More...
 
template<class Type >
void setProperty (const word &entryName, const Type &value)
 Add generic property. More...
 
template<class Type >
Type getObjectProperty (const word &objectName, const word &entryName, const Type &defaultValue=pTraits< Type >::zero) const
 Retrieve generic property from named object. More...
 
template<class Type >
void getObjectProperty (const word &objectName, const word &entryName, Type &value) const
 Retrieve generic property from named object. More...
 
template<class Type >
void setObjectProperty (const word &objectName, const word &entryName, const Type &value)
 Add generic property from named object. More...
 
template<class Type >
void setResult (const word &entryName, const Type &value)
 Add result. More...
 
template<class Type >
void setObjectResult (const word &objectName, const word &entryName, const Type &value)
 Add result from named object. More...
 
template<class Type >
Type getResult (const word &entryName, const Type &defaultValue=pTraits< Type >::zero) const
 Retrieve result. More...
 
template<class Type >
Type getObjectResult (const word &objectName, const word &entryName, const Type &defaultValue=pTraits< Type >::zero) const
 Retrieve result from named object. More...
 
template<class Type >
void getObjectResult (const word &objectName, const word &entryName, Type &value) const
 Retrieve result from named object. More...
 
word resultType (const word &entryName) const
 Retrieve the result type. More...
 
word objectResultType (const word &objectName, const word &entryName) const
 Return the type of result. More...
 
List< wordobjectResultEntries () const
 Retrieve the result entries. More...
 
List< wordobjectResultEntries (const word &objectName) const
 Return result entries for named object. 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...
 

Protected Member Functions

virtual void writeFileHeader (Ostream &os) const
 Write the file header. More...
 
- Protected Member Functions inherited from functionObjectState
 functionObjectState (const functionObjectState &)
 Disallow default bitwise copy construct. More...
 
void operator= (const functionObjectState &)
 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...
 

Private Member Functions

 blendingFactor (const blendingFactor &)
 Disallow default bitwise copy construct. More...
 
void operator= (const blendingFactor &)
 Disallow default bitwise assignment. More...
 
template<class Type >
void calc ()
 Calculate the blending factor. More...
 

Private Attributes

const word name_
 Name. More...
 
const objectRegistryobr_
 Reference to the database. More...
 
word phiName_
 Name of flux field, default is "phi". More...
 
word fieldName_
 Field name. More...
 
word resultName_
 Result field name. More...
 
scalar tolerance_
 Tolerance used when calculating the number of blended cells. More...
 
Switch log_
 Switch to send output to Info as well as to file. More...
 

Additional Inherited Members

- Static Public Attributes inherited from functionObjectFile
static const word outputPrefix = "postProcessing"
 Directory prefix. More...
 
static label addChars = 7
 Additional characters for writing. More...
 
- Protected Attributes inherited from functionObjectState
const word name_
 Name of model. More...
 
bool active_
 Flag to indicate whether the object is active. More...
 
IOdictionarystateDict_
 Reference to the state dictionary. More...
 
- Protected Attributes inherited from functionObjectFile
bool writeToFile_
 Flag to enable/disable writing to file. More...
 

Detailed Description

This function object provides information on the mode of operation of blended convection schemes.

The weight of a blended scheme is given by a function of the blending factor, f:

weight = f*scheme1 + (1 - f)*scheme2

The factor is a face-based quantity, which is converted to a cell-based quantity by assigning the minimum blending factor for any cell face.

An indicator (volume) field, named <functionObjectName>:<fieldName>, is generated that is set to (1 - f), i.e. values of:

Additional reporting is written to the standard output, providing statistics as to the number of cells used by each scheme.

Example of function object specification to calculate the blending factor:

blendingFactor1
{
    type        blendingFactor;
    functionObjectLibs ("libutilityFunctionObjects.so");

    ...

    // Name of field
    fieldName   U;
}


Function object usage

Property Description Required Default value
type Type name: blendingFactor yes
phiName Name of flux field no phi
fieldName Name of field to evaluate yes
tolerance Tolerance for number of blended cells no 0.001
log Log to standard output no yes
Source files

Definition at line 135 of file blendingFactor.H.

Constructor & Destructor Documentation

◆ blendingFactor() [1/2]

blendingFactor ( const blendingFactor )
private

Disallow default bitwise copy construct.

◆ blendingFactor() [2/2]

blendingFactor ( 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 53 of file blendingFactor.C.

References dict, Foam::dimless, mesh, IOobject::NO_READ, IOobject::NO_WRITE, Foam::read(), fvMesh::time(), and Time::timeName().

Here is the call graph for this function:

◆ ~blendingFactor()

~blendingFactor ( )
virtual

Destructor.

Definition at line 103 of file blendingFactor.C.

Member Function Documentation

◆ operator=()

void operator= ( const blendingFactor )
private

Disallow default bitwise assignment.

◆ calc()

void calc
private

◆ writeFileHeader()

void writeFileHeader ( Ostream os) const
protectedvirtual

Write the file header.

Definition at line 39 of file blendingFactor.C.

References Foam::endl(), functionObjectFile::writeCommented(), functionObjectFile::writeHeader(), and functionObjectFile::writeTabbed().

Here is the call graph for this function:

◆ TypeName()

TypeName ( "blendingFactor"  )

Runtime type information.

◆ name()

virtual const word& name ( ) const
inlinevirtual

Return name of the set of blendingFactor.

Definition at line 211 of file blendingFactor.H.

References blendingFactor::name_.

◆ read()

void read ( const dictionary dict)
virtual

Read the blendingFactor data.

Definition at line 109 of file blendingFactor.C.

References dict, Foam::exit(), Foam::FatalError, FatalErrorInFunction, dictionary::lookup(), functionObjectFile::read(), and dictionary::readIfPresent().

Here is the call graph for this function:

◆ execute()

void execute ( )
virtual

Execute, currently does nothing.

Definition at line 137 of file blendingFactor.C.

◆ end()

void end ( )
virtual

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

Definition at line 147 of file blendingFactor.C.

◆ timeSet()

void timeSet ( )
virtual

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

Definition at line 153 of file blendingFactor.C.

◆ write()

void write ( )
virtual

Calculate the blendingFactor and write.

Definition at line 159 of file blendingFactor.C.

References Foam::endl(), Foam::Info, Foam::nl, and Foam::type().

Here is the call graph for this function:

◆ updateMesh()

virtual void updateMesh ( const mapPolyMesh )
inlinevirtual

Update for changes of mesh.

Definition at line 232 of file blendingFactor.H.

◆ movePoints()

virtual void movePoints ( const polyMesh )
inlinevirtual

Update for changes of mesh.

Definition at line 236 of file blendingFactor.H.

Field Documentation

◆ name_

const word name_
private

Name.

Definition at line 143 of file blendingFactor.H.

Referenced by blendingFactor::calc(), and blendingFactor::name().

◆ obr_

const objectRegistry& obr_
private

Reference to the database.

Definition at line 146 of file blendingFactor.H.

Referenced by blendingFactor::calc().

◆ phiName_

word phiName_
private

Name of flux field, default is "phi".

Definition at line 149 of file blendingFactor.H.

Referenced by blendingFactor::calc().

◆ fieldName_

word fieldName_
private

Field name.

Definition at line 152 of file blendingFactor.H.

Referenced by blendingFactor::calc().

◆ resultName_

word resultName_
private

Result field name.

Definition at line 155 of file blendingFactor.H.

Referenced by blendingFactor::calc().

◆ tolerance_

scalar tolerance_
private

Tolerance used when calculating the number of blended cells.

Definition at line 158 of file blendingFactor.H.

Referenced by blendingFactor::calc().

◆ log_

Switch log_
private

Switch to send output to Info as well as to file.

Definition at line 161 of file blendingFactor.H.

Referenced by blendingFactor::calc().


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