Chapter 6 Boundary conditions

Boundary conditions are specified in field files, e.g. p, U, in time directories. The structure of these files is introduced in sections 2.1.4 and 4.2.8 . They include three entries: dimensions for the dimensional units; internalField for the initial internal field values; and, boundaryField where the boundary conditions are specified. The boundaryField requires an entry for each patch in the mesh. The patches are specified in the boundary file; below is a sample file from a 2D incompressibleFluid example in OpenFOAM.


5
(
    outlet
    {
        type            patch;
        nFaces          320;
        startFace       198740;
    }
    up
    {
        type            symmetry;
        inGroups        List<word> 1(symmetry);
        nFaces          760;
        startFace       199060;
    }
    hole
    {
        type            wall;
        inGroups        List<word> 1(wall);
        nFaces          1120;
        startFace       199820;
    }
    frontAndBack
    {
        type            empty;
        inGroups        List<word> 1(empty);
        nFaces          200000;
        startFace       200940;
    }
    inlet
    {
        type            patch;
        nFaces          320;
        startFace       400940;
    }
)
The corresponding pressure field file, p, is shown below.
16dimensions      [0 2 -2 0 0 0 0];
17
18internalField   uniform 0;
19
20boundaryField
21{
22    inlet
23    {
24       type             zeroGradient;
25    }
26    outlet
27    {
28        type            fixedValue;
29        value           uniform 0;
30    }
31    up
32    {
33        type            symmetry;
34    }
35    hole
36    {
37        type            zeroGradient;
38    }
39    frontAndBack
40    {
41        type            empty;
42    }
43}
44
45// ************************************************************************* //

The boundaryField is a sub-dictionary containing an entry for every patch in the mesh. Each entry begins with the patch name and configures the boundary condition through entries in a sub-dictionary. A type entry is required for every patch which specifies the type of boundary condition. The examples above include zeroGradient and fixedValue conditions corresponding to generic patches defined in the boundary file. They also include symmetry and empty types corresponding to equivalent constraint patches, e.g. the up patch is defined as symmetry in the mesh and uses a symmetry condition in the field file.

For details about the main boundary conditions used in OpenFOAM, refer to Chapter 4 of Notes on Computational Fluid Dynamics: General Principles.

OpenFOAM v11 User Guide - Chapter 6 Boundary conditions
CFD Direct