Skip to main content

Module fluid

Module fluid 

Source
Expand description

Incompressible 2D Navier–Stokes (periodic) via Chorin’s projection method.

Each step: advect + diffuse to an intermediate velocity u*, solve the pressure-Poisson equation ∇²p = (1/Δt)∇·u* (Jacobi), then project u = u* − Δt∇p so the field stays divergence-free.

Validation: the Taylor–Green vortex is an exact solution of the incompressible NS equations whose amplitude decays as exp(-2νt) (the nonlinear advection is exactly balanced by the pressure gradient, leaving pure viscous diffusion). The unit test reproduces that decay rate.

Functions§

solve
Solves.