setFields.C File Reference

Initialises fields with default and zone values. More...

Go to the source code of this file.

Detailed Description

Initialises fields with default and zone values.

Original source file setFields.C

The default and zone values are read from a dictionary which defaults to system/setFieldsDict, cellZones are used to specify the internal field values and faceZone patch field values or by extrapolation from the internal field.

Usage
Any number of fields can be initialised on any number of zones, for example the 1D shock tube is initialised by
    defaultValues
    {
        U       (0 0 0);
        T       348.432;
        p       100000;
    }

    zones
    {
        lowPressure
        {
            type        box;

            box         (0 -1 -1) (5 1 1);

            values
            {
                T       278.746;
                p       10000;
            }
        }
    }
and the water in the tank of the rotatingCube VoF case is initialised by
    defaultValues
    {
        alpha.water 0;
    }

    zones
    {
        cells
        {
            type        box;

            box (-1e300 -1e300 -1e300) (1e300 0 1e300);

            values
            {
                alpha.water 1;
            }
        }
    }

    extrapolatePatches
    {
        "inlet|outlet"   (alpha.water);
    }
which sets the internal values of phase-fraction field and inlet and outlet patch values by extrapolation from the internal to provide consistent boundary distribution.

Alternatively the inlet and outlet patch values can be set explicitly on a faceZone constructed from the corresponding patches:

    defaultValues
    {
        alpha.water 0;
    }

    zones
    {
        cells
        {
            type        box;

            box (-1e300 -1e300 -1e300) (1e300 0 1e300);

            values
            {
                alpha.water 1;
            }
        }

        patchFaces
        {
            type        box;
            zoneType    face;

            box (-1e300 -1e300 -1e300) (1e300 0 1e300);

            zone
            {
                type        patch;
                patches     (inlet outlet);
            }

            values
            {
                alpha.water 1;
            }
        }
    }

Definition in file setFields.C.