Coffee Stirring Simulation - Fluid Mechanics - interMixingFoam - OpenFOAM 2112

Опубликовано: 24 Июнь 2026
на канале: Nicolás Diego Badano
13,707
226

What happens within your mug when you stir your coffee? In this OpenFOAM case we get to see this process unfold, courtesy of Computation Fluid Dynamics (CFD).

The mesh for this case is generated using snappyHexMesh. A cylindrical set of faces is generated, which is 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. The vortices produced by stirring tend to mix the sugar, initially concentrated on the bottom of the mug.

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/stir...

#cfd #mesh #multiphase #OpenFOAM #grid #numericalmodeling #computationalhydraulics #mechanicalengineering #mechanical #research #simulation #cae #fluiddynamics #fluidmechanics #turbulence #aerodynamics #automative #aerospace #flow #motorsport #openfoam #ansys #starccm #opensource #technology