Skip to main content

div

Description

The div function object computes the divergence of an input field.

To execute div function object on an input <field>, a numerical scheme should be defined for div(<field>) in system/fvSchemes.divSchemes.

Operands

OperandTypeLocation
input{surfaceScalar,volVector}Field$FOAM_CASE/<time>/<inpField>
output file--
output fieldvolScalarField$FOAM_CASE/<time>/<outField>

Usage

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

div1
{
// Mandatory entries (unmodifiable)
type div;
libs (fieldFunctionObjects);

// Mandatory (inherited) entry (runtime modifiable)
field <field>;

// 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: divwordyes-
libsLibrary name: fieldFunctionObjectswordyes-
fieldName of the operand fieldwordyes-

The inherited entries are elaborated in:

Example by using the postProcess utility:

postProcess -func "div(<field>)"

Further information

Tutorial:

Source code:

API:

History: Introduced in version v1606+