Design Philosophy¶
English | Japanese
This page describes what OpenRheo chose and what it did not choose. It gives not only the conclusions but also why we made each choice and what is not done yet.
1. Numerical core — single source in standard C++ stdpar¶
The numerical core is an AMR-LBM written with ISO C++ standard parallel algorithms (stdpar).
The same source runs on the GPU with nvc++ -stdpar=gpu and on the CPU with -stdpar=multicore.
ERCOFTAC case 41 also has an opt-in CUDA path: it is built with -cuda and selected with LBM_CUDA, and it is bit-identical to the stdpar version. Without -cuda the CUDA header is a stub.
// the same 1 line is expanded for both GPU and CPU
std::for_each(policy, cells.begin(), cells.end(), [=](std::size_t c) { ... });
Why LBM: FVM codes such as OpenFOAM solve linear systems implicitly, which limits how far they can be moved to the GPU. In LBM, collision and streaming are almost entirely local and explicit, which suits the GPU well. Since Japanese supercomputers are moving to GPU-centred systems (Miyabi, Fugaku NEXT), this is a practical choice.
Why stdpar: for portability. It is, however, not a cure-all — at present stdpar GPU offload is effectively NVIDIA-only, and running on AMD/Intel or Fugaku may require moving to Kokkos or similar. We acknowledge this openly.
Velocity sets and collision operators (from the OpenCAE Symposium 2026 talk): the flow uses D3Q19 (rest 1, faces 6, edges 12) or D3Q27 (plus corners 8). The collision operators differ in the space where they relax toward equilibrium; the HRR run of the apartment LDK used σ = 0.98.

2. Block-forest AMR¶
Spatial adaptivity uses block-forest AMR (small fixed-size blocks managed in an octree), the same family as waLBerla and the Aoki lab implementation. Only the region near bodies is refined; the far field stays coarse.
The treatment of the coarse–fine interface decides the quality of AMR. OpenRheo uses a conservative partition coupling (partition2) with a 2-layer buffer, and the spurious acoustic noise generated at the interface is evaluated quantitatively in the cases under AMR and numerical verification. How the forest is built, the couplings that were tried and what was measured: AMR.
3. Module contract — a form an LLM can "compose"¶
Physics is split out into modules, and a case is written by combining them. We do not clone an existing benchmark and modify it.
There are 2 kinds of module. Applying the heavy kind where it is not needed ends up re-implementing the lattice for each piece of physics.
| Kind | Content | When to use |
|---|---|---|
| Stepper | Owns its distribution functions and time steppingParams / State / init / step |
When the physics adds a field (temperature, scalar, phase field) |
| Closure | A pure function plugged into an existing steppernu(shear), F(u,x) |
When the physics only changes coefficients (non-Newtonian viscosity, Darcy drag, electro-osmotic force) |
Closures compose. A power-law fluid in a porous medium is expressed simply by
nu_powerlaw handling the relaxation time and force_darcy handling the body force.
Current modules:
| Module | Gate | Main evidence |
|---|---|---|
lattice2d.hpp |
via those below | Shares the D2Q9+D2Q5 lattice constants |
advection_diffusion.hpp |
advection_diffusion |
L2 3.4e-3 against the analytic Green's function, convergence checked |
thermal_ddf.hpp |
thermal_ddf and others |
Nu error 0.00% vs de Vahl Davis |
closures.hpp |
closures |
Analytic limits for flow, Darcy, EDL, latent heat |
rigid_body.hpp |
rigid_body |
Moving boundaries, momentum exchange, Newton integration |
radiative.hpp |
radiative |
Beer-Lambert and convergence order, conservation in pure scattering |
electrokinetics.hpp |
electrokinetics |
Gouy-Chapman approaches Debye-Hückel asymptotically |
Still implemented inline: multi-ion transport in pnp_full2d, the forest-AMR variant of the free surface,
and optimisation/UQ — 3 items. We record them here rather than hide them.
4. Golden gates — the safety net an LLM editing loop needs¶
Each module is guarded by ctest against the values published in the original papers. This is not decoration; it actually caught bugs on 2 occasions.
- When the thermal module was extracted, the
H/dTfactor in the Nusselt integral was dropped, giving 0.035 instead of 2.243. The gate failed immediately. - When Rayleigh–Bénard was migrated, the update of the macroscopic quantities lagged by 1 step and the growth rate shifted by 0.05%. This was found because bit-identity was the acceptance criterion.
Benchmarks implemented inline do not have this net. That is why we turn them into modules.
5. The LLM does not enter the numerical loop¶
This principle is non-negotiable. The LLM only chooses the model and fills in parameters; the kernel that runs remains deterministic C++. Reproducibility is not sacrificed.
natural language → [LLM] → module choice + Params → [deterministic C++] → result
↑
golden CI guarantees quality
Other projects let an LLM agent drive existing CFD codes. There, the robustness of the mesh, the reproducibility of the results and the performance on GPUs are set by the underlying code. OpenRheo instead designs the numerical core itself (the module contract, the golden gates, rheoMesh) so that an agent can compose it and check its own work.
The intended set-up has two tiers: a cloud LLM acting as teacher prepares the RAG, memory and golden examples, and a local LLM on site uses them to drive the work autonomously. → Comparison of local LLMs
6. Multi-level analysis¶
Solving everything with unsteady LBM is not realistic. The design builds in a division of roles: systems where spatial distribution does not matter go to a 1D model, systems where a steady solution suffices go to FVM (driven by OpenFOAM), and only systems that are unsteady and need spatial distribution go to the GPU LBM.
1D and steady FVM need only a few CPU cores, so the Grace CPU and Hopper GPU of the GH200 can be fully used at the same time.
Status: the 1D layer (orheo-1d) and the LBM layer work, but automatic hand-off
across layers is still being verified. This is the biggest differentiator and the biggest unfinished part.
7. Licence — Apache-2.0 and clean room¶
OpenRheo is Apache-2.0. Being the only permissive one among the major open-source LBM codes (commercial use allowed) is a clear differentiator.
| Code | Licence | Commercial use |
|---|---|---|
| OpenRheo | Apache-2.0 | Allowed |
| OpenLB | GPLv2 | Source disclosure required |
| Palabos | AGPLv3 | Disclosure required even for network use |
| waLBerla | GPLv3 | Source disclosure required |
| FluidX3D | Proprietary | Non-commercial only |
Feature comparison (from the OpenCAE Symposium 2026 talk). Green: supported; orange: partial or copyleft; grey: none; red: non-commercial.

For this reason we have not read any source of other codes, and have not ported any. What we use is only the fact of "which cases exist" and the reference values published in the original papers. All verification is done against the original literature; we do not tune to match the output of other codes. → Comparison with other codes, LBM feature matrix
Note that "standard C++ stdpar" by itself is not a unique selling point. Palabos also went multi-GPU with stdpar in 2025. The differentiation lies in the combination of Apache-2.0 + multi-level integration + LLM agents.