Visualizing the beauty in physics and mathematics
You can move the obstacle with your mouse!
• Copyright 2022 Matthias Müller — Ten Minute Physics
• See also his GitHub pages
• Code clean up by Zeger Hendrikse, see euler_fluid.html
Streamlines Velocities Pressure Smoke Overrelax
Let’s first assert that:
for all i, j
v[i, j] = v[i, j] + Δt * g
We move the velocity field in the grid. We call this step advection, as advection is defined as the transfer of a property from one place to another due to the motion of the fluid. So if you’ve got some black dye in some water, and the water is moving to the right, then the black dye moves right.
Just as black ink would move through the fluid, so too will the velocity field itself! Intuitively you can think of it this way: a particle moving in a certain direction will continue moving in that direction, even after it’s moved.
Since we’re storing velocity in a grid just like we do with the smoke, we can use the exact same routine to advect velocity through itself.
Share on: