v2406: New and improved post-processing

New viewFactorHeatFlux function object

TOP

The viewFactorHeatFlux function object makes it easy to identify the heat exchange between patches when using the viewFactor radiation model.

Example usage:

viewFactorHeatFlux1
{
    // Mandatory entries (unmodifiable)
    type        viewFactorHeatFlux;
    libs        (utilityFunctionObjects);

    // Optional entries (runtime modifiable)
    qr          qr;
}

Tutorial

  • NA

Source code

New Ensight single file format reading

TOP

In addition to the more familiar EnSight case that use multiple files for storing transient results, EnSight also allows storage of transient results in a single file format, which is potentially more efficient or simply more convenient to use.

With this release, this transient single-file format is now a supported surface field format, which means it can be used in things like *MappedFile* functions and the surfaceNoise utility.

Source code

Gitlab

New Ensight cloud function object

TOP

The ensightCloud function object writes Lagrangian data in EnSight measured format. In parallel, all data are written from the master.

The configuration parameters and the behaviour of the ensightCloud function object are nearly identical to the vtkCloud function object with parcel selection support based on stride, field filtering etc.

Generated EnSight files will also include a mesh bounding box, which provides a reference for visualization (and is also necessary for the ParaView reader).

Source code

New polyhedral cell conversion

TOP

The cellDecomposer function object decomposes cells into 'basic' shapes and maps selected fields onto it, similar to the mapFields utility. The main benefit is for post-processing OpenFOAM meshes and results with third-party tools that cannot handle polyhedral shapes. There are two main controls:

  • Selection of cells. This uses the same controls as any fvOption, e.g. selectionMode all or selectionMode cellSet
  • Method of decomposition through decomposeType:
    • faceCentre : decompose cells into tets using face centre and cell centre, where a hex becomes 6*4 tets.
    • faceDiagonal : decompose cells into tets using face diagonal, similar to the decomposition inside Lagrangian particle tracking, where a hex becomes 6*2 tets.
    • pyramid : keep faces intact but create (polygonal-base) pyramids using the cell centre, where a hex becomes 6 pyramids.
    • faceDiagonalQuads : like faceDiagonal but splits faces into quads and triangles instead of [only] triangles.
    • polyhedral : like faceDiagonalQuads but only decompose non-hex/prism/tet cells in selected set. Used to convert polyhedral mesh into 'simple' mesh.

A typical example to convert all polyhedral cells into a sub-region mesh containing non-polyhedral cells only:

functions
{
    cellDecomposer
    {
        // Mandatory entries
        type            cellDecomposer;
        fields          (p U);
        mapRegion       simpleMesh;

        // Execute when results are written
        writeControl    writeTime;

        // Decompose type
        decomposeType   polyhedral;

        // Which cells to convert
        selectionMode   all;
    }
}

This mesh and results can be processed using the usual -region option:

checkMesh -region simpleMesh
foamToEnsight -region simpleMesh

The image below shows a simple 3-cell thick block mesh where one of the corner cells has been split using 2x2x2 refinement, creating polyhedral cells:

Left: Original mesh with refinement; right: after running the new function object the remaining cells will be hexes, pyramids, prisms and tetrahedra.

Another example to convert all cells in a certain geometric region to tetrahedra:

functions
{
    cellDecomposer
    {
        // Mandatory entries
        type            cellDecomposer;
        fields          (p U);
        mapRegion       tetMesh;
        // Decompose type
        decomposeType   faceCentre;
        // Which cells to convert
        selectionMode   geometric;
        // Generate cellSet c0 using topoSet commands:
        cellSet         c0;
        selection
        {
            a
            {
                action  use;
                source  boxToCell;
                box     (1 1 1)(0 0 0);
            }
            b
            {
                action  invert;
            }

        }
    }
}

Limitations

  • mesh motion and topology change are not currently supported
  • decomposing a cell with refinement can lead to multiple faces in between two cells:
    • a hex gets two edges split because edge-connected cells get refined (this hex now is a polyhedral cell)
    • the edge on the original hex is split into two neighbouring tetrahedra, but now the quad inbetween is split into two triangles, both sharing the same two cells:
  • in checkMesh this is reported as
Checking topology...
    ..
  <<Found 2015 neighbouring cells with multiple inbetween faces.
    Upper triangular ordering OK.
  <<Writing 4034 unordered faces to set upperTriangularFace
  • splitting complex cells can quite easily generate geometrically invalid cells, e.g.
***High aspect ratio cells found, Max aspect ratio: 1.59875e+96, number of cells 99
  <<Writing 99 cells with high aspect ratio to set highAspectRatioCells
    Minimum face area = 1.34886e-06. Maximum face area = 1.00344.  Face area magnitudes OK.
 ***Zero or negative cell volume detected.  Minimum negative volume: -3.55077e-07, Number of negative volume cells: 99
  <<Writing 99 zero volume cells to set zeroVolumeCells
    Mesh non-orthogonality Max: 158.664 average: 21.4979

Source code

Tutorial