Skip to content

rheoMesh — design

English | Japanese

« rheoMesh

The structure of rheoMesh, its design principles and quality gates, the pipeline and the AMR loop. Moved from the rheoMesh page; the current status is on that page.

Structure

One core with two back-ends.

part content
core STL / OBJ input with checks (STEP is tessellated per CAD face into an OBJ with face groups before it is read); a BVH with batched queries (segment/triangle hits, nearest point and feature, inside/outside by fast winding numbers, signed distance); a level map from settings and from an existing solution; a block octree with 64-bit Morton keys (2:1 balance, space-filling-curve partitioning)
FV back-end OpenFOAM polyMesh written as files (ASCII / binary, 32- / 64-bit labels), with no OpenFOAM library linked. Hex-dominant cells with conformal polyhedral transitions (no hanging nodes); the boundary projected onto the surface with features and corners pinned; prism layers decided on the surface first (an absolute first-layer thickness from y+, a thickness budget, taper instead of removing whole stacks)
LBM back-end the OpenRheo block forest: per-cell fluid / solid / boundary flags, per-link Bouzidi q (D3Q19 / D3Q27), the level time-step table. The specification and interface header exist; the export is not implemented yet

Design principles

  1. Octree (a forest of blocks) with 2:1 balance: cells are the leaves of an octree with 64-bit Morton keys; neighbouring leaves differ by at most one level. Partitioning follows the space-filling curve.
  2. Conformal polyhedral transitions: at a level step the coarse cell becomes a polyhedron that carries the faces and vertices of the fine side. There are no hanging nodes; every face is shared by exactly two cells (or one cell and a boundary). No hexahedral transition templates.
  3. Projection with features pinned: boundary points are projected onto the surface, with the points on feature edges and corners pinned there; face repair and smoothing follow.
  4. Surface-first prism layers: the first-layer thickness h1 is set as an absolute value from the y+ given by the wall shear stress of a flow solution on a coarse mesh; the layer count and total height are set per wall point from a boundary-layer thickness estimate and a thickness budget (facing wall, concave curvature, gaps). Where the budget is short, the count tapers by one layer at a time instead of the stack being removed.
  5. One level map for FV and LBM: the refinement levels are kept in a level map built from settings and solutions; the FV octree and the LBM block forest read the same map.
  6. AMR by regenerating from the level map (quasi-static): indicators from a solution update the level map and the whole mesh is generated again. Existing cells, the prism-layer cells in particular, are never split in place.
  7. Determinism and bit-identity: the same input and settings give the same mesh bit for bit at any thread count and on any machine type; the same result on CPU and GPU (stdpar) is the aim. Results are written to positions fixed by block and leaf rank, and the only cross-block reductions are sort-unique and prefix sums, so their order is fixed.
  8. stdpar, plus optional CUDA: parallelism uses ISO C++ standard parallel algorithms as in OpenRheo (nvc++ -stdpar=multicore|gpu; over TBB with g++). The BVH is built over the Morton-ordered triangles top-down, one level at a time (Lauterbach et al. 2009); the boxes and winding-number moments are gathered level by level from the deepest level (no atomics). The geometry queries get an optional CUDA back-end (in preparation).
  9. Quality gates: the quality metrics are computed internally and calibrated to give the checkMesh values (max and average non-orthogonality, skewness). A mesh that misses a gate does not pass.
  10. Clean-room development from papers (Apache-2.0): the code is written only from the specification (SPEC) and the papers and public file-format documents it cites. Sources of other meshers are not read, and no implementation may be derived from them. Every algorithm in the specification carries a citation; an algorithm without one, or wording that names another mesher's internals, is not taken in.

Concept: (a) a quadtree in 2-D with 2:1 balance; a coarse cell that takes the vertices (dots) of its finer neighbours becomes a transition cell (shaded), and no hanging node is left; cells cut by the body are removed before the projection. (b) prism layers on a curved wall, grown outward from h1 along the wall-point normals; the wall-side points of the core cells above are projected onto the stack top

Quality gates (FV), as set in the specification:

gate value
checkMesh (default thresholds) no failed check
max non-orthogonality ≤ 65°
max skewness ≤ 4
concave cells, negative pyramid volumes 0
prism-layer coverage the requested layer count on ≥ 98 % of the faces; ≥ 95 % of the requested thickness (area-weighted)
layer-count changes taper only (n, n−1, n−2, …); a stack is never removed as a whole

Determinism was checked by the md5 of all 8 polyMesh files agreeing between x86 (384 threads) and aarch64 (Grace 144 threads, A64FX 48 threads). The layer-coverage gate was not met yet by the DrivAer meshes as of 2026-10-30 (see "Status as of 2026-10-30 (v0.1)" on the development log).

Pipeline and AMR loop

Pipeline

%%{init: {'themeVariables': {'fontSize': '12px'}}}%%
flowchart LR
    G["geometry<br/>STL / OBJ<br/>checks, features"] --> O["octree<br/>refine, 2:1 balance"]
    LM["level map<br/>settings, AMR indicators"] --> O
    O --> C["classify<br/>winding numbers"]
    C --> E["extract<br/>conformal transitions"]
    E --> P["project<br/>features and corners pinned"]
    P --> L["prism layers<br/>decided on the surface, extruded"]
    L --> Q["quality<br/>optimise and check"]
    Q --> FV["FV export<br/>polyMesh"]
    C --> LB["LBM export<br/>block forest<br/>(same level map)"]

AMR loop

Two tracks run side by side. In both, the indicators give a level map, the mesh is generated again, and the next run starts afresh (quasi-static AMR).

%%{init: {'themeVariables': {'fontSize': '12px'}}}%%
flowchart TD
    M["level map"] --> R["regenerate the mesh<br/>rheoMesh"]
    subgraph FVT["FVM-only track"]
        F1["steady RANS<br/>simpleFoam"] --> F2["short URANS<br/>or SIMPLE iteration scatter"]
    end
    subgraph LBT["LBM-assisted track"]
        B1["short LBM run<br/>1.5 s per cycle"]
    end
    R --> F1
    R --> B1
    F2 --> S["statistics<br/>mean, u'rms"]
    B1 --> S
    S --> I["indicators<br/>u'rms, h|ω|/U, LBM non-equilibrium<br/>normalised by mean and std"]
    I --> K["marking<br/>floor ε = 1 + Dörfler θ = 0.5<br/>NUAMR stream tube"]
    K --> M
    K --> X{"stop?<br/>Cd, recirculation, spectra"}

References

  • C. Lauterbach, M. Garland, S. Sengupta, D. Luebke, D. Manocha: Fast BVH construction on GPUs, Computer Graphics Forum 28 (2), 375-384, 2009.

The references of the detailed results and of the survey are on those pages.