---
title: "Tutorial: Darcy-Forchheimer pressure drop through a porous slab"
url: "https://tryreynolds.com/docs/tutorials/porous-duct"
description: "Turn four datasheet points into the two porosity coefficients OpenFOAM needs, solve a duct with a porous slab, and compare the drop in the unit the solver reports instead of the one it does not."
---

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

OpenFOAM cases

# A porous duct

Turn four datasheet points into the two porosity coefficients OpenFOAM needs, solve a duct with a porous slab, and compare the drop in the unit the solver reports instead of the one it does not.

A filter, a radiator or a packed bed is a pressure loss per metre, and OpenFOAM wants it as two coefficients nobody gave you. You will derive them from a pressure-drop curve, solve the slab, and convert the answer once.

**You will learn** a Forchheimer plot, why pore velocity and face velocity differ, and the density factor between a field and a datasheet.

**You need** Python for the first half and an OpenFOAM for the solve.

## The physics

OpenFOAM's sink is `S = -(mu d + (rho |U| / 2) f) U`, so the drop across a slab of thickness `L` is

`dp = (mu d U + 0.5 rho f U^2) L`

Divide by `L U` and it is a straight line in `U`, with intercept `mu d` and slope `0.5 rho f`. The speed is the **face** velocity, the volume flow divided by the whole slab face, and not the pore velocity, which is larger by one over the void fraction.

The shipped curve is Ergun's prediction for 3 mm spheres at a void fraction of 0.38 in air at 20 C. It is not a measurement; replace it with your own.

## Steps

### Get the coefficients

Copy the template anywhere and print its arithmetic. No OpenFOAM needed.

```bash
cp openreynolds/toolbox/templates/porous.py .
python -c "import porous; print(porous.summary())"
```

Run here, trimmed:

```
    thickness      L = 0.05 m
    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)

the derivation run backwards against the points it came from:
    face velocity      measured        predicted      error
         0.5 m/s     152.4740 Pa     152.4740 Pa   -2.19e-05%
           1 m/s     503.3400 Pa     503.3404 Pa   +7.28e-05%
         1.5 m/s    1052.6000 Pa    1052.5992 Pa   -7.6e-05%
           2 m/s    1800.2500 Pa    1800.2505 Pa   +2.59e-05%

    at 1 m/s      503.34 Pa
                   418.057 m2/s2   <-- what 0/p and the function
                                     objects report.
```

### Use your own curve

Edit `PRESSURE_DROP_CURVE` and `SLAB_THICKNESS_M` in the copy. The curve is pairs of face velocity in m/s and drop in Pa. Run the same command and read the error column: with real data it is the misfit of the Forchheimer form.

### Solve

```bash
mkdir -p /tmp/slab && cd /tmp/slab
python3 /src/openreynolds/toolbox/templates/porous.py
porousSimpleFoam | tee log.porousSimpleFoam
```

The drop is the difference of the two `surfaceFieldValue` outputs in `postProcessing/`.

### Convert once

`dp [Pa] = rho dp [m2/s2]`, with `rho = 1.204` in air. A field of 418 and a datasheet of 503 Pa are the same drop.

Or give the agent the whole thing:

```
Solve flow through a packed-bed slab as a Darcy-Forchheimer momentum sink and measure the pressure drop. Be careful with units: porousSimpleFoam is incompressible and solves p/rho in m2/s2, so convert by rho before comparing against a drop in pascals.
```

## Read the result

Recorded results, not run for this page:

| Case | Drop | Against 503.34 Pa |
|---|---|---|
| the mesh CI solves | 472.5594 Pa | -6.1% |
| published study, 80 cells across |  | -2.5% |
| published study, 160 cells across | 414.6 m2/s2 = 499.2 Pa | -0.82% |
| Richardson extrapolation of the three finest | 420.6 m2/s2 = 506.4 Pa | +0.6% |
| pressure gradient **inside** the slab |  | -0.013% |

![The published run on both axes: gauge pressure in pascals on the left and kinematic pressure on the right. Flat upstream, linear through the shaded slab, flat downstream. Refining the mesh raises the upstream plateau.](https://tryreynolds.com/assets/porous-pressure-duct-9lNQRlzX.png)

The published run on both axes: gauge pressure in pascals on the left and kinematic pressure on the right. Flat upstream, linear through the shaded slab, flat downstream. Refining the mesh raises the upstream plateau.

The error is at the faces of the slab. The pressure step is smeared over about one cell, so the drop reads low and the error falls at first order. The duct's wall friction was measured at 0.15 m2/s2, 0.04% of the drop, so it cannot account for the gap. A shorter duct would not tighten the number; refining the mesh does.

The template's own printed note says the inlet-to-outlet drop will be a little **larger** than the closed form. The recorded solves came out lower on every mesh. Trust the runs.

## Check it

- **The gradient inside the slab first.** It should match the sink before the total drop does.
- **Two units, one conversion**, done once at the end.
- **Refine.** `CELLS_ACROSS` at 40, 80 and 160, then [`grid.py`](https://tryreynolds.com/docs/tutorials/mesh-convergence.md).

## Try next

1. Replace the curve with three points from a real datasheet and read the fit errors.
2. Compute the drop at 0.5 and 3 m/s by hand. How far is the ratio from linear, and from quadratic?
3. Halve the thickness and confirm the drop halves.

## When it goes wrong

### The field reads 418 and the datasheet says 503

They agree. The field is `p / rho`.

### The drop is off by exactly 0.38 or its square

Pore velocity went in where face velocity belongs. The two differ by the void fraction.

### The solver stops and names a zone

`porosityProperties` names a `cellZone` the mesh does not have. A physical volume in gmsh becomes the zone, so a renamed volume breaks it.

### porousSimpleFoam is not on PATH

The template says so and gives the equivalent: an `explicitPorositySource` in `constant/fvOptions` under `simpleFoam`.

## Next

[A frozen-rotor mixer](https://tryreynolds.com/docs/tutorials/mixer.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.
