---
title: "Meshing engines: blockMesh, gmsh, snappyHexMesh, cfMesh and the CAD desk"
url: "https://tryreynolds.com/docs/guides/meshing-engines"
description: "What each mesher in the workspace is good at, the cad tool that runs one for you and how it decides it is finished, the starting dictionaries, cell count estimates, adaptive refinement, and the traps that leave a wrong mesh at exit code 0."
---

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

Guides

# Meshing engines

What each mesher in the workspace is good at, the cad tool that runs one for you and how it decides it is finished, the starting dictionaries, cell count estimates, adaptive refinement, and the traps that leave a wrong mesh at exit code 0.

Four meshers are installed, and one agent that drives them. This guide is which to use and what to check.

## Which mesher

| Mesher | Good at | Weak at |
|---|---|---|
| `blockMesh` | anything that is a block or maps to one: channels, ducts, O-grids. Exact control | arbitrary geometry |
| gmsh | body-fitted tets straight off CAD primitives and booleans; quads extruded one cell for a plane case. No STL needed | hex-dominant wall layers |
| `snappyHexMesh` | a complicated surface in a hex background, with per-patch refinement and an absolute first-layer height | layers erode; fails late and still exits 0 |
| cfMesh | a hex-dominant mesh whose layers survive: 100.0% coverage on a wall where snappy finished at 66.7% | no y+ control; the domain box has to be geometry |

## The `cad` tool

The agent has a `cad` tool that takes a shape in words, or a path to a STEP or IGES file on the workspace, and returns an OpenFOAM mesh of it. A second agent works there, in a persistent Python kernel on the same machine, one cell at a time, with build123d, gmsh and OpenFOAM reachable. Its default limits are 30 steps or 900 seconds (`OPENREYNOLDS_CAD_MAX_STEPS` and `OPENREYNOLDS_CAD_MAX_SECONDS` change them), and each step gets 240 seconds of attention; a cell still running is polled, not killed.

What comes back: a picture, the patch table with areas and normals, `checkMesh`'s verdict, the script that rebuilds the geometry (`build.py` from the accepted cells), and the case directory. It is a mesh only: no fields and no solver settings.

### How a run finishes

A declaration of "done" is checked by the harness:

| Kind | Checks |
|---|---|
| Binding | a mesh exists and has cells, `checkMesh` clean per region, the size the request named, patches named, the picture drawn |
| Advisory | what `cad_audit.py` and `domain_probe.py` say about the exported surface. A warning that is neither fixed nor waived with a reason blocks the declare too |
| Independent review | after both, a reviewer that did not build the mesh looks at it from several views against the request, and may hand back problems twice |

`mesh_review` is the same reviewer as a tool, for a mesh built any other way. It judges shape, not quality. The scale check is a factor of 100 between the mesh bounds and the largest length the request names, which catches millimetres read as metres.

A request the desk cannot answer correctly, such as a CAD file with no unit, is refused with the reason rather than guessed.

## gmsh templates

| Template | Builds |
|---|---|
| `duct2d.py` | a closed planar outline in quads, extruded one cell |
| `body_in_box.py` | a primitive cut from a flow box, meshed body-fitted with tetrahedra |

Both run `gmshToFoam`, which types every patch `patch`, so the walls are retyped and `checkMesh` and `mesh_look.py` follow. gmsh meshes a B-rep of primitives body-fitted in about a second, where snappy would spend minutes rediscovering its edges. Prism layers on a body clear of every boundary come from gmsh's `extrudeBoundaryLayer`; where the body meets a floor or a symmetry plane, run snappy with only `addLayers` on over the gmsh mesh.

## snappyHexMesh

```bash
cp /work/.toolbox/templates/snappy/*Dict  system/
python3 /work/.toolbox/patch_entries.py . --insert system/snappyHexMeshDict \
        --insert system/surfaceFeatureExtractDict
python3 /work/.toolbox/preflight.py . --checks change_me
blockMesh && surfaceFeatureExtract && snappyHexMesh -overwrite && checkMesh
python3 /work/.toolbox/layer_report.py . --patch walls
```

| Knob in the template | Value | Note |
|---|---|---|
| `nCellsBetweenLevels` | 3 | 1 passes `checkMesh` and the schemes dislike it |
| `resolveFeatureAngle` | 30 |  |
| `maxNonOrtho` in quality control | 65 | `preflight` warns at 70 and fails at 85 |
| `maxInternalSkewness` | 4 | `preflight` warns at 4 and fails at 10 |
| `maxGlobalCells` | 2,000,000 | raise it deliberately, having predicted the count with `cells_estimate.py` |
| `nLayerIter` | 50 | where it stops and prints a coverage |
| `addLayers` | false | turn on once castellate and snap are clean |

Two entries are literal `CHANGE_ME` tokens: the background box corners, and `locationInMesh`. `domain_probe.py --suggest` proposes the point and measures its clearance. A wrong point meshes the outside of a duct and exits 0.

Every surface has to appear in `geometry`, in `features` and in `refinementSurfaces` by the same name. One left out of `refinementSurfaces` is still meshed and takes whatever boundary condition the default patch has; `patch_entries.py` writes all three lists from the directory.

## cfMesh

```bash
python3 /work/.toolbox/cfmesh.py where                         # is it on this image
python3 /work/.toolbox/cfmesh.py box body.stl --out boxed.stl --upstream 5 --downstream 15
python3 /work/.toolbox/cfmesh.py case . --surface boxed.stl --max-cell 0.1 \
        --wall body --wall-cell 0.01 --layers 5 --ratio 1.2 --patch xMin:patch --symmetry yMin
cartesianMesh && checkMesh
python3 /work/.toolbox/cfmesh.py check . --wall body
```

| Trap | Symptom |
|---|---|
| Keys depend on `surfaceFile` | against a feature-edge surface (`.ftr`) use the regex `"hull_.*"`; against a raw STL use the literal. A wrong key matches nothing and the mesh has no layers at exit 0 |
| `renameBoundary` merges unnamed solids | name every face you need with `--patch` or `--symmetry`, or you get two patches and no inlet |
| cfMesh meshes the inside of a closed surface | an external body has to be boxed first; that is what `box` does |
| Layers sized from the local cell | y+ is measured afterwards, not asked for |

`--upstream`, `--downstream` and `--side` are multiples of the body's longest extent. `cfmesh.py prepare` makes an existing snappy mesh readable by cfMesh. `case --mesher pMesh` writes the same dictionary for a polyhedral mesh; no polyhedral mesh has been measured on this image.

## Counting before building

`cells_estimate.py` predicts the count from the STL and the dictionaries, within about a factor of two for ordinary shapes, and a large difference from what you get usually means a leak. `preflight.py` warns at a ratio of 3 and fails at 20, and says when a mesh is past 20 million cells.

## Multi-region and converted meshes

- **Conjugate:** `splitMeshRegions -cellZones -overwrite`, and `checkMesh -allRegions`. See [heat transfer setup](https://tryreynolds.com/docs/guides/heat-transfer-setup.md).
- **From another tool:** `mesh_quality.py formats` lists converters that are actually installed, and `convert` runs one. Fluent, gmsh, VTK, I-DEAS unv, cfx4 and STAR-CCM have converters; CGNS has none in either direction in OpenFOAM.
- **Refining while it solves:** `amr.py`, in [moving mesh setup](https://tryreynolds.com/docs/guides/moving-mesh.md).

## What "good" means here

| Measure | Warn | Fail |
|---|---|---|
| Non-orthogonality | 70 degrees | 85 degrees |
| Skewness | 4 | 10 |
| Aspect ratio | 1000 | none |

These are conventional lines, not laws: a 78 degree mesh runs fine with enough correctors and the right scheme. `checkMesh` is the sole authority. `mesh_quality.py report` draws where the failing cells are, which decides what to do: 11 in four cells on a trailing edge is a snap artefact, the same in a band across the domain is a mesh to throw away.

## Related

[Geometry formats](https://tryreynolds.com/docs/guides/geometry-formats.md), [wall treatment](https://tryreynolds.com/docs/guides/wall-treatment.md), [geometry and meshing](https://tryreynolds.com/docs/geometry-and-meshing.md), and the [meshing](https://tryreynolds.com/docs/toolbox/meshing.md) and [geometry](https://tryreynolds.com/docs/toolbox/geometry.md) script references. The published coverage comparison is in the [Wigley hull](https://tryreynolds.com/studies/wigley-hull.md) work.

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