Expand description
Eulerian grid-based fluid simulation (velocity + pressure + density).
Implements a simplified Navier-Stokes solver on a regular 2D grid using:
- Semi-Lagrangian advection (backtracing)
- Gauss-Seidel pressure projection (incompressibility)
- Vorticity confinement for turbulence detail
- Density/color field advection for visual smoke/fluid
Grid coordinates are cell-centered. Velocity is stored at cell centers (MAC grid variant not required for this simulation scale).
§Quick Start
use proof_engine::physics::fluid::FluidGrid;
let mut fluid = FluidGrid::new(64, 64, 1.0 / 64.0);
fluid.add_velocity(32, 32, 0.0, 5.0);
fluid.add_density(32, 32, 1.0);
fluid.step(0.016);Structs§
- Fluid
Frame - A single snapshot of the fluid state.
- Fluid
Grid - 2D Eulerian fluid simulation grid.
- Fluid
Params - Preset fluid simulation configurations.
- Fluid
Recorder - Records fluid grid frames for replay or analysis.