OpenFOAM® v2.0.0: New Meshing Functionality

OpenFOAM® v2.0.0: New Meshing Functionality

16th June 2011

Cyclic Boundary Condition

The cyclic boundary condition, also know as a periodic boundary condition, treats 2 boundary regions as if they are physically connected. They are used for repeated geometries , e.g. heat exchanger tube bundles. In versions of OpenFOAM before v2.0.0, a cyclic patch contained the faces for both regions of the boundary, i.e. cyclic behaviour was described with a single patch. In v2.0.0, however, the boundary regions are split into 2 separate patches that are linked to one another in the respective mesh file, e.g. boundary, blockMeshDict, through the keyword neighbourPatch. Each pair of connecting faces must have areas to within a tolerance given by the matchTolerance keyword. Faces do not need to be of the same orientation.

The syntax describing a cyclic condition in the boundary file of a mesh, prior to v2.0.0 may be as follows.

patch0
{
    type            cyclic;
    nFaces          512;
    startFace       11520;
    featureCos      0.9;
}
The syntax for an equivalent condition in the boundary file of a mesh in v2.0.0 would be as follows.

patch0_half0
{
    type            cyclic;
    nFaces          256;
    startFace       11520;
    matchTolerance  0.0001;
    neighbourPatch  patch0_half1;
}
patch0_half1
{
    type            cyclic;
    nFaces          256;
    startFace       11776;
    matchTolerance  0.0001;
    neighbourPatch  patch0_half0;
}

A foamUpgradeCyclics utility is available to convert a mesh with one of more cyclic boundary conditions of the old form, into the form for v2.0.0.

Utility
foamUpgradeCyclics utility - $FOAM_UTILITIES/preProcessing/foamUpgradeCyclics
Further information
User Guide: Boundaries
Example
Box of turbulence - $FOAM_TUTORIALS/DNS/dnsFoam/boxTurb16

Changes to snappyHexMesh

As reported previously, the latest version of snappyHexMesh includes feature edge handling. Complex geometries may contain sudden changes in surface normal direction, e.g. between sides of a box, or across a crease in a surface. Such a feature can be resolved reasonably well by refining cells locally around it. However the feature can be better resolved by aligning edges in the mesh with it. The sudden change in surface normal direction can then be directly represented by an equivalent change in surface normal direction of mesh faces across feature.

The image below shows feature edge handling in action. On this flange geometry, a mesh has been generated with barely enough cells to resolve the geometry. Nevertheless, with the feature edge handling, mesh edges are aligned with surface features so that the geometry is well represented by the coarse mesh.

feature edge handling on flange

Additional changes to snappyHexMesh include the following:

  • boundary faces and edges are merged at end of snapping phase, rather than at the beginning of the layer addition phase;
  • extrusion across multi-processor boundaries;
  • optional specification of type of patch for given surface geometry;
  • can handle cyclic patches in initial mesh (serial meshing only);
  • preserves faceZones shape during layer insertion;
  • mesh smoothing between surface smoothing and snapping is reinstated in v2.0.0.

Example
Flange case: $FOAM_TUTORIALS/mesh/snappyHexMesh/flange

Changes to blockMesh

The syntax for blockMesh has been modified to be more compatible with the general syntax for OpenFOAM input files. More specifically, the patches sub-dictionary has now been replaced by a boundary sub-dictionary, the different keyword enabling easy backward-compatibility. The syntax of the boundary sub-dictionary is now consistent with the boundary file itself, e.g. it uses the same syntax as the the cyclic boundary condition described above. So, for example, a cyclic patch described in the syntax prior to v2.0.0 may be as follows.

patches
(
    cyclic patch0
    (
        (0 3 2 1)
        (4 5 6 7)
    )
...
The equivalent syntax in v2.0.0 would be as follows.

boundary
(
    patch0_half0
    {
        type cyclic;
        neighbourPatch patch0_half1;
        faces
        (
            (0 3 2 1)
        );
    }
...

Further information
User Guide: blockMesh
Examples
An interesting example is:
$FOAM_TUTORIALS/incompressible/pisoFoam/les/pitzDailyDirectMapped
Otherwise, see all blockMeshDict files in $FOAM_TUTORIALS/
Source code
blockMesh library - $FOAM_SRC/mesh/blockMesh

Improvements to pointField Handling

For simulations that use pointField, e.g. those that include mesh motion, recent changes improve parallel running and volPointInterpolation. The main change is that a pointField now operates effectively in parallel because points located on multiple processors are handled locally, with respect to the processors using the point, instead of handling all these points on the master processor (using globalPointPatch in earlier versions). Consequently, cases can now be decomposed, reconstructed and restarted without any limitation, and parallel simulations are faster.

In addition, a new cyclicSlip boundary condition has been introduced, particularly for mesh motion, that applies slip behaviour for point motion but which also keeps points on the cyclic in sync with those on its neighbour cyclic patch.

Binary Mesh Format

A new binary file format has been developed for reading and writing meshes. The change in format relates to optimising the reading and writing of lists of small lists, e.g. lists of faces and cells in a mesh, for which a special IO container class has been developed, named CompactIOList. The new class is similar to the IOList class but it is considerably faster when reading/writing binary format. Our tests showed an increase in speed of up to a factor of 5, giving up to a factor of 2 speed-up when reading in large meshes.

Meshes generated in binary in version 2.0.0 are not compatible with previous versions of OpenFOAM. However, meshes generated in binary in previous versions of OpenFOAM are compatible with version 2.0.0 of OpenFOAM.

Source code
CompactIOList class - $FOAM_SRC/OpenFOAM/db/IOobjects/CompactIOList