Undergraduate Computer Science Student at West Virginia University
Euler equations are a set of hyperbolic partial differential equations that describe the motion of an inviscid fluid. The compressible equations are given by: \(\\ \begin{align*} \rho_t + (\rho u)_x = 0 \\ (\rho u)_t + \left( \rho u^2 + p \right)_x = 0 \\ E_t + \left( (E + p)u \right)_x = 0 \end{align*}\\\) Where:
$P$ is the pressure of the fluid, related to the density and internal energy by an equation of state. For example, for polytropic gases, the equation of state is given by: \(P = (\gamma - 1) (E - \frac{1}{2} \rho u^2)\)
I use a Godunov finite volume method to solve the Euler equations. The method is based on the idea of partitioning the domain into a grid of cells where each cell has a constant value. The fluxes at the boundaries of each cell are found from the solution to the Riemann problem that corresponds with the cell interface.
For the Riemann solver, I used the method of Roe. The Roe solver is based on a linearization of the the equations around a “Roe average” of the two constant states.
The initial condition is a shock tube problem, where the initial condition is given by:
\(\begin{align*}
\rho(x,0) = \begin{cases} 1 & x < 0 \\ 0.125 & x > 0 \end{cases} \\
u(x,0) = \begin{cases} 0 & x < 0 \\ 0 & x > 0 \end{cases} \\
p(x,0) = \begin{cases} 1 & x < 0 \\ 0.1 & x > 0 \end{cases}
\end{align*}\)
The exact solution of the Riemann problem for Euler equations is known, so that can be used to test the accuracy of the method. Below, the finite volume solution is compared with a popular finite difference solution, and the exact solution to the Riemann problem. The exact solution is given by the dashed line, the finite volume solution is given by the dotted line, and the finite difference solution is given by the solid line.

It can be seen that the finite volume approach does a better job of capturing the shock than the finite difference approach. The finite difference solutions are more diffusive, and do not capture the shock as well.
Subsonic initial condition
\(\\
\rho_0 = \begin{cases} 1.5 & 0.35 < y < 0.55 \ \text{and} \ x < 0.1 \\ 0.4 & \text{otherwise} \end{cases} \\
u_0 = \begin{cases} 0.5 & 0.35 < y < 0.55 \ \text{and} \ x < 0.1 \\ 0 & \text{otherwise} \end{cases} \\
v_0 = 0 \\
P_0 = \begin{cases} 1.5 & 0.35 < y < 0.55 \ \text{and} \ x < 0.1 \\ 0.4 & \text{otherwise} \end{cases} \\\)

Supersonic initial condition Same as above, but with $u_0 = 3$ (roughly mach 2.5 for this flow).

Pressure spike at the center of the domain. The initial condition is given by: \(\rho_0 = 1 \\ u_0 = 0 \\ v_0 = 0 \\ P_0(x,y) = \frac{25}{\sqrt{\pi}} \exp\left(-625\left[(x-0.5)^2 + (y-0.5)^2\right]\right)\)
Numerical Methods for Conservation Laws by Randall J. LeVeque
Riemann Solvers and Numerical Methods for Fluid Dynamics by E. F. Toro