Do you stir your coffee like Team Robot or like Team Human? In this video, we get to see how different those look, courtesy of Computational Fluid Dynamics (CFD).

Once upon a time I implemented a CFD model of the stirring of a coffee cup. The spoon just rotated around the cup, changing in orientation so the wide side always faced the flow; many colleagues complained that this motion was far too unrealistic. No human could stir like that, hence Team Robot!

In this new version, I implemented a slightly more realistic motion, in which the spoon maintains its initial orientation through the stirring. Go Team Human!

Stepping behind the curtain, it’s obvious that the original version was simpler to implement in OpenFOAM. A cylindrical pair of Arbitrary Mesh Interface patches (AMI) patches split the mesh into two separate regions. The inner part, containing the spoon, rotated at a fixed angular velocity, while the outer part remains fixed. That dynamic mesh technique is often employed when simulating turbomachinery, propellers, and wind turbines.

The new approach ups complexity a couple of notches: now there are two pairs of AMI patches, dividing the mesh into three regions: a fixed region, a rotating outer region, and a translating inner region, which contains the spoon. The movement of these regions is carefully choreographed so the AMI patches can behave like sliding interfaces.

Check the video until the end, where the mixing of sugary water, initially concentrated on the bottom of the mug, is shown. What stirring technique do you think is more effective?

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

https://github.com/nicolasbadano/stirring