---
title: "Free surface, particles and porous media: interFoam, SPH, tracking and Darcy-Forchheimer"
url: "https://tryreynolds.com/docs/solvers-multiphase"
description: "interFoam, interIsoFoam and compressibleInterFoam for water with air above it, a smoothed-particle solver for a surface that breaks, particle tracking through a solved field, and porousSimpleFoam for a pressure drop without meshing the pores. What each is for, how to run it, and what it was measured against."
---

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

# Water, particles and porous media

Four families that share a habit: each one replaces something expensive to resolve with something cheaper that is still measurable. An interface instead of two solvers, particles instead of a mesh, a sink instead of a packed bed.

## Free surface flow

Water with air above it, and a real interface between them. The volume-of-fluid approach carries one momentum equation and an indicator field for which phase is in each cell, so a tank, a hull, a wave, a sloshing vessel or a filling operation is one case rather than two coupled ones. The checks it brings with it are strong: the solver must conserve water volume, and still water must obey hydrostatic pressure exactly.

### interFoam

**What it is.** Transient volume-of-fluid for two incompressible phases, one momentum equation, with gravity and surface tension.

**When it is the one.** A free surface is in the answer: gravity on and an indicator field present. Hull resistance and sinkage, a tank filling or sloshing, a dam break, a weir, a wave against a structure.

**How it runs.** The two-phase template writes a case meant to be solved as it stands, not a stub:

```
python3 free_surface.py        # tank, water column, setFields, a complete interFoam case
interFoam
python3 /work/.toolbox/results.py .     # the standard set of pictures and plots
```

It builds a square tank one cell thick, puts a water column in the corner, runs `setFields` so the column is a real interface rather than a uniform field, writes every dictionary the solver needs including the alpha Courant limit, and prints the command it would run next rather than spending your compute for you.

**What it is held to.** Volume conservation, which the solver owes, and hydrostatic pressure in a tank at rest, which is exact. The graded case reports a volume drift of -1.5e-06 once the water leaving the open lid is accounted for, and under 2.4e-07 before any of it reaches the top.

**Worked examples.** [A Wigley hull set afloat](https://tryreynolds.com/studies/wigley-free-surface.md) settled within 1.3 mm of the towing tank measurement, with the wave pattern and the heave and trim history behind it. [A collapsing water column](https://tryreynolds.com/studies/dam-break-two-phase.md) conserved its water to under a ten-millionth, with every drop that left the domain accounted for.

![The free surface elevation around a hull seen from above, with the bow wave and the diverging wave train trailing aft on both sides](https://tryreynolds.com/assets/wigfs-wave-pattern-B18P_acZ.png)

The wave pattern a hull makes, as surface elevation. The sinkage that comes with it is what the towing tank measured, which is what makes the case comparable.

### interIsoFoam

**What it is.** The same solver with the isoAdvector geometric interface scheme.

**When it is the one.** The interface is smearing across cells and sharpness is the thing being measured. A geometric advection scheme reconstructs the interface inside each cell rather than relying on a compressive flux limiter, which is what keeps a thin sheet or a small droplet thin and small.

### compressibleInterFoam

**What it is.** Two-phase volume of fluid with both phases compressible.

**When it is the one.** A gas phase whose density is part of the answer: a slam, a cavity collapse, an entrapped air pocket being compressed. If the air in the problem is doing work rather than just sitting above the water, this is the solver that lets it.

## Smoothed particles

`sph.py` is a 2D weakly compressible smoothed-particle hydrodynamics solver in numpy, with nothing compiled. Its subject is a free surface that breaks, folds or separates, where there is no mesh to deform through the motion: a collapsing column, a slosh, a wave impact. It needs no mesh at all, which is the whole point, and it runs on a laptop with numpy installed.

It solves the same physics a volume-of-fluid run does, and the two are complements: `interFoam` resolves a thin interface better once a mesh exists, and this needs none. The time step is acoustic, so a second of motion is thousands of steps however few particles there are.

```
python benchmarks/sph/grade.py hydrostatic   # still water against the exact law
python benchmarks/sph/grade.py sloshing      # the first mode against linear theory
python benchmarks/sph/grade.py dambreak      # containment and weak compressibility
```

**What it reported.** Still water comes back at 2.50% RMS of rho g h against the exact hydrostatic law, and the first sloshing mode at -4.75% of the period linear theory gives, with the sign of that error read as the diagnosis it is: a period that short says the effective tank is shorter than the one asked for. The published runs are [water that is doing nothing](https://tryreynolds.com/studies/still-water-pressure.md) and [the sign of the error is the diagnosis](https://tryreynolds.com/studies/sloshing-period.md).

![A tank of particles coloured by pressure, increasing smoothly with depth, with the exact hydrostatic profile drawn alongside](https://tryreynolds.com/assets/sph-hydrostatic-CRj6vFd8.png)

Particles in still water, coloured by pressure, against the exact law. Nothing is moving, which is the hardest thing for a particle method to get right.

## Particle tracking

`tracks.py` integrates particles and tracers through a flow field that is already solved. It reads a finished OpenFOAM case through the same reader the renderer uses, integrates drag plus buoyancy-corrected gravity with fourth-order Runge-Kutta, vectorised over the whole seed set, and reports what became of each particle: where it went, what it hit, how long it stayed.

**When it is the one.** Where the carried thing goes, once the carrying flow is known: deposition, capture on a body, residence time, a tracer. It is one-way, so the particles do not act back on the flow, which is exactly right for a dilute load and the reason it is cheap: one solved field serves any number of particle studies.

**Drag law.** Stokes where Stokes holds, Schiller-Naumann where it does not, and the toolbox's `references/sphere_drag.py` carries Stokes, Schiller-Naumann, Clift-Gauvin and the Newton plateau each with the range it holds over, so a run reads the correlation rather than recalling it.

```
python benchmarks/particles/grade.py drag      # relaxation and terminal velocity, both exact
python benchmarks/particles/grade.py tracer    # an orbit that has to close
python benchmarks/particles/grade.py capture   # the critical Stokes number
python3 /work/.toolbox/tracks.py /work/case --seed-inlet 2000
```

**What it reported.** A particle relaxing into a stream reaches the free stream to 1.92e-12 of it over five relaxation times, and a 20 micron quartz grain falls at 0.03207991 m/s against an exact 0.0320799111. A tracer orbit closes to 5.1e-08 of its radius at 200 steps per turn, and the error falls as the fourth power of the step exactly as the integrator requires. The capture threshold comes out at +1.03% of a published critical Stokes number of one eighth, with the direction of the remaining error known in advance from how the search terminates. The published runs are [a grain of dust](https://tryreynolds.com/studies/dust-in-a-stream.md) and [the number where a particle stops being able to hit anything](https://tryreynolds.com/studies/critical-stokes-capture.md).

![Particle trajectories approaching a cylinder, the heavier ones striking it and the lighter ones sweeping past, with capture efficiency against Stokes number beside them](https://tryreynolds.com/assets/pt-capture-DJ5oi2oR.png)

Below a critical inertia a particle never reaches the obstacle in its path, however long you wait. The threshold is a published number, and the sweep brackets it.

## Porous media

**What it is.** `porousSimpleFoam` is the steady incompressible solver with a Darcy-Forchheimer sink applied over a named cell zone.

**When it is the one.** A pressure drop through a region you do not want to mesh: a packed bed, a filter, a heat-exchanger core, a radiator, a screen. Resolving the pores would cost more cells than the rest of the model put together and answer a question nobody asked.

**The coefficients, which are the whole problem.** A porous zone in OpenFOAM is two vectors, and they are not on anybody's datasheet. What is on a datasheet is a pressure drop against flow rate, so the template derives the coefficients from that: either from a measured drop curve by a Forchheimer plot, or from a particle size and a void fraction by Ergun. The arithmetic and the fit residual are written into the case itself, and the coefficients recover to 7.6e-5% of the curve they came from.

The sink is written on the superficial face velocity and the thickness along the flow, so a drop quoted without its thickness is half a measurement, and the template prints both.

```
python3 porous.py              # duct, slab, two cell zones, a complete porousSimpleFoam case
porousSimpleFoam
python3 /work/.toolbox/balance.py .    # the drop across the slab, in the unit the solver reports
```

**What it is held to.** The sink integrated across the slab, which is exact by construction. The case is graded on every commit at 472.5594 Pa solved against 503.3404 Pa predicted, and a finer study reached -0.82% and established that the remaining gap is the pressure step at the slab faces smeared over about one cell, measuring the duct's own wall friction at 0.04% of the drop.

**One unit, read carefully.** This solver carries pressure as p over density, so a solved field reading about 415 and a datasheet reading 503 Pa are the same drop. The grader asserts the comparison in both directions, and the published run is [the drop was right all along, the unit was the thing to get right](https://tryreynolds.com/studies/packed-bed-pressure-drop.md).

![Pressure along a duct containing a porous slab, flat either side and falling linearly through the slab, with the closed-form drop marked](https://tryreynolds.com/assets/porous-pressure-duct-9lNQRlzX.png)

Pressure along the duct. Flat upstream, a straight fall through the slab, flat again downstream, and the closed-form prediction drawn across it.

## Notes for agents

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

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