Smoothed Particle Hydrodynamics: The Shock Tube
Joachim Köppen Kiel Sept. 2016

nbr. of particles
smoothing length
density left
density right
time step
display time interval
elapsed time

Isotherm

Density
Speed

### Some brief explanations

• This is a simulation of the movement of gas in a linear tube. It shows the evolution of the density, velocity, and temperature of the gas, starting from the initial situation, which is a rather simple but fundamental example: In the beginning, the left half is filled with gas of high density, while the right half is filled with gas at lower density (but not zero!), separated by a thin membrane. In both parts, the gas is at rest and at the same temperature ( = 1 in arbitrary units). Thus, there is no systematic flow in either direction. At time zero, this membrane is suddenly removed, and the gas rushes from the high density side to fill the low density side. This happens with some interesting features, which can be nicely seen in the simulation.
• The simulation is started by clicking Start. It can be interupted by Stop and continued by Resume. Clear wipes the screen at any instant, so that one may show only the situation at a later time
• The display time interval is the time between the drawing of the curves. If you set this parameter to zero, almost every instant is shown.
• The time step has to be chosen suitably: too large a value will cause the simulation to become unstable, and negative densities will appear, so that the simulation is automatically stopped. There is a maximum acceptable value - from the Courant-Friedrichs-Levy condition - below which the simulation gives reliable results. But the execution becomes slower with smaller time step.
• The nbr of particles (max. 1000) and the smoothing length determine the spatial resolution of the simulation. Fewer particles make faster runs, but the curves cannot show details. Likewise, shorter smoothing lengths give a better resolution, but it should be larger than the distance between two particles, so that one always smoothes over several particles.
• When the shock hits the right hand limit, the results become less accurate, because reflections at the end walls of the tube are modelled in a simple way (by reflecting the particles).

• In an SPH simulation the gas is modeled by a number of particles, whose motions in space follows equations which had been constructed in such a way that quantities like density and velocity - as averaged over a volume specified by the smoothing length - behave as described by the hydrodynamic equations (conservation of mass and momentum). Note that these particles do not mimic the actual motions of atoms or molecules in the gas or the fluid.
The great advantage of SPH calculations (especially in 3D) is that they are independent of any assumptions on the geometry or the symmetry of the modeled object.