Kármán Street
← All projects

Finite-volume Euler solver from first principles

A finite volume CFD solver developed from first principles to simulate compressible flow in a 2D channel with a geometric perturbation, solving the Euler equations using a cell-centered formulation. Writing the solver rather than using one is what exposes the parts that are usually hidden.

Numerical scheme

The solver includes central differencing for flux computation, artificial dissipation, and a 4-stage Runge–Kutta time integration scheme with adaptive timestep control based on CFL conditions. Full boundary condition handling was implemented for subsonic inlet and outlet flows, ensuring correct characteristic behaviour — which is where a hand-written solver most often goes wrong.

Validation

The model was validated against reference data (Hirsch), achieving strong agreement in pressure coefficient distributions, and a mesh independence study confirmed convergence at 75×25 resolution.

Comparison against the Hirsch dataset for different mesh sizes/assets/img/projects/euler-hirsch-validation.png
Fig. 1 — Comparison of Hirsch dataset and results for different mesh sizes.

Results

Parametric studies were performed on freestream Mach number (M = 0.3–0.7), identifying compressibility effects and shock formation at higher Mach numbers, as well as analysing entropy variations and pressure distributions across the domain.

Mach number distribution at M = 0.70/assets/img/projects/euler-mach-070.png
Fig. 2 — Mach number distribution for M∞ = 0.70.

Additional studies included outlet pressure sensitivity and convergence behaviour based on residual reduction and mass flow balance.