EulerianFluidSimulation is a Python-based numerical solver for simulating 2D incompressible and inviscid fluid flows. It uses an Eulerian grid-based approach to models fluid dynamics.
This simulator solves 2D incompressible and inviscid flows.
- Eulerian approach: the simulation uses a grid-based approach to modelling, as opposed to a particle based approach
- Incompressibility: Incompressibility is enforced by modifying velocities to enforce 0 divergence per cell
- Velocity Advection:
- The semi-lagrangian method is used to advect velocity. This traces back in time to find source positions of fluid arriving at a cell within a given timestep
- Velocities are interpolated (bilinear interpolation) to correctly apply velocities to fixed locations of cell boundaries.
- Smoke Advection:
- Smoke is advected in the same manner as velocity: the semi-lagrangian method
- A smoke density value is stored at the centre of each cell
An excellent more detailed description of this approach is given here.
- Numpy
- Numba
- Pygame
