[version 14][version 13][version 12][version 11][version 10][version 9][version 8][version 7][version 6]
6.5 Field functions in boundary conditions
Field functions are described in section 6.1 , where their use is demonstrated in initialising non-uniform internalFields within field files in a time directory, and in initialising fields within an fvModel configuration. Field functions can also be used to set non-uniform fields on boundary patches, i.e. to set different values on different faces of a patch. Field functions are used in boundary conditions firstly through the functionalFixedValue boundary condition which uses a field function to specify a non-uniform fixed value across a patch, see section 6.5.1 . They are specify particular parameters in a small number of boundary conditions described in section 6.5.2 and 6.6 .
6.5.1 The functionalFixedValue boundary condition
The functionalFixedValue boundary condition accompanies field functions, described in section 6.1 . Field functions allow the user to initialise non-uniform fields. While they are typically applied to the internalField, functionalFixedValue is a fixed value boundary condition where the values are specified with a field function.
The coded field function from section 6.1.3 provides a good example to illustrate the functionalFixedValue condition. Recall that the example initialises swirl flow according to Equation 6.1 , by the following configuration in the 0/U file.
internalField
{
type coded;
evaluate
#{
field = velocity(1, 0, 0) + (C ^ rate(2, 0, 0));
#};
}
boundaryField
{
inlet
{
type functionalFixedValue;
value
{
$internalField;
}
}
…
6.5.2 Parameters as field functions
A small number of general boundary conditions have parameters which are implemented as field functions. The following foamFind command locates them.
foamFind -dir $FOAM_SRC/finiteVolume/fields/fvPatchFields \
-search UFunctional

