For today’s recreational coding exercise, we will simulate the **Kelvin-Helmholtz Instability **with the Finite Volume method. We will consider a compressible fluid with a high density stream moving in opposite direction of the background. The velocity shear induces a famous instability that is seen sometimes in clouds as well as Jupiter’s Great Red Spot.

You may find the accompanying Python code on github.

Before we begin, below is a gif of what running our simulation looks like:

Kelvin-Helmholtz Instability

Finite Volume Method

We will describe the finite volume method to simulate an ideal compressible fluid. Extensions of the method exist for the simulation of other types of fluids. An ideal compressible fluid is described by the Euler fluid equations. For purposes of this discussion, let us consider the system in 2D (it is not too difficult to extend what is presented here to 3D). The fluid is described by what are called primitive variables:

  • Density ρ
  • Velocity vₓ , vᵧ
  • Pressure P

#astrophysics #computational-science #fluid-mechanics #python #simulation

Create Your Own Finite Volume Fluid Simulation (With Python)
13.50 GEEK