
2D Finite Volume Euler Solver

Project Overview: 2D Finite-Volume Euler Solver for Supersonic Flow
This project aims to develop a 2D finite-volume solver for the Euler equations, solving supersonic flow over a diamond-shaped airfoil using different numerical schemes. The primary methods include Steger-Warming Flux Vector Splitting (FVS). The solver should initially implement a first-order accurate scheme.
File Structure and Code Organization
The code is structured around a finite-volume discretization of the Euler equations. Each file contributes to different aspects of the numerical solver:
1. Initialization and Boundary Conditions
-
initializeQ & stegerINITIALIZE:
- Set initial flow conditions using given density, velocity, and pressure values.
- Compute flux vectors E and F for numerical flux evaluations.
- stegerINITIALIZE specifically implements the Steger-Warming flux splitting method.
-
firstcolumn:
- Initializes the first column of the computational domain, setting the state vector Q and flux terms.
- Uses ghost cells to enforce boundary conditions.
-
slipwall2:
- Implements adiabatic slip-wall boundary conditions.
- Adjusts velocity components to maintain tangential flow along walls.
2. Core Computational Functions
-
Fluxcalc:
- Computes the fluxes E and F at each cell face.
- Uses conservative variables: Q=[ρ,ρu,ρv,ρ_et]
- Pressure is recovered using:
- P=0.4×(ρ_et−0.5ρ(u_2+v_2))P
-
iter & stegIter:
- Main iteration loop for solving the Euler equations.
- Computes the updated state Q at each time step using flux differences.
-
timestep:
- Determines adaptive time step based on the Courant-Friedrichs-Lewy (CFL) condition.
- Ensures numerical stability by computing:
- Δt=CFL×min( Δx/(U+c), Δy/(V+c) )
- Speed of sound is computed using:
- c=γRTc
3. Visualization and Output
-
makeIT:
- Extracts and stores flow variables (pressure, velocity, density, temperature).
- Used for post-processing.
-
PLOTiter:
- Generates plots of velocity contours.
- Uses color mapping based on normalized velocity values.
Code Flow and Execution
- Initialize Grid & Conditions (initializeQ, stegerINITIALIZE)
- Apply Boundary Conditions (firstcolumn, slipwall2)
- Compute Fluxes (Fluxcalc)
- Update Solution (iter, stegIter)
- Adjust Time Step (timestep)
- Iterate Until Convergence
- Post-Processing and Plotting (makeIT, PLOTiter)
Final Objective
The goal is to compute steady-state supersonic flow over the airfoil, verifying results against oblique shock relations. Convergence is measured using L2-norms of residuals, and solutions are validated by comparing them to theoretical shock wave properties.

Convergence Plots



