grokkingstuff Home Blog Projects Wiki Calculators About

Cell Types in CFD -- hexahedra, tetrahedra, polyhedra, prisms

date2026-07-26tags:cfd: :mesh: :cell-types:

Introduction

Cell topology irreducibly affects numerical accuracy, discretisation error scaling, and mesh distortion tolerance. Every major platform makes different default choices based on philosophy: OpenFOAM (snappyHexMesh, cfMesh, blockMesh), ANSYS Fluent (hybrid-tet mesher, polygonal options), Star-CCM+ (polygonal-polyhedral, embedded mesh). The underlying mathematics -- truncation error, gradient approximation, flux conservation -- is the same across platforms.

This note compares cell types on the metrics that matter for CFD accuracy: truncation error scaling, gradient approximation fidelity, memory footprint, and tolerance to mesh distortion. It also covers hybrid-mesh strategies. Hybrid meshes are the modern industrial default across all major platforms.

Truncation error scaling by cell type

The finite-volume method integrates the governing equations over each control volume. The method approximates face values and gradients based on cell-centre data. The leading-order truncation error depends on cell topology.

A regular hexahedral mesh aligned with the coordinate axes uses central difference. A first-derivative approximation is second-order accurate:

$$\frac{\partial \phi}{\partial x} = \frac{\phi_{i+1} - \phi_{i-1}}{2\Delta x} + O(\Delta x^2)$$

Tetrahedral cells disrupt this symmetry. A tet has four triangular faces, and the face-centre vector rarely aligns with the line joining cell centres. The interpolation error is first-order:

$$\text{error}_{\text{tet}} \sim O(\Delta x)$$

Polyhedral cells have more faces and better approximate the face-area vector sum. Polyhedra yield an effective order between first and second. Benchmark studies show polyhedra perform 30-50% better than tetrahedra per cell. Polyhedra still lag behind hexahedra of comparable quality on structured-geometry applications.

Cell typeFacesOrderRelative numerical diffusionRelative accuracy per cell
Hexahedron62ndBaseline1.0 (best)
Prism52nd1.5-2x0.7-0.8
Polyhedron>=81.5th0.5-0.7x0.5-0.7
Tetrahedron41st2-3x0.3-0.5

Sufficient cells of any type all converge to the same solution. Consistency and stability imply convergence, per Lax equivalence. Tet meshes may require 3-5x the cell count of a hex mesh to reach the same accuracy. Mesh topology is not mere geometry.

Gradient approximation and cell topology

Gradient computation at cell centres is the single operation most sensitive to cell shape.

A hex face centre lies approximately midway between its two owning cells, making linear interpolation accurate to O(Delta x^2). On tets, the face centroid can be significantly offset from the midpoint, introducing even first-order interpolation error.

The Gauss gradient theorem applied to a tetrahedron:

$$\nabla \phi_P = \frac{1}{V_P} \sum_{f \in P} \phi_f \vec{S}_f$$

Tets produce noisier gradients than hexes. Hexes have eight neighbours in 3D versus four for tets. This problem is independent of mesh quality. Even a perfect tet mesh produces noisier gradients than a perfect hex mesh, because the stencils are smaller and less symmetric.

Polyhedra average out this problem with eight or more faces. Gradient reconstruction approaches that of hexahedra. Skewness becomes the limiting factor. Polyhedral cells tend to have higher intrinsic skewness. The effect is described in Mesh quality.

Memory and storage implications

Cell typeStorage (per cell)Neighbour countMatrix bandwidth
Hexahedron6 faces6 (hex neighbours)Narrowest
Prism5 faces5-9Moderate
Polyhedron>=8 faces8-15Wide
Tetrahedron4 faces4Narrow but many cells

Hexahedral meshes achieve the narrowest matrix bandwidth. Each cell directly connects to exactly six neighbours in 3D. Narrow bandwidth has a real impact on linear solver performance. PCG, BiCGStab, and GAMG solvers benefit. See OpenFOAM Numerics for solver taxonomy. Tetrahedral meshes have narrow individual bandwidth per cell. They require 3-5x more cells for comparable accuracy. The global bandwidth is larger.

Polyhedral meshes use more neighbours per cell, which narrows their wide local bandwidth. Their superior accuracy often means fewer total cells, narrowing the global bandwidth again. The net effect depends on the platform. Star-CCM+ explicitly promotes polygonal-polyhedral meshing on this basis. OpenFOAM default snappyHexMesh workflow still favours hex-dominant.

Boundary-layer meshes and prism layers

All major platforms handle boundary layers by appending prism layers on surface cells. OpenFOAM calls them wedges. The approach is universally correct. It produces stretched hexahedra or prisms normal to the wall, aligned with the flow.

Layer strategyPlatform defaultRecommended countExpansion ratio
Wall-resolved (y+ ~ 1)Prism layers15-301.1-1.2
Wall-function (y+ 30-300)Prism layers3-71.2-1.3
Mesh-adaptiveAutomatic----

snappyHexMesh uses addLayersControls. ANSYS Fluent patch-independent method uses automatic boundary-layer sizing. Star-CCM+ uses its polyhedral-plus-prism-layer workflow. The mathematics is identical. The implementation detail that matters is layer-count prediction. Fluent and Star-CCM+ estimate the required first-cell height from y+ targets. OpenFOAM requires manual calculation or external tools.

See OpenFOAM Mesh Generation for the snappyHexMesh layer-addition troubleshooting. See OpenFOAM Turbulence Modelling for y+ discipline by turbulence model.

Hybrid meshes

Hybrid meshes combine cell types in a single mesh. Each cell type exploits its strengths:

This is the default strategy in all modern platforms:

PlatformDefault hybrid strategyCore cell typeTransition
OpenFOAMsnappyHexMeshHex + poly + tetHex to poly to tet
ANSYS FluentHybrid mesherPoly + tetPoly to tet
Star-CCM+Polygonal-polyhedralPolyhedronPolyhedron (no tet)

Star-CCM+ avoids tetrahedra entirely. The platform relies on polyhedral cells for all complex-geometry regions, arguing that polyhedra are accurate enough and tets unnecessary where other platforms would use them. OpenFOAM snappyHexMesh typically produces a hex-dominant mesh. Polyhedral and tetrahedral cells appear only where geometry or topology requires them.

Historical perspective: the hex vs tet war

The hexahedra-vs-tetrahedra debate was the defining mesh-topology argument from 1990 to 2010. Early hex meshes produced dramatically better solutions per cell. Interpolation error was high on tetrahedra. Early solvers were sensitive to non-orthogonality.

Two developments narrowed the gap by the 2010s:

1. Improved polyhedral reconstruction. Most commercial mesher converge tets to polyhedra before solving. 2. Higher-order discretisation schemes. Second-order TVD and limitedLinear schemes tolerate mesh distortion better.

The current consensus is widely discussed at AIAA CFD workshops and ASME FED conferences:

The practical implication: the choice of mesher constrains cell type. The platform geometry and meshing workflow constrain the choice.

Cross-references