What are field sources in OpenFOAM?

Field sources, created by CFD Direct, are explained in our OpenFOAM Training

See Training

6.2 Field sources

Field sources, specified by the optional sources entry in field files, relate to cases which include a mass or volume source that introduces fluid at some internal region of the domain. A good example to demonstrate field sources is damBreakInjection, which is an extension of the damBreakLaminar tutorial from section 2.2 . The case can be run by the following commands.


    run
    cp -r $FOAM_TUTORIALS/incompressibleVoF/damBreakInjection
    cd damBreakInjection
    ./Allrun
Note that the case originally only contains files with the additional entries from the damBreakLaminar case. The Allrun script executes the foamMergeCase script to merge the original files from the damBreakLaminar case, before meshing and running the simulation. The first main addition in damBreakInjection case is an fvModel defined in constant/fvModels, reproduced below.


    injection
    {
        type            volumeSource;
        phase           water;
        cellZone
        {
            type            containsPoints;
            points          ( (0.438 0.438 0.0073) );
        }
        volumetricFlowRate 0.0003;
    }
This volumeSource model injects water at a volumetric flow rate of 0.0003 eqn within a defined cell zone consisting of a single cell. When such a model is applied, some field values for the injected fluid must be specified, e.g. its velocity. The sources entries enable this by including them in the fields that require values. For the damBreakInjection, the velocity of the injected fluid is specified by a sources entry in the U file which is reproduced below.


    sources
    {
        injection
        {
            type            uniformFixedValue;
            uniformValue    (-1 0 0);
        }
    }
Through the common name of the model, i.e. injection, the entry corresponds to the volumeSource model in the fvModels file. The velocity is specified as a uniformFixedValue condition with a value of (-1 0 0). The resulting injection is shown in an image of phase fraction below, displays the phase fraction alpha.water in each cell.

PICT\relax \special {t4ht=


Figure 6.4: damBreak with an injection source upper right.


The water is injected in the upper right quadrant of the image, in the cell which is red, corresponding to alpha.water = 1. It initially follows a path in the negative eqn direction, from right to left, according to the direction specified in the sources entry. But soon afterwards, gravity causes the injected water to move downward, i.e. from top to bottom in the image.

OpenFOAM v14 User Guide - 6.2 Field sources
OpenFOAM User Guide