Eulerian CFD

Grid-based fluid simulation focused on numerical clarity and stability.

Overview

This project implements a two-dimensional Eulerian fluid solver to explore advection, diffusion, and pressure projection in incompressible flow.

The Eulerian approach discretizes space into a fixed grid, tracking fluid properties at each grid point as the simulation evolves. This method excels at capturing complex flow patterns and maintaining numerical stability.

Core Methods

🌊
Semi-Lagrangian Advection
Tracks fluid backward in time for stability
Jacobi Solver
Iterative pressure projection
💨
Diffusion
Explicit viscosity simulation
📐
Staggered Grid
Improved numerical accuracy

Implementation Details

Emphasis was placed on readable, modular code to clearly reflect the underlying math. Boundary conditions are explicitly enforced each timestep to maintain stability.

The staggered MAC (Marker-and-Cell) grid layout stores velocity components at cell faces and pressure at cell centers, reducing numerical artifacts and improving the accuracy of gradient calculations.

Key implementation highlights include optimized memory access patterns, efficient sparse matrix operations for the pressure solve, and careful handling of boundary conditions to prevent artificial damping.

Results

The simulation successfully captures characteristic fluid behaviors including vortex formation, turbulent mixing, and smooth flow around obstacles. The solver maintains stability across a wide range of Reynolds numbers.

Future Improvements