Compute the exact 1D Riemann solution. Visualize pressure, density, and velocity profiles across the shock wave, contact discontinuity, and rarefaction fan in real time.
The flow is modeled by the one-dimensional Euler equations for an inviscid, compressible, ideal gas. The system is governed by conservation of mass, momentum, and energy.
$$ \frac{\partial \mathbf{U}}{\partial t}+ \frac{\partial \mathbf{F}(\mathbf{U})}{\partial x}= 0, \quad \mathbf{U}= \begin{bmatrix}\rho \\ \rho u \\ E \end{bmatrix}, \quad \mathbf{F}= \begin{bmatrix}\rho u \\ \rho u^2 + p \\ u(E + p) \end{bmatrix}$$Here, $\rho$ is density, $u$ is velocity, $p$ is pressure, and $E = \rho e + \frac{1}{2}\rho u^2$ is the total energy per unit volume, with $e$ as internal energy. For an ideal gas, $p = (\gamma - 1) \rho e$, where $\gamma$ is the specific heat ratio (the "Gamma" parameter in the simulator).
The exact solution to the Riemann problem uses the Rankine-Hugoniot jump conditions across shocks and the isentropic relations through rarefactions. The critical step is solving for the intermediate pressure $p_*$ and velocity $u_*$ using a pressure function $f(p)$ that depends on whether the wave is a shock or rarefaction.
$$ f_L(p_*) + f_R(p_*) + u_R - u_L = 0 $$For a left shock: $f_L(p_*) = (p_* - p_L) \sqrt{\frac{A_L}{p_* + B_L}}$. For a left rarefaction: $f_L(p_*) = \frac{2a_L}{\gamma-1}\left[\left(\frac{p_*}{p_L}\right)^{(\gamma-1)/(2\gamma)} - 1\right]$. Here, $a$ is the speed of sound, and $A_L, B_L$ are functions of $\gamma$ and density. The simulator's solver iterates on this equation to find $p_*$.
CFD Code Verification: The shock tube is the most fundamental test case for any compressible flow solver (like those in ANSYS Fluent or OpenFOAM). Engineers compare their numerical results against the exact solution from this simulator to validate that their code correctly captures shocks, contacts, and rarefactions.
Supersonic Wind Tunnel Design: Shock tubes can generate short-duration, high-speed flows for testing. The principles modeled here are used to design the driver and driven sections of the tube to achieve a desired test condition for a scaled aircraft or missile model.
Explosion & Blast Wave Studies: The sudden release of high-pressure gas models the initial phases of an explosion. Analyzing the resulting shock wave's pressure profile helps in assessing structural damage and designing protective barriers.
Astrophysical Phenomena: The same Riemann problem physics scales to interstellar scales. It is used to model supernova remnants, where a massive star's ejecta (high-pressure region) expands into the interstellar medium (low-pressure region), creating colossal shock fronts.
First, you might think "shock waves always propagate at supersonic speeds", but this refers to the speed relative to the shock wave itself. The propagation speed of the wave observed in the simulator is determined by the Mach number relative to the initial state's speed of sound. For example, a "weak shock wave" created by only slightly increasing the pressure difference between left and right can have a Mach number close to 1, such as 1.05, propagating at nearly the speed of sound. Conversely, in the "strong shock wave" preset, the Mach number can exceed 3, which is a phenomenon closer to an explosion.
Next, the importance of the contact discontinuity is often overlooked. Since pressure and velocity are continuous across this surface, you can easily miss it at a glance on the graph. However, this is the surface where density, temperature, and even entropy become discontinuous—a surface imprinted with the fluid's "history." For instance, if you change the gases on the left and right in the initial state (e.g., left: helium, right: air), the density differs significantly across this surface, profoundly impacting subsequent flow and mixing phenomena. In practical CFD, suppressing the numerical diffusion of this surface is key to computational accuracy.
Finally, note that the specific heat ratio γ setting should not be taken lightly. Changing from the default air (γ=1.4) to a diatomic gas, monatomic gas, or high-temperature gas alters the results more than you might expect. For example, with the monatomic gas argon (γ=1.67), the temperature rise behind the shock wave becomes more pronounced than with air, even for the same pressure ratio. This is because the specific heat ratio reflects the molecular degrees of freedom of the gas and determines the allocation to internal energy. Avoid indiscriminately reusing default values; cultivate the habit of checking the properties of the fluid you are dealing with.
Air shock tube at t=1 ms: left side PL=200 kPa, ρL=2.35 kg/m³; right side PR=50 kPa, ρR=0.59 kg/m³. Solver outputs shock Mach ≈2.8, shock velocity ≈960 m/s, contact surface velocity ≈320 m/s, intermediate pressure ≈95 kPa. Rarefaction fan spans 45 m/s velocity gradient. Density jump across shock reaches 6.1×, validated against γ=1.4 acoustic relations.