The reference function object computes a field whose values are offset to a reference value obtained by sampling the field at a user-specified location.

The field values are calculated using:

\[\text{ref}_c = s(f_{c}(t) - f_p + f_{off})\]


Field values at cell
Optional scale factor (default = 1)
Current field values at cell at this time
Field value at position
Offset field value (default = 0)


Operand Type Location
input {vol,surface}<Type>Field $FOAM_CASE/<time>/<inpField>
output file - -
output field {vol,surface}<Type>Field $FOAM_CASE/<time>/<outField>

where <Type>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor.


Example of the reference function object by using functions sub-dictionary in system/controlDict file:

    // Mandatory entries (unmodifiable)
    type            reference;
    libs            (fieldFunctionObjects);

    // Mandatory (inherited) entries (runtime modifiable)
    field           <inpField>;

    // Optional entries (runtime modifiable)
    position    (0 0 0);
    scale       1.0;
    offset      0.0;
    interpolationScheme    cell;

    // Optional (inherited) entries
    result          <fieldResult>;
    region          region0;
    enabled         true;
    log             true;
    timeStart       0;
    timeEnd         1000;
    executeControl  timeStep;
    executeInterval 1;
    writeControl    timeStep;
    writeInterval   1;

where the entries mean:

Property Description Type Required Default
type Type name: reference word yes -
libs Library name: fieldFunctionObjects word yes -
field Name of the operand field word yes -
position Position to sample vector no <not used>
scale Scale value scalar no 1.0
offset Offset value scalar no 0.0
interpolationScheme Sampling scheme word no cell

The inherited entries are elaborated in:

Example by using the postProcess utility:

postProcess -func "reference(<field>)"

Further information


Source code:



  • Introduced in version v1806