mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
functionObjects: rewritten to all be derived from 'functionObject'
- Avoids the need for the 'OutputFilterFunctionObject' wrapper
- Time-control for execution and writing is now provided by the
'timeControlFunctionObject' which instantiates the processing
'functionObject' and controls its operation.
- Alternative time-control functionObjects can now be written and
selected at run-time without the need to compile wrapped version of
EVERY existing functionObject which would have been required in the
old structure.
- The separation of 'execute' and 'write' functions is now formalized in the
'functionObject' base-class and all derived classes implement the
two functions.
- Unnecessary implementations of functions with appropriate defaults
in the 'functionObject' base-class have been removed reducing
clutter and simplifying implementation of new functionObjects.
- The 'coded' 'functionObject' has also been updated, simplified and tested.
- Further simplification is now possible by creating some general
intermediate classes derived from 'functionObject'.
This commit is contained in:
@ -17,19 +17,19 @@ FoamFile
|
||||
|
||||
application potentialFoam;
|
||||
|
||||
startFrom startTime;
|
||||
startFrom latestTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
stopAt endTime;
|
||||
stopAt nextWrite;
|
||||
|
||||
endTime 1;
|
||||
|
||||
deltaT 1;
|
||||
|
||||
writeControl timeStep;
|
||||
writeControl timeStep;
|
||||
|
||||
writeInterval 1;
|
||||
writeInterval 1;
|
||||
|
||||
purgeWrite 0;
|
||||
|
||||
@ -51,7 +51,11 @@ functions
|
||||
{
|
||||
// Load the library containing the 'coded' functionObject
|
||||
functionObjectLibs ("libutilityFunctionObjects.so");
|
||||
|
||||
type coded;
|
||||
|
||||
writeControl timeStep;
|
||||
|
||||
// Name of on-the-fly generated functionObject
|
||||
redirectType error;
|
||||
code
|
||||
|
||||
@ -60,6 +60,10 @@ functions
|
||||
redirectType setDeltaT;
|
||||
|
||||
code
|
||||
#{
|
||||
#};
|
||||
|
||||
codeExecute
|
||||
#{
|
||||
const Time& runTime = mesh().time();
|
||||
if (runTime.timeToUserTime(runTime.value()) >= -15.0)
|
||||
|
||||
@ -18,7 +18,7 @@ done
|
||||
|
||||
for i in bottomWater topAir heater leftSolid rightSolid
|
||||
do
|
||||
runApplication -s $i changeDictionary -region $i
|
||||
runApplication -s $i changeDictionary -region $i
|
||||
done
|
||||
|
||||
|
||||
|
||||
@ -17,6 +17,9 @@ near
|
||||
// Output every
|
||||
writeControl writeTime;
|
||||
|
||||
// Calculate every
|
||||
executeControl writeTime;
|
||||
|
||||
// Fields to be sampled. Per field original name and mapped field to
|
||||
// create.
|
||||
// Note: fields only get updated when writing!
|
||||
|
||||
Reference in New Issue
Block a user