Skip to main content

zeroGradient

Description

The zeroGradient function object creates a volume field with zero-gradient boundary conditions from another volume field.

The result can be used, for example, to post-process near-wall field values.

Operands

OperandTypeLocation
inputvol<Type>Field$FOAM_CASE/<time>/<inpField>
output file--
output fieldvol<Type>Field$FOAM_CASE/<time>/<outField>

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

Usage

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

zeroGradient1
{
// Mandatory entries (unmodifiable)
type zeroGradient;
libs (fieldFunctionObjects);

// Mandatory entries (runtime modifiable)
fields (<field1> ... <fieldN>); \\(U "(T|k|epsilon|omega)");

// Optional entries (runtime modifiable)
result @@<name>;

// Optional (inherited) entries
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: zeroGradientwordyes-
libsLibrary name: fieldFunctionObjectswordyes-
fieldsName of the operand fieldswordListyes-
resultName of the output fieldwordnozeroGradient(@@)

The inherited entries are elaborated in:

Usage by the postProcess utility is not available.

Notes on entries

A list of fields can contain exact names or regular expressions. The token '@@' in the result name is replaced by the name of the source field. In the special case of a single source field (specified as a non-regex), the '@@' token checking is suppressed.

The function object will skip over fields that would not benefit e.g. processor, empty, zeroGradient, symmetry patches. This check should also prevent processing fields multiple times.

Further information

Tutorial:

Source code:

API:

History: Introduced in version v1612+