In June 2025, Henry Weller at CFD Direct completed a rewrite of mesh zones and associated tools, released in OpenFOAM v13 from The OpenFOAM Foundation.  A zone is collection of cells, faces or points in a mesh which can be identified by a name.  A zone usually defines a region of volume or surface in which, for example, a source term is applied, a field is initialised, a calculation is performed, the mesh is rotated, etc.

The purpose of the rewrite of mesh zones was to make them dynamic, so they would work effectively for complex CFD problems, especially involving moving meshes.  Before the rewrite, zones were static, meaning a fixed number of them were created at the beginning of a simulation.  They generally remained unchanged during a simulation (except when undergoing refinement/un-refinement of cells).  Zones could not overlap, e.g. one cell could not belong to multiple cell zones, which was a severe limitation.

New Design of Zones

In the new design, a zone can be static or dynamic.  A static zone can be created as part of the meshing process, or using the new createZones tool, configured through a createZonesDict file.  Static zones are written to relevant  cellZones, faceZones and pointZones files in the polyMesh directory, and can still update due to refinement/un-refinement of cells as before. 

Alternatively, a zone can also be generated dynamically within a utility application, e.g. setFields  and solver applications, i.e. foamRun or foamMultiRun.  Dynamic zones for a CFD simulation are configured in a zonesGenerator file and are regenerated during a simulation in cases where the mesh moves, or due to any topological change (unless the user can instruct them to remain unchanged).

Zone Generation

The new zones can therefore be configured in a createZonesDict file, zonesGenerator file and other configuration files for utilities.  The configuration itself is consistent throughout, using the types of zoneGenerator which can be listed by running foamToC.

foamToC -table zoneGenerator

The types of zoneGenerator are categorized below.

  • Volume: annulus, box, cylinder, hemisphere, insideSurface, sphere, truncatedCone.
  • Face specific: face, flip, normal, orient, patch, plane, surface.
  • Cell/point specific: cellZone, containsPoints, point.
  • Manipulate/combine: all, clear, difference, intersection, invert, periodic, remove, set, union.

Information about the configuration of a listed zoneGenerator, e.g. cylinder, is available by running the foamInfo script (selecting option 3 for the cylinder example).

foamInfo cylinder

Dynamic Zone Example

Dynamic zones can be demonstrated in OpenFOAM v13 using the engine2Value2D case.  The case includes a zone configured in a zonesGenerator file that defines the ignition region for combustion using a cylinder zoneGenerator.  The zone can be made dynamic by setting the moveUpdate switch to on as shown below.  Adding the write zoneGenerator, the zone is also written out with the polyMesh into time directories alongside the fields.  This enables the user to visualise the zone in ParaView as shown in the image, corresponding to time = 3325s.   The zone is regenerated to include different cells, as the piston and valves move, and the mesh correspondingly moves, deforms and and maps.

ignition
{
    type        cylinder;
    zoneType    cell;
    moveUpdate  on;  // Activate

    point1  (1 -0.05 -0.12);
    point2  (1 0 -0.12);
    radius  0.03;
}

write
{
    type        write;
    zoneType    cell;
}

Associated Utilities

The new design has been introduced to a number of popular utility applications that use zones.  As mentioned already, the createZones application provides a simpler, more powerful replacement for the lousy topoSet which reads from a createZonesDict or zoneGenerator file.  The other utilities which have been rewritten, and are far better to use as a result, are listed below.

Produced by CFD Direct

The creation of dynamic zones in OpenFOAM involved a major rewrite of parts of OpenFOAM.  An early indication of the planned rewrite is in the commit message, Christmas Day 2023: “… paves the way for the completion of the update of zone handling allowing mesh points, faces and cells to exist in multiple zones”.  A commit at the end of January 2024 reached an early milestone that “the number of zones of each type can change during the run”.  A later commit list shows further work on zones in March/April 2024 which picked up again in April 2025 with the idea that zones are “either read or generated by an external processes”.  The remaining work was undertaken in May and June.

This is yet another example of a major rewrite of OpenFOAM that only CFD Direct are willing and (seemingly) able to do.  The cost of the rewrite was approximately £60,000.  This is the kind of money that buys a single commercial CFD licence, and a tiny sum compared to the public money allocated to projects that use OpenFOAM around the world annually.  The funding came from supporters of OpenFOAM, and particularly Wärtsilä, Finland.  To those organisations: thank you on behalf of the users of OpenFOAM.  To other users and funding councils: if you want to see more developments like this, go and fund OpenFOAM today.

Dynamic Zones in OpenFOAM