This function object provides information on the mode of operation of blended convection schemes. More...
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 word & | name () 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... | |
![]() | |
functionObjectState (const objectRegistry &obr, const word &name) | |
Construct from components. More... | |
virtual | ~functionObjectState () |
Destructor. More... | |
const word & | name () const |
Return the name. More... | |
bool | active () const |
Return the active flag. More... | |
const IOdictionary & | stateDict () const |
Return access to the state dictionary. More... | |
dictionary & | propertyDict () |
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< word > | objectResultEntries () const |
Retrieve the result entries. More... | |
List< word > | objectResultEntries (const word &objectName) const |
Return result entries for named object. 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... | |
Protected Member Functions | |
virtual void | writeFileHeader (Ostream &os) const |
Write the file header. More... | |
![]() | |
functionObjectState (const functionObjectState &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const functionObjectState &) |
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... | |
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 objectRegistry & | obr_ |
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 const word | outputPrefix = "postProcessing" |
Directory prefix. More... | |
static label | addChars = 7 |
Additional characters for writing. More... | |
![]() | |
const word | name_ |
Name of model. More... | |
bool | active_ |
Flag to indicate whether the object is active. More... | |
IOdictionary & | stateDict_ |
Reference to the state dictionary. More... | |
![]() | |
bool | writeToFile_ |
Flag to enable/disable writing to file. More... | |
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 |
Definition at line 135 of file blendingFactor.H.
|
private |
Disallow default bitwise copy construct.
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().
|
virtual |
Destructor.
Definition at line 103 of file blendingFactor.C.
|
private |
Disallow default bitwise assignment.
|
private |
Calculate the blending factor.
Definition at line 33 of file blendingFactorTemplates.C.
References blendedSchemeBase< Type >::blendingFactor(), Foam::fvc::cellReduce(), GeometricField::correctBoundaryConditions(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, blendingFactor::fieldName_, functionObjectFile::file(), forAll, objectRegistry::foundObject(), Foam::Info, gaussConvectionScheme< Type >::interpScheme(), Foam::isA(), blendingFactor::log_, objectRegistry::lookupObject(), mesh, blendingFactor::name_, convectionScheme< Type >::New(), Foam::nl, blendingFactor::obr_, phi, blendingFactor::phiName_, Foam::reduce(), blendingFactor::resultName_, token::TAB, objectRegistry::time(), blendingFactor::tolerance_, Foam::type(), and dimensioned::value().
|
protectedvirtual |
Write the file header.
Definition at line 39 of file blendingFactor.C.
References Foam::endl(), functionObjectFile::writeCommented(), functionObjectFile::writeHeader(), and functionObjectFile::writeTabbed().
TypeName | ( | "blendingFactor" | ) |
Runtime type information.
|
inlinevirtual |
Return name of the set of blendingFactor.
Definition at line 211 of file blendingFactor.H.
References blendingFactor::name_.
|
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().
|
virtual |
Execute, currently does nothing.
Definition at line 137 of file blendingFactor.C.
|
virtual |
Execute at the final time-loop, currently does nothing.
Definition at line 147 of file blendingFactor.C.
|
virtual |
Called when time was set at the end of the Time::operator++.
Definition at line 153 of file blendingFactor.C.
|
virtual |
Calculate the blendingFactor and write.
Definition at line 159 of file blendingFactor.C.
References Foam::endl(), Foam::Info, Foam::nl, and Foam::type().
|
inlinevirtual |
Update for changes of mesh.
Definition at line 232 of file blendingFactor.H.
|
inlinevirtual |
Update for changes of mesh.
Definition at line 236 of file blendingFactor.H.
|
private |
Name.
Definition at line 143 of file blendingFactor.H.
Referenced by blendingFactor::calc(), and blendingFactor::name().
|
private |
Reference to the database.
Definition at line 146 of file blendingFactor.H.
Referenced by blendingFactor::calc().
|
private |
Name of flux field, default is "phi".
Definition at line 149 of file blendingFactor.H.
Referenced by blendingFactor::calc().
|
private |
|
private |
Result field name.
Definition at line 155 of file blendingFactor.H.
Referenced by blendingFactor::calc().
|
private |
Tolerance used when calculating the number of blended cells.
Definition at line 158 of file blendingFactor.H.
Referenced by blendingFactor::calc().
|
private |
Switch to send output to Info as well as to file.
Definition at line 161 of file blendingFactor.H.
Referenced by blendingFactor::calc().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.