OpenFOAM® v3.0+: New Pre-Processing Functionality

OpenFOAM® v3.0+: New Pre-Processing Functionality


Creating initial fields and boundary conditions

The new createZeroDirectory utility is designed to ease the set-up of OpenFOAM cases by creating a complete time zero directory, containing all necessary initial field files, their values and boundary conditions.

The utility is configured using a caseProperties dictionary located under the $FOAM_CASE/system directory (or system/regionName for multi-region cases). This dictionary has two main sections which describe the field initial conditions and boundary conditions. All other solver information is retrieved using pre-defined templates, set according to the solver name given in the case controlDict input file. Similarly, turbulence fields are generated based on the settings provided in the turbulenceProperties file.

The initialConditions sub-dictionary provides the initial field values, e.g.:

    U                   uniform (20 0 0);
    p                   uniform 0;
    k                   uniform 0.24;
    omega               uniform 1.78;
    nut                 uniform 0;

The boundaryConditions sub-dictionary is used to specify the set of boundary conditions. Each set is applied to a set of patches, which can include patchGroups, e.g.:

    category            wall;
    type                noSlip;
    patches             (motorBikeGroup);
        wallFunction        highReynolds;
        motion              stationary;

The utility relies on a set of template dictionaries, which are stored outside of the case in a central location:


Users are free to modify these templates, and use case specific modifications if required (see -templateDir keyword upon execution). The templates define the properties of each solver, sub-models and boundary conditions. The templates for boundary conditions provide a framework for cases with both fluid and solid media. The solver template dictionaries include information relating to the:

  • type, i.e. compressible or incompressible;
  • whether it operates on single or multi-region geometries;
  • sub-models, e.g. turbulence;
  • base fields, e.g. pressure and velocity for flow solvers.

Currently the only sub-models supported relate to turbulence, for which the kEpsilon, kOmega, kOmegaSST and laminar models can be selected.

Fluid boundary conditions are further split into incompressible, compressible and buoyant categories, where the distinction is made for the type of pressure that is being solved, i.e. p∕ρ  \relax \special {t4ht=, p  \relax \special {t4ht= or prgh  \relax \special {t4ht=. For each category, the conditions are grouped into wall, inlet and outlet conditions.

Solid boundaries are all of the wall type, for which different thermal options can be applied.

motorBike case: $FOAM_TUTORIALS/preProcessing/createZeroDirectory/motorBike
cavity case: $FOAM_TUTORIALS/preProcessing/createZeroDirectory/cavity
multi-region case: $FOAM_TUTORIALS/preProcessing/createZeroDirectory/snappyMultiRegionHeater

Source code
createZeroDirectory - $FOAM_UTILITIES/preProcessing/createZeroDirectory

This is a beta feature with limited coverage and will be extended in future releases