Ever wondered what happens within your mug when you stir your coffee? In this video we get to see this process unfold, courtesy of Computation Fluid Dynamics (CFD).

The mesh for this case was generated using snappyHexMesh. A cylindrical set of faces was generated, which was then duplicated and transformed into a pair of Arbitrary Mesh Interface patches (AMI) patches. When doing so, the mesh gets divided into two regions: the inner part of the cylinder, containing the spoon, is free to rotate at a fixed angular velocity, while the outer part remains fixed. The pair of AMI patches are coupled together on each timestep to provide a continuous solution across this boundary. This mesh motion technique is often employed when simulating turbomachinery, propellers, and wind turbines.

The model, solved with interMixingFoam contains three fluid phases: air, water, and sugar. The last two are configured to be miscible, while the air interface remains immiscible. interMixingFoam is a Volume of Fluid (VOF) solver: it only solves a single momentum conservation equation for the mixture. I’ll probably discuss the differences between the Euler-Euler approach and this one in a different post soon.

As expected, the vortices produced by stirring tend to mix the sugar, initially concentrated on the bottom of the mug, and spread it over the water.

This simulation would benefit from using a finer mesh, and solving more of the turbulent scales, but I could not spare the computational resources required this week. Maybe sometime in the future :).

If you are curious, I have uploaded the source code for this case to GitHub:

https://github.com/nicolasbadano/stirring