Live demo: https://codepen.io/ildarmgt/full/ExPgooV (move the mouse over it)
Made with visualization as priority
Mouse movement creates pressure drops
Single pass with 2 corrections
Liquid assumed incompressible
- Pressure drops derived from previous velocities, corresponding shear stresses, and continuity
- Next time step's velocities derived using those pressure drops
- Absolute pressure estimated across the field and is averaged into both pressure and correction for next step's velocity
- Pressure change over time estimated from simplified time partial derivative of P(v) expression and averaged in for pressure at next step
Touched on in the .js file as comments
Step 3 and 4 I derived myself and tuned their scale for visual consistency
Solution methods for the Incompressible Navier-Stokes Equations (typos here, i used instead of j sometimes) https://web.stanford.edu/class/me469b/handouts/incompressible.pdf
https://rachelbhadra.github.io/smoke_simulator/index.html
Real-Time Fluid Dynamics for Games by Jos Stam
HOW TO SOLVE THE NAVIER-STOKES EQUATION - Benk Janos