Skip to main content

setFlow

Description

The setFlow function object provides options to set the velocity and flux fields as a function of time.

Useful for testing advection behaviour of numerical schemes by e.g. imposing solid body rotation, vortex flows. All types include a scaling Foam::Function1 type enabling the strength of the transformation to vary as a function of time.

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 setFlow function object by using functions sub-dictionary in system/controlDict file:

setFlow1
{
// Mandatory entries (unmodifiable)
type setFlow;
libs (fieldFunctionObjects);

// Mandatory entries (runtime modifiable)
mode rotation;
scale 1;

// Optional entries (runtime modifiable)
U U;
rho none;
phi phi;
reverseTime 1;

// When mode=function
velocity (1 0 0);

// When mode=rotation
omega 6.28318530718;
origin (0.5 0 0.5);
refDir (1 0 0);
axis (0 1 0);

// When mode=(vortex2D|vortex3D)
origin (0.5 0 0.5);
refDir (1 0 0);
axis (0 1 0);

// 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: setFlowwordyes-
libsLibrary name: fieldFunctionObjectswordyes-
modeOperating mode - see belowwordyes-
scaleScaling functionFunction1<scalar>yes-
UName of velocity fieldwordnoU
rhoName of density fieldwordnonone
phiName of flux fieldwordnophi
reverseTimeSpecified time to reverse flow directionscalarnoVGREAT
velocityVelocity functionFunction1<vector>conditional-
omegaRotational speed functionFunction1<scalar>conditional-
originRotation vector originvectorconditional-
refDirRotation vector reference directionvectorconditional-
axisRotation vector axisvectorconditional-

Options for the mode entry:

function
rotation
vortex2D
vortex3D

The inherited entries are elaborated in:

Usage by the postProcess utility is not available.

Further information

Tutorial:

Source code:

API:

History: Introduced in version v1706