---
title: "Uncertainty: discretisation, sampling, surrogate and reference error bars"
url: "https://tryreynolds.com/docs/guides/uncertainty"
description: "How to put an error bar on a CFD number with the tools here: discretisation from a mesh ladder, statistical error from a settled window, surrogate error from leave-one-out, and the reference's own uncertainty, plus the order in which misses are usually explained."
---

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

Guides

# Uncertainty

How to put an error bar on a CFD number with the tools here: discretisation from a mesh ladder, statistical error from a settled window, surrogate error from leave-one-out, and the reference's own uncertainty, plus the order in which misses are usually explained.

A number without an error bar cannot be compared with anything. Four terms usually matter, they are measured differently, and the toolbox measures each.

## The budget

| Term | Instrument | What it gives |
|---|---|---|
| Discretisation | `grid.py` | a Grid Convergence Index and a band |
| Sampling of an unsteady quantity | `spectra.py` | a 95% interval on the mean |
| A surrogate of a sweep | `surrogate.py` | leave-one-out error |
| Reattachment or shear position | `reattach.py` | half the local face spacing |
| The reference itself | the published source, read | its own scatter, next to the number |
| Model form | a second model | the spread between them |
| Modelling choices: domain, far field, boundary values | a second run with the choice moved | the sensitivity |
| Arithmetic and conservation | conservation identities | a check whose exact value is zero |

## Discretisation

Two meshes give a band with an assumed order; three measure it.

```bash
python3 /work/.toolbox/grid.py coarse medium fine --quantity Cd --dim auto
```

```
observed order p      1.786170
GCI on the fine grid   0.103083%
value = 0.9705 +/- 0.001000 on h=1
```

Safety factor 1.25 over three grids with an observed order, 3 over two with an assumed one, and the report says which. An oscillatory ladder gets an interval rather than a percentage. [Mesh independence](https://tryreynolds.com/docs/guides/mesh-independence.md) has the planning and the traps.

## Sampling

A transient mean is a sample. Consecutive rows agree to three figures, so 20,000 rows are not 20,000 measurements.

```bash
python3 /work/.toolbox/spectra.py . --column Cd --from 20
```

`spectra.py` finds the earliest stationary sample, where the halves and the first and last thirds agree inside the halves' own scatter and the scatter is not growing, and reports the mean with a 95% interval on the effective sample size, the count divided by the integral time scale. If it says the record is too short, the answer is a longer run. `--tail` in `grid.py` and `fidelity.window` in `score.py` (20% by default) are the same idea over a fixed fraction.

## A surrogate

```bash
python3 /work/.toolbox/surrogate.py sweep.csv --objective Cd --design alpha,camber --png surface.png
python3 /work/.toolbox/surrogate.py --candidates round/ --objective metrics.Cd
```

A polynomial response surface is fitted and reported with the error it makes on points it was not fitted to, computed exactly by leave-one-out leverages. The fit residual is not an error: a degree-4 surface through 16 points scored 0.000109 on its own samples and 0.005236 on 2500 it never saw, 48 times more. Both are printed for every degree tried, the degree with the lowest leave-one-out error is kept, and a degree with as many terms as points is refused. The predicted optimum is labelled a prediction, and one on a face of the sampled box says so. Diverged candidates are named and left out.

## The reference's own error

The most common flattering mistake is comparing with a reference more accurate than it is. From the repository's own cases:

| Reference | Its own error | Our agreement |
|---|---|---|
| Ghia, Ghia and Shin, Re 1000 cavity | 1.46 to 2.20% from a spectral benchmark | 0.45% to 0.75% |
| Cylinder Strouhal number at Re 100 | published fits span 0.1643 and 0.1671, 1.7% apart | +1.10% on one, -0.55% on the other |
| de Vahl Davis cavity | 0.3%, stated by its author | +0.54% on the hot wall |
| Dittus-Boelter | 25%, stated | refused outside its range |
| Haaland against Colebrook | 1.314%, measured | a correlation against a correlation |

An independently derived bound outranks a typed expectation. A total drag coefficient below the flat-plate friction line at the same Reynolds number on the same area is impossible, and `reference_area.py --cd X --re R` exits 1 when a coefficient is. [The submarine hull](https://tryreynolds.com/studies/suboff-submarine-hull.md) is the case where that bound was derived and ignored.

Read the source, not a citation of it. Two reference values in the repository were wrong in the direction of agreement because they came from secondary sources: one by a factor of two.

## The five ways a validated case misses

Across the graded cases the blame lands in a different place from where it is first put. Check them in this order, because the cheap ones are at the top.

1. **The reference value.** Wrong reading, wrong convention, wrong units.
2. **The reference's own uncertainty.** Above.
3. **Discretisation.** Guessed first, and usually already spent. Two meshes 3 times apart in cells agreed to 0.97% on a hull whose remaining 4% was elsewhere.
4. **The experiment's assumptions.** A tank trips the boundary layer; a RANS run does not. Worth a few percent in that direction.
5. **Turbulence model and near-wall treatment.** A y+ band in the buffer layer made a spread that looked like a trend.

And a sixth: **the quantity's own conditioning.** Drag converges early because one region dominates it. Lift is a small difference of large integrals. Report each to its own confidence.

## Identities that need no reference

| Identity | Where |
|---|---|
| Mass in equals mass out | the solver's own continuity closes at -9.04e-08 on the graded duct; `balance.py`'s boundary integral, a looser quantity, closes to 0.84% on the same case |
| Heat in equals heat out | a heat case; the sink closed to 99.7% |
| Equal and opposite torque | Couette, stirred vessel |
| Zero net work per cycle | an undamped body |
| Pressure drag of a closed body is zero | `panel.py`, 2.19e-04 |
| `1/(1 - nu)` between two plane states | the constrained bar |
| Archimedes at a fixed draught | `ladder.py`'s hull rungs |

`ladder.py` prints the rungs for the class of case it detects, each with an answer known before running.

## Report it

State the value, the band, and what the band covers:

```
Cd = 0.412 +/- 0.004 from discretisation (GCI on three meshes, p = 1.8, Fs = 1.25);
+/- 0.002 from averaging the last 40 cycles; reference experiment +/- 0.006;
turbulence model spread (kOmegaSST against Spalart-Allmaras) 0.009, not combined.
```

Do not combine a model spread with a discretisation band in quadrature. A model error is a bias with a sign, and the second model says how far.

## Ask the agent

```
Give me drag with a discretisation band from three meshes, the averaging uncertainty, and
the reference's own scatter, kept separate.
```

```
Which of the five usual causes explains this 4%, and what would falsify it?
```

## 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.
