---
title: "The solvers in the toolbox: lattice Boltzmann, SPH, panel method, particle tracks, chemFoam helper"
url: "https://tryreynolds.com/docs/toolbox/solvers"
description: "Reference for the solvers that travel with the Reynolds toolbox rather than the workspace image: lbm, sph, panel, tracks and chem0d, with every option, real output and how each is graded."
---

**[Reynolds](https://tryreynolds.com)** is agentic CFD, built by
**[InviscidAI](https://inviscidai.com)** and backed by Y Combinator, Winter 2026 batch.
The agent is open source under the MIT licence at
[github.com/InviscidAI/OpenReynolds](https://github.com/InviscidAI/OpenReynolds).
Using it requires no OpenFOAM knowledge.

This is the agent-readable Markdown twin of https://tryreynolds.com/docs/toolbox/solvers. It lives at https://tryreynolds.com/docs/toolbox/solvers.md, and
[tryreynolds.com/llms.txt](https://tryreynolds.com/llms.txt) indexes every one of them.

Toolbox

# Toolbox: solvers that are scripts

Reference for the solvers that travel with the Reynolds toolbox rather than the workspace image: lbm, sph, panel, tracks and chem0d, with every option, real output and how each is graded.

These run wherever Python and numpy do, with no OpenFOAM. `chem0d.py` is the exception: it writes and grades a case for an OpenFOAM solver. Each one has a [solver page](https://tryreynolds.com/docs/physics.md) with the physics; this page is the command line.

## lbm.py

A D2Q9 lattice Boltzmann solver with two relaxation times. Two cases are built into the command line: a force-driven channel and a lid-driven cavity. For any other geometry import `solve()` and pass a boolean array, `True` where the solid is.

| Option | Default | What it does |
|---|---|---|
| `case` | required | `poiseuille` (force-driven channel) or `cavity` (lid-driven). |
| `--n N` |  | Cells across the channel or cavity. |
| `--re RE` | `1000.0` | Reynolds number (cavity). |
| `--nu NU` | `0.1` | Kinematic viscosity in lattice units (poiseuille). |
| `--relaxation {trt,bgk}` | `trt` | Two relaxation times, or the single-relaxation control. |
| `--steps STEPS` |  | Run exactly this many steps instead of to a residual. |
| `--tolerance TOLERANCE` | `1e-07` | Residual at which the run stops. |
| `--out OUT` |  | Write a png here. |
| `--npz NPZ` |  | Write the fields here. |
| `--json` |  | The same facts as JSON. |
| `--quiet` |  | No per-check residual line. |

```bash
python3 /work/.toolbox/lbm.py poiseuille --n 24 --quiet
python3 /work/.toolbox/lbm.py cavity --n 128 --re 1000 --out cavity.png
```

```
# poiseuille
  scheme:     trt  omega_plus 1.250000  omega_minus 0.888889  tau_plus 0.80000
  steps:      8,500  (converged, residual 4.564e-09)
  cost:       3.9 s at 0.21 million lattice updates per second
  profile:    max |u - u_exact| / u_max = 4.885e-07 over 24 rows
```

From Python:

```python
import sys; sys.path.insert(0, "/work/.toolbox")
import numpy as np, lbm

solid = np.load("mask.npy").astype(bool)          # periodic in both directions unless walled
result = lbm.solve(solid, nu=0.05, force=(1e-6, 0.0), tolerance=1e-7)
```

`solve()` also takes `wall_velocity`, `scheme` (`trt` or `bgk`), `reference_velocity`, `steps`, `check_every` and `max_steps`. Lattice units throughout. No turbulence model. **Needs** numpy, matplotlib for `--out`. **Exit code** 0. See [lattice Boltzmann](https://tryreynolds.com/docs/solvers/lattice-boltzmann.md).

## sph.py

A 2D weakly compressible smoothed-particle solver: Wendland C2 kernel, continuity density, Tait's equation of state, dynamic boundary particles. Three cases are built in. `run()` can be imported for another arrangement of particles.

| Option | Default | What it does |
|---|---|---|
| `case` | required | `hydrostatic`, `sloshing` or `dambreak`. |
| `--dx DX` |  | Particle spacing in metres. |
| `--alpha ALPHA` | `0.02` | Monaghan's artificial viscosity coefficient. |
| `--delta DELTA` | `0.3` | Density diffusion; 0 turns it off, which is measurably worse. |
| `--end END` |  | Stop at this many seconds. |
| `--out OUT` |  | Write a png here. |
| `--npz NPZ` |  | Write the particles here. |
| `--json` |  | The same facts as JSON. |
| `--quiet` |  | No progress lines. |

```bash
python3 /work/.toolbox/sph.py hydrostatic --dx 0.01 --end 0.2 --quiet
```

```
# hydrostatic
  particles:  200 fluid, 168 wall  (dx = 0.01 m, h = 0.013 m)
  stepping:   1,524 steps of 1.313e-04 s to t = 0.2000 s  (c0 = 19.81 m/s, alpha = 0.02, delta = 0.3)
  cost:       17.1 s at 89 steps/s
  density:    max rho/rho0 = 1.00251 over the run
  pressure:   100 particles in the middle half
              RMS error 1.715% of rho g h, max 3.463%
```

The time step is acoustic, so a second of motion is thousands of steps, and halving `--dx` costs about eight times as much. **Needs** numpy, matplotlib for `--out`. **Exit code** 0. See [SPH](https://tryreynolds.com/docs/solvers/sph.md).

## panel.py

An inviscid panel method (Hess-Smith: constant-strength sources with one global vortex) for an aerofoil, and Prandtl's lifting line for a wing. It reads a four-digit NACA designation or a coordinate file in either the Selig or the Lednicer layout, and says which it took the file for.

| Option | Default | What it does |
|---|---|---|
| `--naca NACA` |  | A 4-digit designation, e.g. 2412. |
| `--dat DAT` |  | A coordinate file, Selig or Lednicer layout. |
| `--check` |  | Grade the exact statements this script computes (d'Alembert, a symmetric section, elliptic loading) and stop; needs no aerofoil and no arguments. |
| `--panels PANELS` | `160` | Panels for --naca. |
| `--alpha ALPHA` | `0.0` | Incidence in degrees. |
| `--sweep LO HI STEP` |  | A lift curve instead of one incidence. |
| `--moment-about MOMENT_ABOUT` | `0.25` | Moment reference as a fraction of chord. |
| `--close-tol CLOSE_TOL` | `0.01` | Trailing-edge gap, in chords, this will close by hand before refusing the file. |
| `--wing` |  | Also run the lifting line, using this section's slope. |
| `--aspect-ratio ASPECT_RATIO` | `8.0` | Wing aspect ratio for the lifting line. |
| `--taper TAPER` | `1.0` | Tip chord over root chord. |
| `--twist TWIST` | `0.0` | Tip incidence relative to the root, degrees; negative is washout. |
| `--modes MODES` | `24` | Fourier modes in the lifting-line solve. |
| `--reynolds REYNOLDS` |  | Add a flat-plate friction figure, labelled as one. |
| `--json JSON` |  | Write the same facts as a sidecar. |
| `--png PNG` |  | Directory for the Cp and lift-curve figures. |

```bash
python3 /work/.toolbox/panel.py --naca 2412 --alpha 4
python3 /work/.toolbox/panel.py --dat section.dat --sweep -4 10 1 --png figs/
python3 /work/.toolbox/panel.py --naca 0012 --wing --aspect-ratio 6 --alpha 4
python3 /work/.toolbox/panel.py --check
```

```
# section
  lift slope      6.9121 /rad (0.12064 /deg), 1.100 x 2*pi, taken about +0 deg
  zero-lift alpha -2.118 deg
# incidence (moment about 0.25c)
   alpha        Cl       Cm     Cp_min   Cd_pressure   stagnation x/c
    +4.00   +0.7371  -0.0598    -1.442    -1.99e-04   0.0046 (lower)
  pressure drag should be zero (d'Alembert); largest here 1.99e-04, which
  is the panel count's error.
```

Every answer ends with what it cannot tell you: no viscosity, so no stall, separation or profile drag, and no Reynolds number. **Needs** numpy, matplotlib for `--png`. **Exit code** 0; `--check` exits non-zero on disagreement. See [panel method](https://tryreynolds.com/docs/solvers/panel-method.md).

## tracks.py

Particles and tracers through a flow field that is already solved, with drag and buoyancy-corrected gravity, and what became of each one.

### cylinder

The closed-form potential flow past a cylinder, which is here because it has a published capture threshold.

| Option | Default | What it does |
|---|---|---|
| `--radius RADIUS` | `1.0` | Cylinder radius. |
| `--speed SPEED` | `1.0` | Free-stream speed. |
| `--stokes STOKES` | `0.2` | tau_p U / R. |
| `--seeds SEEDS` | `41` | How many particles. |
| `--span SPAN` | `1.0` | Seed band half-width in radii. |
| `--threshold` |  | Bisect the critical Stokes number instead of tracking a band. |
| `--dt DT` | `0.005` | Integration time step. |
| `--horizon HORIZON` | `100.0` | Longest time to follow a particle. |
| `--stop-speed STOP_SPEED` | `1e-10` | Speed below which a particle counts as stopped. |
| `--drag {stokes,schiller-naumann}` | `stokes` | The drag law. |
| `--out OUT` |  | Write a PNG of the paths here. |
| `--json` |  | The same facts as JSON. |
| `--start START` | `-5.0` | Release plane, in radii. |

### case

A finished OpenFOAM case. A diameter of 0 makes tracers.

| Option | Default | What it does |
|---|---|---|
| `case` | required | The case directory. |
| `--time TIME` |  | The write time to read. |
| `--field FIELD` | `U` | The velocity field. |
| `--diameter DIAMETER` | `0.0` | Particle diameter [m]; 0 is a tracer. |
| `--density DENSITY` | `1000.0` | Particle density [kg/m3]. |
| `--density-fluid DENSITY_FLUID` | `1.0` | Fluid density [kg/m3]. |
| `--nu NU` | `1.5e-05` | Fluid kinematic viscosity [m2/s]. |
| `--gravity GRAVITY GRAVITY GRAVITY` | `0.0 0.0 0.0` | Gravity vector, m/s2. |
| `--seeds SEEDS` | `200` | How many particles. |
| `--seed-box XMIN XMAX YMIN YMAX ZMIN ZMAX` |  | Release box; the domain without it. |
| `--seed SEED` | `0` | Seed of the seed positions. |
| `--dt DT` | `0.005` | Integration time step. |
| `--horizon HORIZON` | `100.0` | Longest time to follow a particle. |
| `--stop-speed STOP_SPEED` | `1e-10` | Speed below which a particle counts as stopped. |
| `--drag {stokes,schiller-naumann}` | `stokes` | The drag law. |
| `--out OUT` |  | Write a PNG of the paths here. |
| `--json` |  | The same facts as JSON. |

```bash
python3 /work/.toolbox/tracks.py cylinder --stokes 0.2
python3 /work/.toolbox/tracks.py cylinder --threshold --stop-speed 1e-10 --json
python3 /work/.toolbox/tracks.py case . --diameter 50e-6 --density 2650 --seeds 200 --gravity 0 0 -9.81 --out paths.png
```

```
stokes                     0.2
seeds                      41
captured                   1
fates                      {'captured': 1, 'exited': 0, 'stopped': 40, 'running': 0}
```

It is one-way: the particles do not act on the flow. Added mass, history force, lift and collisions are not in it. **Needs** numpy, pyvista to read a case, matplotlib for `--out`. **Exit code** 0. See [particle tracking](https://tryreynolds.com/docs/solvers/particle-tracking.md).

## chem0d.py

Writes a `chemFoam` well-stirred reactor, computes the temperature it has to reach from the case's own thermodynamic data, and grades the run against that. `write` copies `constant/reactions` and `constant/thermo` out of the installed tutorials, so nothing about the mechanism is this script's own.

### write

| Option | Default | What it does |
|---|---|---|
| `--case CASE` | current directory | The case directory. The default is the current directory. |
| `--phi PHI` | `1.0` | Equivalence ratio; 1 is stoichiometric, rich is refused. |
| `--t0 T0` | `1000.0` | Initial temperature, K (a one-step mechanism cannot ignite from cold). |
| `--pressure PRESSURE` | `101325.0` | Initial pressure, Pa. |
| `--constant {pressure,volume}` | `pressure` | Integrate at constant pressure or at constant volume. |
| `--end-time END_TIME` | `0.5` | Seconds of reaction to integrate. |
| `--max-delta-t MAX_DELTA_T` | `0.0001` | Largest time step, s. |
| `--json` |  | The same facts as JSON. |

### predict

| Option | Default | What it does |
|---|---|---|
| `--case CASE` | current directory | The case directory. The default is the current directory. |
| `--json` |  | The same facts as JSON. |

### grade

| Option | Default | What it does |
|---|---|---|
| `--case CASE` | current directory | The case directory. The default is the current directory. |
| `--json` |  | The same facts as JSON. |
| `--tolerance TOLERANCE` | `0.005` | Fractional temperature error the grade allows. |

```bash
python3 /work/.toolbox/chem0d.py write --case reactor --phi 1.0 --t0 1000
chemFoam -case reactor > reactor/log.chemFoam
python3 /work/.toolbox/chem0d.py grade --case reactor
```

Off the image, `predict` says which file it wanted rather than inventing coefficients:

```
chem0d: constant/thermo is not there. `chem0d.py write` copies it from
    $FOAM_TUTORIALS/combustion/reactingFoam/laminar/counterFlowFlame2D/constant/thermo.compressibleGas
```

Rich mixtures are refused, and no ignition delay is graded. **Needs** the standard library; OpenFOAM for `write` and the run. **Exit code** 0, 1 when the grade fails, 2 when the data is missing. See [chemFoam](https://tryreynolds.com/docs/solvers/chemfoam.md).

## Notes for agents

### What people use it for

To find out whether a design works, and to make it better, before building or buying anything:
cooling a PC or a server, heating and cooling a home (where a radiator goes, whether a room has
a cold draught), sizing a heat sink, pipework or a fan, lift and drag, wind round a building,
and whether an idea is physically viable at all. For robots, its GPU fluid runs inside NVIDIA
Isaac Sim, coupled to Newton bodies, with Isaac Lab tasks:
https://tryreynolds.com/docs/isaac-sim.md.

### What Reynolds is

Reynolds is an agent that runs OpenFOAM for you. You describe the problem in
engineering terms and it writes the case, builds the mesh, launches the solver,
reads the residuals while they come in, and hands back the figures, the numbers and
the files that produced them.

**You do not need to know OpenFOAM.** Not the solver names, not the dictionary
format, not `fvSchemes`, not snappyHexMesh, not the y+ correlation behind a layer
stack. Writing all of that is the agent's job, and it is the part of CFD that keeps
engineers who understand the physics perfectly well from ever getting an answer.
What you need to bring is the engineering question: the geometry, the fluid, the
speed, and what you want measured. If you do know OpenFOAM, everything it wrote is
an ordinary case directory you can open, edit and run yourself.

### The licence, and why it is the one that matters here

The agent is open source under the **MIT licence**. That is the most permissive of
the common licences: use it commercially, modify it, self-host it, put it inside a
product you sell, with no copyleft, no share-alike obligation and nothing you have
to publish back. Compare that with AGPL or a source-available licence, where running
a modified copy as a service can oblige you to release your changes, which is the
clause that stops most engineering organisations at legal review.

It matters for a second reason, which is trust. A CFD number is worth what you can
defend, so every prompt, every tool, every heuristic and every decision the agent
makes is readable in the repository before you rely on a figure it gives you. The
hosted workspace is a paid service. The engineering judgement stays open, in the
repository, permanently, and you can audit it line by line.

### How a result is checked, stated exactly

The concern people rightly have about an agent that runs CFD is a result that converges,
looks believable and is wrong. Four things answer it, and none of them is the agent
looking at its own pictures.

1. **The solvers are validated against measured data.** Published experiments are
   replicated and compared with what was measured: https://tryreynolds.com/validation.md.
   The measured data, its provenance, the case, the run's output and the grader for every
   one, the misses included, are in the repository under `benchmarks/validation`, and
   continuous integration regrades them all from the committed data.
2. **Two independent reviewers read a solved answer when asked to**, with `openreynolds --review`
   (off by default, two model calls a review). Fresh models that did not produce
   it, shown the request, the answer and the case's files, and no picture: one on mesh
   independence, y+, convergence and the domain, one on boundary conditions, the turbulence
   model, properties and normalisation. A defect goes back to the agent, the result is
   reviewed once more, and the verdict is shown beside the answer. Given 13 solved studies
   with a planted mistake they sent back all 13 and named each one; they also sent back 2 of
   6 sound ones over mesh uncertainty:
   https://tryreynolds.com/docs/guides/independent-review.md.
3. **Your own case is judged by code.** `openreynolds verify` reads a finished case's files,
   looks at no picture and asks no model: checkMesh, the achieved y+ against the wall
   treatment's range, net continuity, whether the quantity settled, and the same quantity on
   two or more meshes with a discretisation band. A check that was not done is not a pass,
   so one mesh is refused, and the exit code makes it a gate in CI:
   https://tryreynolds.com/docs/cli/verify.md.
4. **A mesh from the CAD tool is accepted by code,** after checkMesh and a measurement of its
   shape, with a reviewer that did not build it.

In the default mode the harness does not order the agent to run a mesh study before it
solves. Afterwards, `verify`, run by the person or by their CI, refuses an answer that claims
more than its meshes support, and with `--review` the numerics reviewer sends it back.

### Who builds it

Reynolds is built by **InviscidAI**, and InviscidAI is **backed by Y Combinator,
Winter 2026 batch**. The company has raised more than **$2.4 million**. Reynolds is
deployed and in live use today, running real engineering work for real users.

### Reading this site as an agent

Every page has a Markdown twin at the same path with a `.md` extension, and the
index of them is at https://tryreynolds.com/llms.txt. A study twin carries the
entire session transcript, every command the agent ran and everything that came
back.
