---
title: "Case templates: duct, body in a box, dam break, frozen rotor, porous slab, thermal stress, MHD, CHT, VIV"
url: "https://tryreynolds.com/docs/toolbox/templates"
description: "Reference for the templates in the Reynolds toolbox: what each one builds, the constants to edit, the files it writes, what is known about the answer before the solve, and the snappyHexMesh, cfMesh and CAD preparation directories."
---

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

Toolbox

# Toolbox: templates

Reference for the templates in the Reynolds toolbox: what each one builds, the constants to edit, the files it writes, what is known about the answer before the solve, and the snappyHexMesh, cfMesh and CAD preparation directories.

A template is a working Python file: copy it into an empty directory, edit the constants at the top, run it. It meshes, checks and draws the result, and stops short of launching the solver, printing the command instead.

Warning

Most templates take no options. `duct2d.py`, `body_in_box.py`, `free_surface.py`, `rotating.py`, `porous.py`, `thermal_stress.py` and `mhd_hartmann.py` parse no command line, so any argument, including `--help`, is ignored and the template runs, writing its files into the current directory. Always run them in an empty directory of their own. `cht_wall.py` and `viv_cylinder.py` have real options, and `evaluate_steady.py` has one.

```bash
mkdir slab && cd slab
cp /work/.toolbox/templates/porous.py .
python3 porous.py
```

On a machine without OpenFOAM a template writes what it can and stops with the name of the missing program:

```
refused: `gmshToFoam` is not on PATH. It comes with OpenFOAM, which this machine does not appear to have, so the rest of this template cannot run here.
```

| Template | Solver | Dictionaries | What is known before the solve | Measured |
|---|---|---|---|---|
| `duct2d.py` | yours | stubs for the mesh tools | Exact: plane Poiseuille flow | Solved and checked on every pull request |
| `body_in_box.py` | yours | stubs for the mesh tools | Nothing shipped | The mesh only |
| `free_surface.py` | `interFoam` | complete | Hydrostatic pressure before release; volume conserved | The mesh in the repository; one published study solved it |
| `rotating.py` | `simpleFoam` + MRF | complete | Impeller and wall torque equal and opposite | The mesh only |
| `porous.py` | `porousSimpleFoam` | complete | Exact by construction | Coefficients, and a solved drop on every pull request |
| `thermal_stress.py` | `solidDisplacementFoam` | complete | Exact closed form | Solved and graded on every pull request |
| `mhd_hartmann.py` | `mhdFoam` | complete | Exact closed form | Solved and graded on every pull request |
| `cht_wall.py` | `chtMultiRegionSimpleFoam` | mesh, properties | Exact series conduction | The mesh and its regions; no solved result |
| `viv_cylinder.py` | `pimpleFoam` | complete, two cases | Strouhal number; zero net work per cycle | Graded runs on the same mesh |
| `evaluate_steady.py` | `simpleFoam` | through `case_gen.py` | Nothing shipped | Parametric rounds |

All of them need gmsh or `blockMesh` and the OpenFOAM mesh tools. The gmsh templates convert with `gmshToFoam`, which types every patch `patch`, and retype the walls afterwards, since a wall left as a patch is not a wall.

## duct2d.py

A closed planar outline meshed in quads and extruded one cell into hexahedra, with the walls and the two z faces retyped `wall` and `empty`. It writes stub dictionaries, so dress it with [case_gen.py](https://tryreynolds.com/docs/toolbox/case-writing.md).

| Constant | Default | What it is |
|---|---|---|
| `LENGTH_M` | 0.10 | Duct length, m. |
| `HEIGHT_M` | 0.02 | Duct height, m. |
| `CELL_SIZE_M` | `HEIGHT_M / 10` | Background size handed to gmsh, not a division count. |
| `THICK_M` | `CELL_SIZE_M` | Extrusion depth, one cell. |

```bash
python3 duct2d.py
python3 /work/.toolbox/case_gen.py . --speed 1 --reynolds 10 --length 0.04
simpleFoam
```

The Reynolds number is on the hydraulic diameter, which is twice the height; using the height itself moves every number by two. The recorded run reached a peak of 1.4863 m/s against an exact 1.5, with the solver's continuity error at -9.04e-08. One measured mesh had a first row of 1.491 mm on a 2 mm request, so measure the first cell with `layer_report.py`.

## body_in_box.py

A sphere cut out of a flow box with a boolean and meshed body-fitted with tetrahedra: no STL and no snapping stage. Swap `addSphere` for another primitive, or a cut or fuse of several, to change the shape. The box is sized in body radii, longer downstream than upstream. Stub dictionaries.

| Constant | Default | What it is |
|---|---|---|
| `BODY_RADIUS_M` | 0.02 | Sphere radius, m. |
| `CELL_SIZE_M` | 0.01 | Background mesh size, m. |

```bash
python3 body_in_box.py
python3 /work/.toolbox/case_gen.py . --external --body body --speed 1 --reynolds 100
```

## free_surface.py

A two-phase dam break: a square tank one cell thick, a water column set by `setFields` as geometry rather than as a uniform field, an open top, and a complete `interFoam` case with `p_rgh`, `constant/g`, two phases with their own densities and viscosities, surface tension, and both Courant limits.

| Constant | Default | What it is |
|---|---|---|
| `TANK_WIDTH_M` | 0.584 | Tank width and height, m. |
| `COLUMN_WIDTH_M` | 0.1461 | Water column width, m. |
| `COLUMN_ASPECT` | 2.0 | Column height over width. |
| `CELLS_ACROSS` | 60 | Cells across the tank. |

```bash
python3 free_surface.py
interFoam > log.interFoam
```

The surge front is the number usually quoted for this case and it is not graded, because the original paper could not be read and two scalings of time in circulation differ by 1.414. See [free surface setup](https://tryreynolds.com/docs/guides/free-surface-setup.md) and [the published run](https://tryreynolds.com/studies/dam-break-two-phase.md).

## rotating.py

A frozen-rotor bladed mixer in 2D: a vessel with a six-bladed impeller, two cell zones, and the rotation entered as an MRF source on `simpleFoam` with k-epsilon. It writes `constant/MRFProperties` and a `forces` object, so the shaft torque comes out of the run.

| Constant | Default | What it is |
|---|---|---|
| `VESSEL_RADIUS_M` | 0.1 | Vessel inner radius, m. |
| `ROTOR_RPM` | 1000 | Impeller speed in rpm; the case carries rad/s. |
| `N_BLADES` | 6 | Blades. |
| `HUB_FRACTION`, `BLADE_FRACTION`, `ZONE_FRACTION` | 0.20, 0.55, 0.70 | Hub, blade tip and MRF zone radii over the vessel radius. |
| `BLADE_WIDTH_FRACTION` | 0.10 | Blade thickness over the vessel radius. |
| `CELLS_ACROSS` | 80 | Cells across the vessel. |

```
    ROTOR_RPM          1000 rpm      (what you edited, nameplate units)
    omega              104.719755 rad/s    (what constant/MRFProperties carries)
    blade tip speed    5.75959 m/s
what this frozen rotor cannot tell you:
    no blade passing   the 100 Hz tone (6 blades * 1000 rpm / 60) is absent, not small
```

Move `ZONE_FRACTION` by a quarter and run again: the torque should move by no more than a few per cent. See [rotating machinery](https://tryreynolds.com/docs/guides/rotating-machinery.md).

## porous.py

A duct with a porous slab across it. `PRESSURE_DROP_CURVE` holds measured points of velocity and pressure drop, and the two Darcy-Forchheimer coefficients are fitted to it; a packed bed with no curve gets them from Ergun.

| Constant | Default | What it is |
|---|---|---|
| `SLAB_THICKNESS_M` | 0.05 | Thickness along the flow, m. |
| `PRESSURE_DROP_CURVE` | four points | `(face velocity, drop in Pa)` pairs. |
| `HEIGHT_M`, `UPSTREAM_M`, `DOWNSTREAM_M` | 0.1, 0.2, 0.3 | Duct height and straight runs, m. |
| `CELLS_ACROSS` | 40 | Cells across the duct. |
| `RHO_KG_M3`, `NU_M2_S` | 1.204, 1.516e-5 | Air at 20 C. |
| `BED_PARTICLE_DIAMETER_M`, `BED_VOID_FRACTION` | 0.003, 0.38 | The Ergun route. |
| `CROSS_FLOW_MULTIPLIER` | -1000 | Cross-flow resistance, as OpenFOAM's multiplier of the largest component. |

```
    d              1.16756e+08 1/m2    (Darcy, the mu*d*U term)
    f              13182.2 1/m     (Forchheimer, the 0.5*rho*f*U^2 term)
    at 1 m/s      503.34 Pa
                   418.057 m2/s2   <-- what 0/p and the function objects report
```

The default curve is Ergun's own prediction, so the two routes check each other; replace it with yours. See [porousSimpleFoam](https://tryreynolds.com/docs/solvers/poroussimplefoam.md).

## thermal_stress.py

A constrained steel bar heated on one face, as a `solidDisplacementFoam` case with `thermalStress yes`. The temperature field is a rise above the stress-free state, because the solver subtracts no reference temperature.

| Constant | Default | What it is |
|---|---|---|
| `BAR_HEIGHT_M` | 0.02 | Bar height, m. |
| `DELTA_T_K` | 100 | Temperature rise of the hot face, K. |
| `PLANE_STRESS` | `True` | The idealisation; run both. |
| `E_PA`, `NU`, `RHO`, `ALPHA_PER_K`, `C_J_PER_KG_K`, `K_W_PER_M_K` | 2.0e11, 0.3, 7854, 1.1e-5, 434, 60.5 | The steel. |
| `END_TIME_S`, `DELTA_T_S` | 100, 1 | Run length and step. |

```bash
python3 thermal_stress.py
solidDisplacementFoam
postProcess -func 'components(sigma)' -latestTime
```

The exact answers are -220.0000 MPa under plane stress and -314.2857 MPa under plane strain, and their ratio is one over one minus Poisson's ratio. See [FSI and thermal stress](https://tryreynolds.com/docs/guides/fsi-and-thermal-stress.md).

## mhd_hartmann.py

A conducting liquid in a channel across a magnetic field, as a complete `mhdFoam` case meshed by `blockMesh`. `mu` in its `constant/transportProperties` is the magnetic permeability in H/m, not a dynamic viscosity, and the case does not start without `0/pB`.

| Constant | Default | What it is |
|---|---|---|
| `HARTMANN_NUMBER` | 5 | The applied field follows from it. |
| `HALF_HEIGHT_M` | 1 | Channel half-height, m. |
| `CELLS_ACROSS`, `CELLS_ALONG` | 40, 100 | The uniform mesh. |
| `CELLS_PER_LAYER` | 4 | Warn below this many cells inside the Hartmann layer. |
| `LENGTH_RATIO`, `SAMPLE_AT_RATIO` | 20, 15 | Channel length and sampling position, in half-heights. |
| `END_TIME_S` | 2 | Two viscous times across the half-height. |
| `MAX_DELTA_T_S`, `MAGNETIC_CFL`, `ADVECTIVE_CFL` | 0.005, 0.5, 0.5 | The step limits. |

```
    u_c/u_mean     1.23312791   = (cosh Ha - 1)/(cosh Ha - sinh Ha/Ha)
    L/Ha           0.2 m   Hartmann layer thickness
    cells in it    4.0 of 20 across the half-channel
    c_A*dt/dy      0.5000
```

See [mhdFoam](https://tryreynolds.com/docs/solvers/mhdfoam.md).

## cht_wall.py

The two-region mesh a conjugate case starts from: two `blockMesh` blocks carrying cell-zone names, `splitMeshRegions`, `checkMesh -allRegions`, a picture per region, and the exact answer. Per-region properties are copied from the image's own tutorial.

| Option | Default | What it does |
|---|---|---|
| `--no-mesh` |  | Write the files and stop: no OpenFOAM needed. |
| `--no-properties` |  | Build the mesh but do not copy the per-region properties off the image. |

| Constant | Default | What it is |
|---|---|---|
| `FLUID_THICK_M`, `SOLID_THICK_M` | 0.02, 0.01 | Layer thicknesses, m. |
| `CELLS_ACROSS_FLUID`, `CELLS_ACROSS_SOLID`, `CELLS_SPAN` | 20, 10, 2 | The mesh. |
| `HOT_K`, `COLD_K` | 400, 300 | Outer face temperatures, K. |
| `FLUID_K`, `FLUID_MU`, `FLUID_CP`, `FLUID_RHO` | 0.6, 1.0e-3, 4181, 1000 | The fluid layer. |
| `SOLID_K`, `SOLID_CP`, `SOLID_RHO` | 16, 434, 7854 | The solid layer. |

`--no-mesh` needs no OpenFOAM and prints the target:

```
  what a solve of this mesh owes, exactly (conjugate.py derives and grades it):
    flux             2944.78527607 W/m2, one value through both
    T at the interface 301.84049080 K
  Pr = mu Cp / kappa = 0.001 * 4181 / 0.6 = 6.968333
    -- `thermophysicalProperties` has no kappa entry: this is where the
       fluid's conductivity is actually set, and the answer turns on it
```

No solved result of this template is recorded; the test that would solve it is opt-in and has not completed. See [heat transfer setup](https://tryreynolds.com/docs/guides/heat-transfer-setup.md).

## viv_cylinder.py

A cylinder on a spring, written as the two cases the study is: `fixed/` for the Strouhal number and `released/` on a morphing mesh with a linear spring and no damping. Both share the 51,150-cell O-grid of the graded run.

| Option | Default | What it does |
|---|---|---|
| `--diameter DIAMETER` | `0.01` | Metres. |
| `--ustar USTAR` | `5.0` | U / (f_n D). |
| `--re RE` | `100.0` | Reynolds number on the diameter. |
| `--nu NU` | `1e-06` | M2/s; water at 20 C. |
| `--rho RHO` | `1000.0` | Kg/m3. |
| `--mstar MSTAR` | `10.0` | Body mass over displaced fluid mass. |
| `--dof {1,2}` | `1` | 1 = transverse only (graded); 2 = free in the x-y plane (untried). |
| `--stage {both,fixed,released}` | `both` | Which of the two cases to write. |
| `--cycles CYCLES` | `60.0` | Shedding cycles to run, which sets endTime. |
| `--no-mesh` |  | Write the cases and skip blockMesh/checkMesh/mesh_look.py. |

```bash
python3 viv_cylinder.py --no-mesh
python3 /work/.toolbox/viv.py released --fixed fixed --out viv.png     # after solving both
```

```
Re 100 on D = 0.01 m  ->  U = 0.01 m/s
f_n = 0.2 Hz  ->  k = 1.240251e-02 N/m, T_n = 5 s
f_n with the added mass = 0.190693 Hz
blockage D / H = 2.50%, cells 51150
next: solve fixed/ and check the Strouhal number before solving released/
```

`--dof 2` has no graded run behind it. See [moving mesh](https://tryreynolds.com/docs/moving-mesh.md).

## evaluate_steady.py

The `build.py` of a parametric round: a cambered section over a ground plane in a box. It is not edited; its shape comes from `design_constants.py` (`CHORD_M`, `CAMBER_1`, `CAMBER_POS`, `THICKNESS`, `ALPHA_DEG`, `RIDE_HEIGHT_M`), with no defaults, so a candidate that arrives without one fails loudly.

| Option | What it does |
|---|---|
| `--write-round DIR` | Lay out a round: this file as `build.py`, a sample `hooks.py`, `goal.lock.json` and `design_constants.py`. |

```bash
python3 evaluate_steady.py --write-round rounds/000
```

The mesh sizes (`CELL_BODY_M` 0.002, `CELL_FAR_M` 0.08, the box extents in chords) are the file's own, and the lock's `fidelity.cells` band holds them to account. See [studies and sweeps](https://tryreynolds.com/docs/toolbox/studies.md).

## snappy/

Three dictionaries and a page: `blockMeshDict`, `surfaceFeatureExtractDict` and `snappyHexMeshDict`. Two values in them are the literal token `CHANGE_ME`, because nothing can guess them: the background box and `locationInMesh`.

```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/mesh_look.py .
```

Castellate, snap and layer addition are separate stages, and a stage that fails late still exits 0: get a clean `checkMesh` from the first two before turning layers on. Read layer coverage from `layer_report.py`. Run a large build in the background; a half-written `polyMesh` reads like a mesh.

## cfmesh/

One `meshDict` with a `CHANGE_ME` surface file. cfMesh reads a single closed surface, so a patch set is concatenated first.

```bash
cp /work/.toolbox/templates/cfmesh/meshDict system/
cat constant/triSurface/{inlet,outlet,walls}.stl > constant/triSurface/all.stl
cartesianMesh > log.cartesianMesh && checkMesh
python3 /work/.toolbox/cfmesh.py check . --wall walls --log log.cartesianMesh
```

`renameBoundary` with a `defaultName` folds every patch not listed in `newPatchNames` into one, and a key that matches no patch is a warning with exit code 0. [cfmesh.py](https://tryreynolds.com/docs/toolbox/meshing.md) writes a consistent dictionary for you.

## prep/

A page rather than a script: turning a customer STEP file into a tagged fluid domain, as build123d in cells. The steps are import and repair, checkpoint, defeature, select and boolean, the fluid domain, tag, export. What it carries that a signature cannot is the measured traps: `healShapes` with its sewing on can lose solids while barely moving the volume, the kernel's target unit outlives the session that set it, `import_step` does not read a file's unit, and defeaturing tolerances are absolute, so the same call can take seconds in metres and not return in millimetres. Tessellation happens once, at the end, through `cad_convert.export_patches()`.

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