DOC: elaborate the usage of function objects

ENH: update libs of etc/caseDicts/postProcess items
  ENH: ensure destructor=default
  ENH: ensure constness
  ENH: ensure no 'copy construct' and 'no copy assignment' exist
  TUT: add examples of function objects with full set
       of settings into a TUT if unavailable
  TUT: update pisoFoam/RAS/cavity tutorial in terms of usage
This commit is contained in:
Kutalmis Bercin
2020-03-13 18:49:58 +00:00
committed by Andrew Heather
parent b549116588
commit a5c6516e23
264 changed files with 7120 additions and 2830 deletions

View File

@ -6,14 +6,16 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Description
Calculates and writes the second largest eigenvalue of the sum of the
square of the symmetrical and anti-symmetrical parts of the velocity
gradient tensor.
Computes the min/max/average arbitrary mesh interface (AMI) weights, and
optionally reports to a text file or writes VTK surfaces of the sum of
the weights and mask fields for arbitrarily coupled mesh interface (ACMI)
patches.
\*---------------------------------------------------------------------------*/
type AMIWeights;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
writeFields yes;
writeControl writeTime;

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type CourantNo;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
field phi;

View File

@ -6,14 +6,14 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Description
Calculates and writes the second largest eigenvalue of the sum of the
square of the symmetrical and anti-symmetrical parts of the velocity
gradient tensor.
Calculates Lamb vector, i.e. the cross product of vorticity and velocity.
Calculation of the divergence of the Lamb vector can be performed by using
\c div function object on this \c LambVector function object.
\*---------------------------------------------------------------------------*/
type lambVector;
libs ("libfieldFunctionObjects.so");
type LambVector;
libs (fieldFunctionObjects);
field U;

View File

@ -13,7 +13,7 @@ Description
\*---------------------------------------------------------------------------*/
type Lambda2;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
field U;

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type MachNo;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
field U;

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type PecletNo;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
field phi;

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type Q;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
field U;

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type turbulenceFields;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
field R;

View File

@ -12,7 +12,7 @@ Description
\*---------------------------------------------------------------------------*/
type XiReactionRate;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
fields (b Xi Su);

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type add;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
fields (<field names>);

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type components;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
field <fieldName>;

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type ddt;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
field <fieldName>;

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type div;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
field <fieldName>;

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type energySpectrum;
libs ("librandomProcessesFunctionObjects.so");
libs (randomProcessesFunctionObjects);
executeControl writeTime;
writeControl writeTime;

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type enstrophy;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
field U;

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type fieldMinMax;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
fields (".*");

View File

@ -14,7 +14,7 @@ Description
\*---------------------------------------------------------------------------*/
type flowType;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
field U;

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type grad;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
field <fieldName>;

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type mag;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
field <fieldName>;

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type magSqr;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
field <fieldName>;

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type processorField;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
executeControl writeTime;
writeControl writeTime;

View File

@ -12,7 +12,7 @@ Description
\*---------------------------------------------------------------------------*/
type streamFunction;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
field phi;

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type subtract;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
fields (<field names>);

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type turbulenceFields;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
fields (<field names>);

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type vorticity;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
field U;

View File

@ -12,7 +12,7 @@ Description
\*---------------------------------------------------------------------------*/
type wallHeatFlux;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
executeControl writeTime;
writeControl writeTime;

View File

@ -12,7 +12,7 @@ Description
\*---------------------------------------------------------------------------*/
type wallShearStress;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
executeControl writeTime;
writeControl writeTime;

View File

@ -13,7 +13,7 @@ Description
\*---------------------------------------------------------------------------*/
type writeCellCentres;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
executeControl writeTime;
writeControl writeTime;

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type writeCellVolumes;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
executeControl writeTime;
writeControl writeTime;

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type writeObjects;
libs ("libutilityFunctionObjects.so");
libs (utilityFunctionObjects);
objects (<object names>);

View File

@ -11,7 +11,7 @@ Description
\*---------------------------------------------------------------------------*/
type yPlus;
libs ("libfieldFunctionObjects.so");
libs (fieldFunctionObjects);
executeControl writeTime;
writeControl writeTime;

View File

@ -52,28 +52,23 @@ Foam::functionObjects::FUNCTIONOBJECT::FUNCTIONOBJECT
)
:
fvMeshFunctionObject(name, runTime, dict),
boolData_(dict.getOrDefault<bool>("boolData"), true),
labelData_(dict.get<label>("labelData")),
wordData_(dict.getOrDefault<word>("wordData", "defaultWord")),
scalarData_(dict.get<scalar>("scalarData")),
labelData_(dict.get<label>("labelData"))
scalarData_(dict.getOrDefault<scalar>("scalarData", 1.0))
{
read(dict);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::FUNCTIONOBJECT::~FUNCTIONOBJECT()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::functionObjects::FUNCTIONOBJECT::read(const dictionary& dict)
{
dict.readIfPresent("wordData", wordData_);
dict.readEntry("scalarData", scalarData_);
dict.readEntry("boolData", boolData_);
dict.readEntry("labelData", labelData_);
dict.readIfPresent("wordData", wordData_);
dict.readEntry("scalarData", scalarData_);
return true;
}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) YEAR YEAR AUTHOR,AFFILIATION
Copyright (C) YEAR AUTHOR, AFFILIATION
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,34 +27,120 @@ Class
Foam::functionObjects::FUNCTIONOBJECT
Group
grpFieldFunctionObjects
Description
This function object...
<minimal description of the function object>
Example of function object specification:
<equation>
\f[
x = x_{ref}^x + \rho \omega
\f]
<variable-explanation table>
where
\vartable
\rho | <explanation> [units, e.g. kg/m3]
\omega | \f$ \nabla \cdot \vec U \f$
... | ...
\endvartable
<inline equation>
where \f$ x_k \f$ is ...
<input-output table>
\table
Operand | Type | Location
input | {vol,surface}\<Type\>Field(s) <!--
--> |$FOAM_CASE/\<time\>/\<inpField\>s
output file | dat <!--
--> | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/\<file\>
output field | volScalarField | $FOAM_CASE/\<time\>/\<outField\>
\endtable
Usage
Minimal example by using \c system/controlDict.functions:
\verbatim
FUNCTIONOBJECT1
{
// Mandatory entries (unmodifiable)
type FUNCTIONOBJECT;
libs ("libFUNCTIONOBJECTFunctionObject.so");
libs (FUNCTIONOBJECTFunctionObject);
// Mandatory entries (runtime modifiable)
...
// Mandatory (inherited) entries (unmodifiable)
...
// Mandatory (inherited) entries (runtime unmodifiable)
...
// Optional entries (unmodifiable)
...
// Optional entries (runtime modifiable)
boolData <bool>;
labelData <label>;
wordData <word>;
scalarData <scalar>;
// Optional (inherited) entries
...
wordData someWord;
scalarData 1.0;
labelData 1;
}
\endverbatim
Usage
where the entries mean:
\table
Property | Description | Required | Default value
type | type name: FUNCTIONOBJECT | yes |
wordData | some word option... | no | defaultWord
scalarData | some scalar value... | yes |
labelData | some label value... | yes |
Property | Description | Type | Req'd | Dflt
type | Type name: FUNCTIONOBJECT | word | yes | -
libs | Library name: FUNCTIONOBJECTFunctionObject <!--
--> | word | yes | -
boolData | <explanation> | bool | yes | -
labelData | <explanation> | label | yes | -
wordData | <explanation> | word | yes | -
scalarData | <explanation> | scalar | no | 1.0
wordListData | <explanation> | wordList | yes | -
\endtable
Options for the \c ENTRY entry:
\verbatim
<option1>
<option2> | <explanation>
...
\endverbatim
The inherited entries are elaborated in:
- \link functionObject.H \endlink
- \link fieldExpression.H \endlink
- \link fieldsExpression.H \endlink
- \link writeFile.H \endlink
...
<if \c postProcess is applicable>
Minimal example by using the \c postProcess utility:
\verbatim
postProcess -func FUNCTIONOBJECT
\endverbatim
<if \c postProcess is not applicable>
Usage by the \c postProcess utility is not available.
Note
- <note1>
- <note2>
...
See also
- Foam::functionObject
- Foam::functionObjects::fvMeshFunctionObject
- ExtendedCodeGuide::functionObjects::field::FUNCTIONOBJECT
...
SourceFiles
FUNCTIONOBJECT.C
FUNCTIONOBJECTTEMPLATES.C
...
\*---------------------------------------------------------------------------*/
@ -78,7 +164,13 @@ class FUNCTIONOBJECT
:
public fvMeshFunctionObject
{
// Private data
// Private Data
//- bool
bool boolData_;
//- label
label labelData_;
//- word
word wordData_;
@ -86,19 +178,6 @@ class FUNCTIONOBJECT
//- scalar
scalar scalarData_;
//- label
label labelData_;
// Private Member Functions
//- No copy construct
FUNCTIONOBJECT(const FUNCTIONOBJECT&);
//- No copy assignment
void operator=(const FUNCTIONOBJECT&);
public:
@ -116,9 +195,15 @@ public:
const dictionary& dict
);
//- No copy construct
FUNCTIONOBJECT(const FUNCTIONOBJECT&) = delete;
//- No copy assignment
void operator=(const FUNCTIONOBJECT&) = delete;
//- Destructor
virtual ~FUNCTIONOBJECT();
virtual ~FUNCTIONOBJECT() = default;
// Member Functions