FlowMLLab is an open-source software framework, created by Ehsan Roohi, that tests whether machine learning actually beats ordinary methods on fluid-flow problems. Many demonstrations of machine learning for fluids start from prepared data arrays and test on random points from the same fields, which can hide where the data came from and leak information between physical cases. A model can then look useful even when simple interpolation would do better. FlowMLLab makes simulation, data checks, blind testing and physical validation explicit steps.
How it works
The framework joins two ways of generating data to a set of learning experiments:
- Continuum flow. A two-dimensional lid-driven cavity solved by a streamfunction-vorticity finite-difference method, with pressure recovered after the velocity solution and checked against published benchmarks (Ghia and Botella-Peyret).
- Rarefied gas flow. A compact direct simulation Monte Carlo (DSMC) cavity solver based on the hard-sphere no-time-counter method, with sampling diagnostics, validated against published wall-pressure data.
The learning examples are a coordinate network, a POD-DeepONet (a proper orthogonal decomposition combined with a deep operator network), learned collision operators and a learned Fokker-Planck closure.
The rules that make the comparison fair:
- Each complete physical case, such as one Reynolds number, goes entirely into the development, validation or blind subset, so grid points from one case never straddle a boundary.
- Blind cases cannot influence scaling, architecture choice, POD rank or early stopping; choices are frozen before they are opened.
- Every neural model is compared with a matched non-neural baseline, with interpolation as the required comparator.
- A fixed archive of the cavity fields comes with a quality table and a SHA-256 digest that detects substitution.
- Seeds, models, metrics and predictions are saved in CSV, JSON and NPZ files, so each figure can be traced to an array and an evaluation protocol.
- Global error norms are paired with local checks such as centerlines, flow topology, replicate spread and higher moments.
What the examples show
| Example | Result reported |
|---|---|
| Cavity pressure recovery at Re = 1000 | Refining the grid from 65 by 65 to 129 by 129 cut the vertical-centerline relative error from 18.52% to 5.54% and the horizontal-centerline error from 20.77% to 6.58% |
| Coordinate network, blind Re = 275 | Relative errors of 1.423% for velocity and 4.264% for pressure |
| POD-DeepONet, blind Re = 175, 275, 375 | Velocity errors of 0.453%, 0.0718% and 0.0928%; about 0.93 ms for a three-seed ensemble against 8.0 s for the reference CPU solution |
| DSMC wall pressure, Kn = 0.1 | 0.772% relative difference from published values on the finer mesh |
| Neural DSMC, from a published study | Errors of 0.835% for velocity magnitude, 0.175% for temperature, 1.56% for shear stress and 1.48% for heat flux |
| Closed-loop Fokker-Planck | 2.017 times online acceleration, trained with a loss weighted by heat flux |
The paper stresses that the POD-DeepONet's advantage is fast evaluation after offline training, and that it does not claim to beat the benchmark itself. It also states that agreement in velocity and temperature alone cannot establish kinetic fidelity.


Figure 6 of the paper: closed-loop Fokker-Planck validation. Upper panels compare exact cubic-closure and ML-FP speed fields with their absolute error; lower panels compare nondimensional centerline velocities and T/T_wall, with the exact closure in blue and ML-FP as orange dashed lines (CC BY 4.0, Roohi).
Using it
The package runs on Python 3.10 to 3.12 on Linux, macOS, Windows or Google Colab, under the MIT license, and the evaluated release is version 1.0.2. Sixteen notebooks call the same modules as the command-line tools, so they work as tutorials: the cavity tutorial validates pressure before pressure becomes a learning target, and the DSMC tutorial matches the published conditions before showing neural fields. Core audits run on a CPU, while the Fokker-Planck application needs a CUDA-capable GPU. Saved results are compared against declared tolerances and statistical summaries, because stochastic calculations cannot be expected to repeat bit for bit across platforms.
Limits the paper states
- The cavity archive is small, two-dimensional and square, with only the Reynolds number varying, so the network is a restricted parametric model, not a broad multi-parameter one.
- Pressure stays sensitive to resolution near the corner singularities, and the evidence neither establishes turbulent-flow accuracy nor shows complex-geometry capability.
- The DSMC solver omits domain decomposition, broad collision-model support and production-scale load balancing.
- Future work includes geometry-aware multi-parameter families, uncertainty calibration, out-of-distribution detection, more kinetic benchmarks and a container image.
Sources
- Ehsan Roohi, FlowMLLab: An open-source framework for reproducible computational-fluid-dynamics and scientific-machine-learning experiments, arXiv:2609.27975, licensed under CC BY 4.0. Changed here: rewritten and shortened in hubnx's own words; equations, code metadata, references and one figure left out. Figure 6 is from the paper. This summary is licensed CC BY 4.0.
코멘트



