FlushCFD is my place to show interesting models developed using computational fluid dynamics. The first example is a flushing toilet, hence the name of this website.
In case you are wondering I have a doctorate in contact mechanics and I am a passionate student of physical systems. Naturally, the behaviour of fluids is fundamental to our existence and a source of great fascination for me.
By Cumming's Disciple
24 March 2026
Toilet Simulation CFD OpenFOAM FreeCAD VoF
This is a fun simulation of a flushing toilet. First, I downloaded the amazing 3D modelling software FreeCAD and used it to make a simple toilet model, complete with cistern and S-trap.
Next, I used the CfdOF toolbox which integrates the openFOAM CFD framework into FreeCAD. With a bit of experimentation, I was able to run the "dam break" example. Thoroughly impressed, I wondered if I could simulate the flow of a flushing toilet. To my surprise it worked, and far more quickly, efficiently and reliably than I imagined based on my previous work in numerical simulation.
Meshing was straightforward with the CfdOF-FreeCAD graphical user interface implementing snappyHexMesh, an openFOAM meshing utility. With a nominal cell size of ten- mm, the geometry was quickly meshed without errors. About 80-thousand cells were used.
I set air as the default fluid within the entire domain and then added box-regions to initialise the cells in the lower part of the cistern and the S-trap to 100-percent water.
Next I added the boundary conditions. The default surfaces are of type "wall"; however, three surfaces are specified as Open-Ambient Pressure, shown in green below. Finally, the action of gravity (gz = -9.8 m/s^2) was added to make sure that the water flowed exactly where it was supposed to.
The body is meshed, the initial conditions of the fluids have been set and the boundary conditions implemented. The solver used was incompressible volume of fluid (VoF). I just needed to specify the run controls before starting the simulation. I ran the simulation for 20 seconds real-time to ensure the water drained from the cistern completely. Simulation data was written to disk every 0.05 seconds to produce a smooth animation. The problem was solved by 14 of 24 parallel cores available on my system. The simulation took just under 6 minutes to complete.
Next, post-processing. ParaView is a fantastic simulation viewer installed by the CfdOF/FreeCAD toolbox. A bit of experimentation with different layers and thresholds gives really interesting representations of the fluids and their flow over time. The fluid proportions are rendered below. ParaView also enables visualisation of other fluid flow parameters like pressure and velocity.
ParaView permits generation of video files directly; however, my preferred approach was to export jpegs of each rendered timestep (400 in this case) and importing them into a great video editor called OpenShot. These were converted to a time-accurate video. The result?
The simulation shows that my first toilet design is a bit of a crappy flusher. This is because the water does not follow nicely around the rim, washing down the entire surface of the bowl. So, stay tuned for Part 2 where I will attempt to improve the toilet design. Until then, happy flushing!