Skip to main content

Module gpu_fluid

Module gpu_fluid 

Source
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§

FluidObstacle
A rigid obstacle embedded in the fluid grid.
FluidSimGpu
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.
VorticityConfinement
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.