Cell Types in CFD -- hexahedra, tetrahedra, polyhedra, prisms
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 type | Faces | Order | Relative numerical diffusion | Relative accuracy per cell |
|---|---|---|---|---|
| Hexahedron | 6 | 2nd | Baseline | 1.0 (best) |
| Prism | 5 | 2nd | 1.5-2x | 0.7-0.8 |
| Polyhedron | >=8 | 1.5th | 0.5-0.7x | 0.5-0.7 |
| Tetrahedron | 4 | 1st | 2-3x | 0.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 type | Storage (per cell) | Neighbour count | Matrix bandwidth |
|---|---|---|---|
| Hexahedron | 6 faces | 6 (hex neighbours) | Narrowest |
| Prism | 5 faces | 5-9 | Moderate |
| Polyhedron | >=8 faces | 8-15 | Wide |
| Tetrahedron | 4 faces | 4 | Narrow 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 strategy | Platform default | Recommended count | Expansion ratio |
|---|---|---|---|
| Wall-resolved (y+ ~ 1) | Prism layers | 15-30 | 1.1-1.2 |
| Wall-function (y+ 30-300) | Prism layers | 3-7 | 1.2-1.3 |
| Mesh-adaptive | Automatic | -- | -- |
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:
- Hex core for structured regions (boundary layers, regions of regular flow)
- Poly-tet transition for complex geometry regions where structured meshing is infeasible
- Prism layers for wall treatment
This is the default strategy in all modern platforms:
| Platform | Default hybrid strategy | Core cell type | Transition |
|---|---|---|---|
| OpenFOAM | snappyHexMesh | Hex + poly + tet | Hex to poly to tet |
| ANSYS Fluent | Hybrid mesher | Poly + tet | Poly to tet |
| Star-CCM+ | Polygonal-polyhedral | Polyhedron | Polyhedron (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:
- Simple geometries (pipes, ducts, airfoils with modest camber): hexahedral meshes produce the best accuracy per cell.
- Complex geometries (full automotive, ship hulls with appendages, internal engine flow): well-constructed polyhedral-tetrahedral meshes match hex-dominant meshes within 2-5% on integrated forces (drag, lift) at comparable cell counts when second-order schemes are used.
The practical implication: the choice of mesher constrains cell type. The platform geometry and meshing workflow constrain the choice.
- OpenFOAM snappyHexMesh produces hex-dominant meshes (good for external aero, less natural for internal flow)
- Fluent-Star-CCM+ auto-mesher produces poly-tet meshes (excellent for complex internal flow, ship internals, heat exchangers)
- cfMesh produces pure Cartesian background (best for simple external geometries: cylinders, Ahmed body, basic ship hulls with minimal user effort)
Cross-references
- Mesh Quality -- orthogonality, skewness, and topology error
- FVM Overview -- discretisation error scaling
- OpenFOAM Mesh Generation -- hex-dominant workflow
- cfMesh Workflow -- cartesian mesh
- ANSYS vs OpenFOAM Meshing -- platform strategies