Skip to main content

reference

Description

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:

refc=s(fc(t)fp+foff) \text{ref}_c = s(f_{c}(t) - f_p + f_{off})

where:

refc\text{ref}_c : Field values at cell

ss : Optional scale factor (default = 1)

fc(t)f_{c}(t) : Current field values at cell at this time

fpf_p : Field value at position

fofff_{off} : Offset field value (default = 0)

Operands

OperandTypeLocation
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.

Usage

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

reference1
{
// 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:

PropertyDescriptionTypeRequiredDefault
typeType name: referencewordyes-
libsLibrary name: fieldFunctionObjectswordyes-
fieldName of the operand fieldwordyes-
positionPosition to samplevectorno<not used>
scaleScale valuescalarno1.0
offsetOffset valuescalarno0.0
interpolationSchemeSampling schemewordnocell

The inherited entries are elaborated in:

Example by using the postProcess utility:

postProcess -func "reference(<field>)"

Further information

Tutorial:

Source code:

API:

History: Introduced in version v1806