Recombination of Voxel Transition Cells for OpenFOAM Meshes

Pointwise V18.3 introduced a voxel capability (hex-core) that uses regular hexahedra instead of unstructured tetrahedra in regions away from the geometry model. The space between the final T-Rex (anisotropic tetrahedral extrusion) front and the farfield topology (see Figure 1) is filled with regular hexahedral cells. Use of regular hexahedra in the mesh can improve the CFD flow solver’s rate of convergence and solution accuracy. The transition between different sized hexahedral cells is achieved using combinations of tetrahedra and pyramid cells. This ensures maximum compatibility with a wide range of flow solvers. For some solvers like OpenFOAM, the usage of pyramids in the transition layers can be problematic. In this article, we describe a utility (vtCombine) for Caelus developed by Applied CCM that recombines the transition layers between the hexahedra into polyhedra cells. Resulting in smaller cell count, improved mesh quality and improved solver convergence.

This flow solution for NASA’s Common Research Model was computed by CRAFT Tech using their CRUNCH CFD solver on a hex-core mesh from Pointwise V18.3 (Figure 1).

Figure 2 shows an example transition region between four small hexahedra (blue cells) at the bottom to one large hexahedron at the top (not shown). To transition from the small to the large, combinations of tetrahedra and pyramids are used, as shown in Figure 2 (right sub-image).

Simple mesh transitioning from four small hexahedra to one large hexahedron (not shown). Cells are coloured by their type, hexahedra (blue), pyramid (yellow) and tetrahedra (red). The cells have been shrunk in the right sub-image to allow visualisation inside the mesh (Figure 2).

Recombination of transition cells

OpenFOAM can handle polyhedral cells; therefore, it would be ideal not to retain the pyramid/tetrahedron cells in the transition, rather replace them with polyhedra, as shown in Figure 3. It is clear by comparing Figures 2 and 3 that there are features of the transition region which could be improved: (1) the pyramids and tetrahedra can have a smaller volume than the smallest hexahedra, leading to additional cells and (2) the tetrahedra are far from regular, with some tiny internal angles.

Example of polyhedral cells (magenta) between hexahedra cells (blue) produced by vtCombine (Figure 3).

Brief algorithm

To achieve recombination of the transition cells, Applied CCM created a utility for Caelus called vtCombine. A brief outline of the algorithm for vtCombine is:

  • Export the voxel mesh from Pointwise version 18.3 and later, using OpenFOAM as the CAE solver.
  • Load the OpenFOAM formatted mesh, perform cell type detection and identify cells in zipper layer. The zipper layer is the layer of cells between the final T-Rex front and the voxel cells. This step requires some information from Pointwise which is exported from a Glyph script (Figure 4).
  • Mark cells in the zipper layer.
  • Loop through all points in the mesh to determine which points, faces and cells need removing.
  • A supercell is a result of merging multiple cells.
  • For each supercell, create a list of cells that will merge into it and loop through existing cells to create of list of faces for each supercell.
  • Create a list of superfaces. Superfaces are those that will replace the merged faces.
  • Create a list of new points in the mesh.
  • Make internal and boundary faces for the new mesh.
  • Generate new cells and calculate owner-neighbour lists.
  • Calculate face and cell centres and face areas.
  • Make a new mesh using new points, face and cells.
  • Merge faces on boundaries and straight lines edges.
  • Renumber mesh. See the article “It’s all in the numbering – mesh renumbering may improve simulation speed.”
  • Write out the new OpenFOAM mesh.
Glyph script for exporting information required for vtCombine (Figure 4).

Performance

Numerous tests have been conducted to evaluate the resource usage and performance of vtCombine at recombining the tetrahedra/pyramid combinations into polyhedra accurately. One example is an internal mesh in a quadcopter shown in Figures 5 and 6.

Slice of quadcopter internal mesh showing original voxel transition cells (Figure 5).
Slice of quadcopter internal mesh after voxel transition layer recombination (Figure 6).

From testing of vtCombine the memory usage was found to be proportional to cell count (see Figure 7), with the largest mesh tested being 207 million cells.

Memory usage of vtCombine as a function of cell count (Figure 7).

The execution time was also found to be proportional to the mesh cell count (see Figure 8).

Execution time of vtCombine as a function of cell count (Figure 8).

Is there a benefit from recombining the transition cells?

vtCombine provides the ability to recombine into polyhedra the transition cells in the voxel mesh. This means we can now have boundary layer resolution using T-Rex with the efficiency of polyhedra and hexahedra in the farfield. Does this give any benefit?

Steady-state laminar flow past a sphere was used to investigate the effect of farfield mesh type on simulation time and accuracy. The same T-Rex inflation around the sphere on three separate meshes using different farfield cell types was tested:

  • Voxel (Figure 9),
  • Recombined voxel (Figure 10), and
  • Tetrahedra (Figure 11).
Voxel mesh sliced to show transition cells and T-Rex layers (Figure 9).
Recombined voxel mesh sliced to show polyhedra replacement of transition cells and T-Rex layers (Figure 10).
Equivalent tetrahedra mesh (Figure 11).
Mesh typeCell countsAvg. Non-orthogonality (degrees)Execution time (s)
Voxel12,900,8329.414,907.49
Recombined voxel10,781,9418.111,681.4
Tetrahedra14,887,51520.319,433.16
Cell counts, average non-orthogonality and execution times for each mesh types tested.
(Table 1).

It was no surprise that the recombined voxel mesh was fastest because it had the least number of cells (see Table 1). Looking at the convergence of the pressure equation (Figure 12), one can see it is much better for the recombined voxel mesh. This is likely due to the combined cells having improved cell quality.

The difference in velocity residuals (see Figure 13) was only minimal, and the velocity magnitude contour plots for each mesh type show the voxel (Figure 14) and recombined voxel (Figure 15) meshes have near-identical results. The tet mesh results (Figure 16) exhibit a slightly shorter wake region behind the sphere.

Pressure residual comparison for the three mesh types (Figure 12).
Velocity residual comparison for the three mesh types (Figure 13).
Voxel mesh velocity magnitude contour plot (Figure 14).
Recombined voxel mesh velocity magnitude contour plot (Figure 15).
Tet mesh velocity magnitude contour plot (Figure 16).

Summary

Table 2 indicates that vtCombine achieves a good reduction in both cell count and OpenFOAM solver execution time. Proving that it is worth recombining the transition cells in voxel meshes. Conversion can only be after export, using utilities such as vtCombine until Pointwise supports polyhedral cells natively.

Recombined voxel compared toCell count reduction (%)Execution time reduction (%)
Voxel1621
Tetrahedra2739
Reduction in cell count and execution time for the recombined voxel mesh compared to the voxel and tetrahedra meshes (Table 2).

vtCombine is under development and yet to be released publicly. If you would like to contribute to its development, please contact Applied CCM at info@appliedccm.com.au.

Want to test voxel meshes yourself?

If you want to try the voxel meshing feature in Pointwise for yourself, now is the time to request a free trial license.

This entry was posted in Applications, Software and tagged , , , , . Bookmark the permalink.

2 Responses to Recombination of Voxel Transition Cells for OpenFOAM Meshes

  1. Cool stuff. Not sure if it is feasible, but any chance this functionality could be incorporated into the OpenFOAM CAE plugin as an export option?

    I have done some proof-of-concept, transform at export work in the past. See:
    https://github.com/dbgarlisch/CaeUnsDualMesh
    https://github.com/dbgarlisch/CaeUnsRecomb2DPoly
    https://github.com/dbgarlisch/CaeUnsRecomb2D
    https://github.com/dbgarlisch/CaeUnsPrint3D

  2. Darrin Stephens says:

    Hi David,
    The utility uses parts of the OpenFOAM library for efficiency, so the plugin would need to be compiled against the relevant OpenFOAM libraries. This would raise the question regarding license compatibility.
    Also, I’m not sure if the approach I have taken could be easily re-written to work with your streaming approach used in the OpenFOAM CAE plugin. I see vtCombine as a stop-gap measure waiting for Pointwise to support polys natively.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s