# Sod Shock Tube Problem - CFD Simulation

Source: https://help.sim-flow.com/validation/sod-shock
Last updated: 2026-10-14

[Video](https://help.sim-flow.com/validation/images/sod-shock.mp4)

## Introduction

In this article, we will study the shock tube problem, also known as the Sod problem, investigated deeply by Gary Sod in 1978. By solving the Euler equations, we will provide three characteristics, describing the propagation speed of the rarefaction wave, the contact discontinuity and the shock discontinuity. An analytical solution of the Sod problem exists. That is why this problem is very often used as a validation case for compressible solvers.

We will investigate a 1D numerical simulation of the Sod problem in **SimFlow** showing high accuracy in solving compressible flows.

## What is Sod Shock Tube Problem

The Sod shock tube is a Riemann problem used to test the accuracy of computational methods. A shock tube consists of a pipe with a circular or rectangular cross-section, which is filled with a gas. The tube is split into two parts by a diaphragm being positioned in the middle of it - see [Figure 1](https://help.sim-flow.com/validation/sod-shock#fig-sod-shock-tube-0). Numerically, the diaphragm is modeled as a discontinuity in initial fluid conditions (density, pressure and temperature) across this surface.

![image3](https://help.sim-flow.com/validation/images/sod-shock/image3.png)

Figure 1. Sod shock tube at t=0s. On the left-hand side, a region with high density, pressure and temperature

The initial conditions are very simple for this problem: a contact discontinuity separating gas with different pressure and density, and zero velocity everywhere. In the standard case, the density and pressure on the left are unity. The density on the right side of the diaphragm is 0.125 and the pressure is 0.1. The ratio of specific heats is 1.4. The initial conditions can be summarized in the following equation.

\[\begin{pmatrix} \rho_L \\ P_L\\ u_L \end{pmatrix} = \begin{pmatrix} 1.0 \\ 1.0\\ 0.0 \end{pmatrix} \quad , \quad \begin{pmatrix} \rho_R \\ P_R\\ u_R \end{pmatrix} = \begin{pmatrix} 0.125 \\ 0.1\\ 0.0 \end{pmatrix} \quad \quad \quad (1)\]

where \(\rho\) is density, \(P\) pressure and \(u\) velocity. Indices \(_L\) and \(_R\) refer to left and right-hand side conditions on the side of the diaphragm. By solving the Euler equations, we can obtain the time evolution of this problem. As a result, we will get three characteristics, describing:

- the propagation speed of the rarefaction wave,
- the contact discontinuity (surface that separates zones of different density and temperature),
- the shock discontinuity.

We will compare results from **SimFlow** to the analytical solution.

## Sod Shock Tube - Geometry and Mesh

The tube has a rectangular cross-section with dimensions of 0.1mx0.1m and a length of 1m. The geometry is presented in [Figure 2](https://help.sim-flow.com/validation/sod-shock#fig-tube-geometry).

![image1](https://help.sim-flow.com/validation/images/sod-shock/image1.png)

Figure 2. Tube geometry

The numerical mesh was created using only the **Base Mesh Box** tool, which is an integral part of **SimFlow**. It is based on the basic mesh generator available in **OpenFOAM** that allows creating parametric meshes in a very simple and fast way. Since we are considering a 1D case, the mesh in the y and z directions contains only 1 cell. For the x direction, 5000 cells were used.

![image2](https://help.sim-flow.com/validation/images/sod-shock/image2.png)

Figure 3. 1D mesh of the Sod shock tube

## Sod Shock Tube - Simulation & BC Setup

The **rhoPIMPLE** solver was used to calculate the Sod shock tube problem. This is a pressure-based transient solver for compressible fluid flow. The working fluid is air with thermophysical properties given in [Table 1](https://help.sim-flow.com/validation/sod-shock#tab-properites). Please note that dynamic viscosity \(\mu\) is set to \(0\) (as we want to solve the Euler equations) and the turbulence modeling is set to laminar. The Prandtl number is not used in this case. As an equation of state, we are using the ideal gas law.

Table 1. Thermodynamic properties of air

| \(M \; [\frac{g}{mol}]\) | \(C_p \; [\frac{J}{kg \cdot K}]\) | \(\mu \; [Pa \: s]\) | \(P_r \; [-]\) |
| --- | --- | --- | --- |
| \(28.96\) | \(1005\) | \(0\) | \(0.7\) |

All boundaries are treated as walls and we apply "zeroGradient" conditions for all flow variables. But for the proper initialization of the model, we patched the domain at \(t=0 \; s\) according to equation (1), defining \(p\), \(U\) and \(T\) for the left and right-hand sides of the domain. Since we are going to deal with the compressible flow with strong discontinuities like shock waves, robust and accurate numerical schemes must be considered. The least squares method was used for gradient schemes and limited linear schemes for convective terms. The momentum and energy equations are solved using the **PBiCG Stabilized** linear solver.

## Results

To demonstrate the accuracy of **SimFlow**, we calculated the solution at time \(t=0.2 \; s\) and compared the analytical solution to the numerical one by plotting density, pressure and velocity curves along the shock tube.

![image4](https://help.sim-flow.com/validation/images/sod-shock/image4.png)

Figure 4. Density variation along the shock tube

![image7](https://help.sim-flow.com/validation/images/sod-shock/image7.png)

Figure 5. Pressure variation along the shock tube

![image5](https://help.sim-flow.com/validation/images/sod-shock/image5.png)

Figure 6. Velocity variation along the shock tube

## Summary

**SimFlow** was used to simulate the Sod problem. It was shown that the results obtained are in very good agreement with the analytical solution. Therefore, **SimFlow** can be used for modeling of compressible flows with strong discontinuities, providing high-quality results.

## Literature

- [Sod, G. A. (1978)] Sod, G. A. 1978, "A Survey of Several Finite Difference Methods for Systems of Nonlinear Hyperbolic Conservation Laws", Journal of Computational Physics, Elsevier, 1978, 27 (1), pp. 1-31
- [Sod Shock Tube] Sod Shock Tube - Wikipedia, [https://en.wikipedia.org/wiki/Sod_shock_tube](https://en.wikipedia.org/wiki/Sod_shock_tube)
