---
title: "Tutorial: plane Poiseuille flow with a lattice Boltzmann solver"
url: "https://tryreynolds.com/docs/tutorials/poiseuille"
description: "Solve plane Poiseuille flow on a laptop with a lattice Boltzmann solver in numpy, match the exact parabola to the convergence residual, and run the control that proves the agreement is evidence."
---

**[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/tutorials/poiseuille. It lives at https://tryreynolds.com/docs/tutorials/poiseuille.md, and
[tryreynolds.com/llms.txt](https://tryreynolds.com/llms.txt) indexes every one of them.

No OpenFOAM needed

# Flow down a channel

Solve plane Poiseuille flow on a laptop with a lattice Boltzmann solver in numpy, match the exact parabola to the convergence residual, and run the control that proves the agreement is evidence.

The steady flow between two plates has an exact answer, so the only thing left to measure is the solver. You will solve it with a lattice Boltzmann method in plain numpy and then break it on purpose.

**You will learn** what "exact to the residual" means, why two relaxation times matter, and how to design a control that would fail if a check were circular.

**You need** Python with numpy and the repository. No OpenFOAM, no account. A single run takes seconds; the full grader takes a few minutes on one core.

## Set up once

Every tutorial in this group uses the same checkout.

```bash
git clone https://github.com/InviscidAI/OpenReynolds
cd OpenReynolds
python -m pip install -e ".[toolbox]"
```

Run every command from the repository root.

## The physics

A channel of height `H` is driven by a uniform body force `G`. The steady profile is

`u(y) = G/(2 mu) y (H - y)`, with peak `G H^2 / (8 mu)`.

The solver works in lattice units: one cell is one unit, one step is one unit, and the speed of sound squared is 1/3. Compressibility error grows as the square of the Mach number, so the force is set to make the peak speed 0.05. Viscosity enters through a relaxation time `tau`, and its distance from 1/2 sets stability.

The no-slip wall in this scheme is a bounce back. Where it sits depends on the relaxation times. With two of them, and the product `(tau_plus - 1/2)(tau_minus - 1/2) = 3/16`, the wall sits exactly on the link midpoint at any viscosity, so the discrete answer **is** the parabola. With one relaxation time that is true at a single viscosity.

## Steps

### Solve one channel

```bash
python openreynolds/toolbox/lbm.py poiseuille --n 32 --quiet
```

Output, run here in under ten seconds:

```
# poiseuille
  scheme:     trt  omega_plus 1.250000  omega_minus 0.888889  tau_plus 0.80000
  nu:         0.1 (lattice units)
  steps:      14,400  (converged, residual 4.902e-09)
  cost:       6.8 s at 0.27 million lattice updates per second
  u_max:      0.049951123 against the exact 0.050000000 (-0.0978%)
  profile:    max |u - u_exact| / u_max = 9.690e-07 over 32 rows
```

The peak reads 0.1% low because the lattice has no row at the centreline with an even number of cells. The profile error is measured row by row against the parabola and is under one part in a million.

### Break it with one relaxation time

```bash
python openreynolds/toolbox/lbm.py poiseuille --n 32 --nu 0.4 --relaxation bgk --quiet
```

```
# poiseuille
  scheme:     bgk  omega_plus 0.588235  omega_minus 0.588235  tau_plus 1.70000
  nu:         0.4 (lattice units)
  steps:      4,100  (converged, residual 3.522e-09)
  u_max:      0.050277336 against the exact 0.050000000 (+0.5547%)
  profile:    max |u - u_exact| / u_max = 6.523e-03 over 32 rows
```

The residual says converged. The profile is wrong by 6.5e-3 of the peak speed, four orders worse. **Convergence is not accuracy.**

### Run the grader

```bash
python benchmarks/lbm/grade.py poiseuille
```

Output, run here in 329 s on a busy laptop core, trimmed:

```
  PASS  max |u - u_exact| / u_max, nu = 0.02 (TRT): 5.17496e-11 (reference <= 1e-06)
  PASS  max |u - u_exact| / u_max, nu = 0.1 (TRT): 1.22161e-11 (reference <= 1e-06)
  PASS  max |u - u_exact| / u_max, nu = 0.4 (TRT): 3.2975e-12 (reference <= 1e-06)
  PASS  max error, one relaxation time at nu = 4*sqrt(3)/12: 0.00366211 (reference >= 0.0001)
  PASS  max error, one relaxation time at nu = sqrt(3)/12: 9.03624e-12 (reference <= 1e-06)
PASSED
```

The errors are the same every time; the times are your machine's.

## Read the result

![A published run of the same case. Left: the solved points on the exact parabola. Right: the two schemes across four resolutions. The single-relaxation scheme falls at second order; the two-relaxation scheme sits near 1e-12 throughout.](https://tryreynolds.com/assets/lbm-poiseuille-7bxqhU47.png)

A published run of the same case. Left: the solved points on the exact parabola. Right: the two schemes across four resolutions. The single-relaxation scheme falls at second order; the two-relaxation scheme sits near 1e-12 throughout.

The last two lines of the grader are the interesting ones. The single-relaxation scheme is checked to be exact at one viscosity **and wrong at another**. If the grader had been comparing the solver with itself it would have passed the second too, so its failure there is what makes the first three lines evidence. The published study of this case is [here](https://tryreynolds.com/studies/flow-down-a-channel.md).

## Check it

- **Three viscosities, a factor of twenty apart.** One viscosity cannot tell "exact" from "exact at this `tau`".
- **The stop.** The default `--tolerance` is a residual on the change per step; the residual you stopped at bounds the error the solver can honestly claim.

## Try next

1. Change `--n` to 16 and 64 and check the two-relaxation error does not fall, because it is already at the floor.
2. Use `--nu 0.02` and watch the step count. It is the time to diffuse across the channel.
3. Run `--relaxation bgk --nu 0.14434`. That is `sqrt(3)/12`, its single exact viscosity.

## When it goes wrong

### No module named numpy

The extra did not install. Run `python -m pip install -e ".[toolbox]"` in the same environment you run the script with.

### The residual stalls above the tolerance

Single precision of the convergence check is not the cause here, the arithmetic is float64. Below `tau` of about 0.52 the scheme loses stability; raise `--nu`.

### The grader is taking much longer than expected

It runs three viscosities and two controls. The recorded time for the slowest is about 100 s on a shared CI runner and 211 s on the machine that produced the output above; a loaded machine is slower again.

## Next

[The lid-driven cavity](https://tryreynolds.com/docs/tutorials/cavity.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.
