Ready, Set, Flush!
Toilets are deceptively simple devices. Beneath the porcelain lies a compact hydraulic system shaped by gravity, geometry, and turbulent multiphase flow. With modern open‑source tools, we can now simulate these dynamics in remarkable detail. This article walks through the workflow for modelling a toilet flush using FreeCAD, CfdOF, and OpenFOAM.
The process began in FreeCAD, where I created a simplified toilet model including the cistern, bowl, and S‑trap. The goal wasn’t aesthetic fidelity but capturing the essential flow paths and volumes.
To run CFD directly from FreeCAD, I used the CfdOF workbench, which provides a clean interface to OpenFOAM. After validating the setup with the standard “dam break” case, I moved on to the full toilet geometry. The solver handled it more efficiently than expected, especially given the complex free‑surface behaviour involved.
Meshing was performed using snappyHexMesh through the CfdOF GUI. A nominal cell size of 10 mm produced a mesh of roughly 80,000 cells, striking a balance between resolution and computational cost. The meshing process completed without errors—an encouraging sign given the curved surfaces and narrow passages typical of toilet plumbing.
The simulation domain was initialised with air as the default fluid. Using region definitions, I set the lower cistern volume and the S‑trap to 100% water to represent the pre‑flush state.
Most surfaces remained as wall boundaries, but three were defined as Open Ambient Pressure outlets to allow realistic air exchange. Gravity was applied as gz=−9.8 m/s^2, ensuring the water column behaved correctly under gravitational acceleration.
For the multiphase behaviour, I selected the incompressible Volume of Fluid (VoF) solver. This method tracks the air-water interface sharply and is well‑suited to free‑surface flows with significant deformation.
Key run settings:
Simulation time: 20 s
Output interval: 0.05 s
Parallelisation: 14 cores
Total runtime: just under 6 minutes
This provided enough temporal resolution for smooth animation while keeping the computational load modest.
Post‑processing was carried out in ParaView, which integrates seamlessly with OpenFOAM output. By adjusting isosurfaces, opacity maps, and threshold filters, I generated clear visualisations of the evolving water-air interface.
Beyond the interface itself, ParaView enabled inspection of:
Velocity fields
Pressure distributions
Flow separation zones
Jet coverage along the bowl rim
ParaView can export video directly, but I used OpenShot video editing software to obtain precise control over frame timing.
The simulation revealed a key flaw in my initial design: the rim jets do not distribute water uniformly, resulting in incomplete bowl coverage. While the model is intentionally simplified, the workflow demonstrates how CFD can expose design shortcomings early in the development cycle.
Modern open‑source tools make it entirely feasible to prototype, iterate, and optimise even something as mundane—but surprisingly complex—as a toilet flush. The next time you press the button, remember: there’s a lot of physics behind that swirl.
Geometry
Mesh
Fluid Regions
Boundary Conditions