Expand description
GPU-accelerated fluid simulation using a MAC (Marker-and-Cell) grid.
This module provides a CPU mock of GPU Navier-Stokes incompressible fluid simulation. The MAC grid stores pressure at cell centres and velocity components on cell faces, following the Harlow-Welch staggered layout.
Structs§
- Fluid
Obstacle - A rigid obstacle embedded in the fluid grid.
- Fluid
SimGpu - High-level GPU-accelerated fluid simulation driver.
- MacCell
- A single cell in a Marker-and-Cell (MAC) grid.
- MacGrid
- A 2-D Marker-and-Cell (MAC) grid for incompressible fluid simulation.
- Vorticity
Confinement - Vorticity confinement adds back dissipated rotation energy.
Functions§
- cfl_
timestep - CFL-stable time-step for the MAC grid.
- interpolate_
velocity - Bilinearly interpolate velocity at world coordinates
(x, y). - reynolds_
number_ grid - Compute the Reynolds number
Re = u_max * L / nu.