Function objects

Function objects are run-time selectable options that generate additional output both during and after the calculation. These vary from providing additional logging to the screen, to generating text, image and field files.

Many workflows can be configured to generate the desired post-processing data during the run. This eliminates the need to store all run-time generated data, hence saving considerable resources. Furthermore, function objects are readily applied to batch-driven processes, improving reliability by standardising the sequence of operations and reducing the amount of manual interaction.


Function objects are specified in the main controlDict file in an optional functions dictionary:

    <user-defined name>
        type        <object type>;
        libs        (<list of library file names>);

Each object is defined in its own sub-dictionary, under a user-defined name, and evaluated either:

  • at run-time,
  • via the postProcess utility, or
  • the -postProcess option, available to solver applications.

Run-time control

When applied at run-time, the objects are controlled according to the optional two options:

  • evaluateControl: when the object is updated, and
  • writeControl: when the object output is written.

These take the same type of values as the writeControl entry in the controlDict, with some additions:

  • timeStep: regular time step intervals
  • writeTime: calculation write times
  • runTime/adjustableRunTime:
  • clockTime:
  • cpuTime:
  • onEnd: on completion of the case.

For example, to set a Courant Number function object to evaluate every 2 time steps and output at every output time:

        type                CourantNo;
        libs                ("");
        evaluateControl     timeStep;
        evaluateInterval    2;
        writeControl        writeTime;

Data derived from function objects are written to the case postProcessing directory, typically in a subdirectory with the same name as the object, e.g.


Post-process utility

postProcess -func 'Co'

Application post-processing

<application> -postProcess

For example, having completed a simpleFoam calculation:

simpleFoam -postProcess


Function objects are grouped into libraries that perform similar operations or operate on similar object types:

Further information