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
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
- Vorticity confinement to preserve fine-scale turbulence
- Adaptive grid refinement for detailed local features
- GPU-based solver using compute shaders
- Multi-phase flow with surface tension
- Conjugate gradient solver for faster convergence