Published on

Implementing Fluid-Solid Coupling in Kinetic Two-Phase Flow Simulation

Authors
  • avatar
    Name
    Justin James Clayden
    Twitter

Implementing Fluid-Solid Coupling in Kinetic Two-Phase Flow Simulation

I recently was enchanted by a relatively new algorithm outlined in the paper "Implementing Fluid-Solid Coupling in Kinetic Two-Phase Flow Simulation" by Wei Li and Mathieu Desbrun (Via 2 Minute Papers).

It handles the usually quite difficult cases involving the boundaries between two immiscible fluids, allowing for highly complex interactions between them, including:

Splashes, bubbles, waves, and so much more:

Fluid splashes in a bowlA bubble rises within a fluidWaves in a fluid

In the past I would read a paper like this, injest its meaning, and spend days if not weeks creating an implementation from scratch. Instead, I decided I would use Claude Code to assist me with the task. We produced initially a 2D implementation, then a 3D implementation. I liked the 2D version a lot, and so extended it to support arbitrary shapes via bitmaps, as well as colouring the shapes using RGB bitmaps. I also implemented an orchestration system that allows objects and forces to be introduced at arbitrary times during the simulation.

Thus I present a video I made using this system, that invites the viewer to see what's possible when you come and visit https://justy.me - enjoy!

(It's at the top of the post, but in case you didn't click it there, here it is again:)

Copyright 1995-2024 Justin James Clayden