---
title: "Mesh independence: grid convergence index, observed order and error bars"
url: "https://tryreynolds.com/docs/guides/mesh-independence"
description: "How many meshes to run, how grid.py turns a quantity on several of them into an observed order, a Richardson extrapolation and a Grid Convergence Index, and what to do when the ladder oscillates or the order is absurd."
---

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

Guides

# Mesh independence and GCI

How many meshes to run, how grid.py turns a quantity on several of them into an observed order, a Richardson extrapolation and a Grid Convergence Index, and what to do when the ladder oscillates or the order is absurd.

A number from one mesh has no discretisation error bar. Two meshes give an estimate with an assumed order; three give an observed order. `grid.py` does the arithmetic, refuses where it would mislead, and prints where every input came from.

[`openreynolds verify`](https://tryreynolds.com/docs/cli/verify.md) refuses an answer that has no mesh study behind it, and puts the band on one that has.

## Planning the ladder

| Question | Recommendation | Why |
|---|---|---|
| How many meshes | three, where the answer will be quoted | two assume an order; three measure it |
| Refinement ratio between them | at least 1.3 in cell size | below it the order solve is ill conditioned; `grid.py` uses 1.3 as its floor |
| What to refine | every direction together, or state which | refining one direction gives an error in that direction |
| Time step on a transient case | hold the Courant number, and say so | see the warning below |
| What to hold fixed | schemes, turbulence model, wall treatment, layer coverage | otherwise the ladder measures those too |

```bash
python3 /work/.toolbox/case_gen.py . --study steady --speed 1 --reynolds 1e5 --yplus
```

Run the same case on each mesh, then hand the finished cases to the script:

```bash
python3 /work/.toolbox/grid.py coarse medium fine --quantity Cd --dim auto
python3 /work/.toolbox/grid.py c1 c2 c3 --quantity Cd --dim auto --tail 200 --json gci.json --png gci.png
python3 /work/.toolbox/grid.py L1 L2 L3 --quantity torqueOuter/moment.dat:viscous_z --dim auto
```

Or give it the numbers:

```bash
python3 /work/.toolbox/grid.py --grid 120000:0.4301 --grid 480000:0.4198 --grid 1900000:0.4152 --dim 3
python3 /work/.toolbox/grid.py --spacing 1:0.97050 --spacing 2:0.96854 --spacing 4:0.96178
```

## Options

| Option | Meaning |
|---|---|
| `cases` | finished case directories |
| `--quantity [SERIES:]COLUMN` | a column of a `postProcessing` table, qualified by its series where the name repeats |
| `--tail N` | average the last N rows of that column |
| `--grid CELLS:VALUE` | an explicit pair, repeated |
| `--spacing H:VALUE` | an explicit spacing and value, repeated |
| `--dim 2`, `3` or `auto` | how a cell count becomes a spacing; `auto` reads the `empty` patches |
| `--formal-order` | the schemes' order, default 2 |
| `--safety-factor` | default 1.25 for three grids, 3 for two |
| `--json`, `--png` | the same facts, and the value against spacing |

Cell counts come from the `checkMesh` log, or from the `nCells` note in `constant/polyMesh/owner`. A rung whose count cannot be read is named in the report and the estimate is marked DEGRADED.

## Reading the answer

The worked example the arithmetic is checked against in the open repository is NASA Glenn's, and the script reproduces it:

```
three-grid estimate on h=1, h=2, h=4
  convergence           monotone
  observed order p      1.786170
  extrapolated value    0.97130033 (Richardson, h -> 0)
  GCI on the fine grid   0.103083%
  GCI on the coarse pair 0.356249%
  asymptotic ratio      1.0020
  value = 0.9705 +/- 0.001000 on h=1
```

| Number | What it tells you |
|---|---|
| Observed order `p` | what the solver achieved. Near the formal order is the healthy case |
| Extrapolated value | the answer at zero spacing, by Richardson |
| GCI on the fine grid | the error band to attach to the fine-grid value |
| GCI on the coarse pair | whether the fine pair is consistent with it |
| Asymptotic ratio | 1.0 means the grids are in the asymptotic range |
| Safety factor | stated, because a band whose factor is unstated is a band of unstated size |

Two different ratios between three meshes are handled by solving Celik's relation for `p` by bisection; the textbook single-ratio formula is a 20% error in the exponent on such a ladder.

## When the ladder does not behave

| What happens | What the script does | What it usually means |
|---|---|---|
| The middle value is not between the other two | reports oscillatory, gives the interval, and no GCI percentage | the extrapolation would be arithmetic on a premise the data contradicts |
| Two grids agree to the last digit | reports mesh independence reached, divides by nothing | you are past the point where this matters |
| Observed `p` below 0, or above twice the formal order | prints it and does not use it; the GCI falls back to the formal order, with the clamp named | something other than the grid is moving the answer: y+, coverage, a cap, the schemes |
| Refinement ratio below 1.3 | no value with an uncertainty; the ratio is named beside the floor | refine further |
| Two meshes only | assumes the formal order, safety factor 3 | an honest band, wider |

A pair at a ratio of 1.13 once gave a band of plus or minus 3.2 on a value of 0.28. That is arithmetic, not doubt, and the 1.3 floor exists because of it.

Warning

Two ways a ladder reads as clean first-order convergence while measuring something else. On a sliding interface, the error scales with the angular slide per step, so refining space and time together is really refining the time step. And on a wall-function mesh, a refinement that walks y+ through the buffer layer produces a spread that looks like a trend. Both are described in [moving mesh](https://tryreynolds.com/docs/guides/moving-mesh.md) and [wall treatment](https://tryreynolds.com/docs/guides/wall-treatment.md).

## What else to hold constant

- **Layer coverage.** Measure it with `layer_report.py` on every member. One grid study was discarded because coverage varied from 75 to 91%.
- **The diffusion number on a low-Reynolds transient case.** On one annulus, holding `dt` scaled to the Courant number doubled `nu dt/dr^2` at every level, and the fine level diverged; `nCorrectors 4` carried it.
- **The domain.** A mesh study answers what the mesh costs, not what the domain costs. Move the far field separately.
- **The quantity's conditioning.** Drag converges early; lift is a small difference of large integrals and converges much later. Report each to its own confidence.

## Beyond the mesh

Discretisation is one term in the error budget, and often not the largest. [Uncertainty](https://tryreynolds.com/docs/guides/uncertainty.md) puts the reference, the model and the averaging window beside it. The studies that carry a full ladder include [the sliding interface](https://tryreynolds.com/studies/couette-sliding-interface.md), at an observed order of 1.93 on the conformal control against 0.79 across the interface, [the constrained bar](https://tryreynolds.com/studies/constrained-bar-thermal-stress.md) on four meshes, and [flow in a pipe bend](https://tryreynolds.com/studies/dean-vortices-in-a-bend.md) on three. [A sphere at Re 100](https://tryreynolds.com/studies/sphere-at-re-100.md) is the opposite lesson: two meshes, and it says in as many words that two cannot give an order.

## Ask the agent

```
Do a three-mesh GCI on the drag, refining 1.5 times each way, and quote the fine-grid value
with its band. Tell me the layer coverage and y+ range on each mesh.
```

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