Animation: Fluid Particle Simulation

Hey folks! 🎓

I've been working on this super cool computer graphics animation assignment where we're simulating the flow of particles around a circular obstacle. We're using a technique called "curl noise" by Bridson 2007 to make it look more realistic.

In this 2D assignment, we'll combine a few different pieces to create the final potential, which represents the flow field. We'll have a background flow, a modulation function for the obstacle, some turbulence, and a window function to control the turbulence area.

Laminar Flow 🌊

First, we worked on the laminar part of the flow, which is the smooth, non-turbulent part. We started with a simple particle system and tested it with simple flows like rotation and a constant steady flow.

To make it more engaging, we introduced particles flowing into the right edge at a steady rate. It's pretty cool because when they reach the left edge, we re-initialize them at the right edge, creating an illusion of new particles.

We then made sure the flow avoids the obstacle by using a smooth ramp function and placed the obstacle in a nice position.

Adding Turbulence 🌀

Now, it's time to make things more interesting by adding some turbulence! We imported the Perlin noise function from our lecture demo to create a single band of curl noise.

Real fluids have turbulence at multiple scales, so we combined several noise functions at different scales and velocities to create multi-band turbulence. This makes it look much more realistic! The famous Kolmogorov spectrum tells us to expect kinetic energy per unit mass at a scale, and it allows us to convolutionize the energy in different scale. Here I attached a image showing the curl noise field.

Putting It All Together 🛠️

We then created a smooth window function to control where the turbulence occurs, basically a mask. With all these pieces combined, we produced the complete flow field, and the particles moved beautifully around the obstacle.

Time-Varying Flow ⏳

Finally, to make the flow evolve over time like real turbulence, we simply promoted the noise from 2D to 3D and passed the time as the third coordinate. It made the motion way more interesting!

That's it! We created an awesome animation of particles flowing around an obstacle with realistic turbulence. 🎉

Previous
Previous

Animation: 3D Cloth Collision Simulation

Next
Next

Game Design: 1. Initial Proposal & Nondigital Prototype