mag

Description

The mag function object computes the magnitude of an input field.

Operands

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

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

Usage

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

mag1
{
    // Mandatory entries (unmodifiable)
    type            mag;
    libs            (fieldFunctionObjects);

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

    // 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: mag word yes -
libs Library name: fieldFunctionObjects word yes -
field Name of the operand field word yes -

The inherited entries are elaborated in:

Example by using the postProcess utility:

postProcess -func "mag(<field>)"

Further information

Tutorial:

Source code:

History

  • Introduced in version v1606+