Create Your Own Finite Volume Fluid Simulation (With Python) Part 2: Boundary Conditions & Source Terms

<p>For today&rsquo;s recreational coding exercise, we will expand on the Finite Volume method for simulating the compressible fluid equations. We will add boundary conditions and source terms. For&nbsp;<a href="https://levelup.gitconnected.com/create-your-own-finite-volume-fluid-simulation-with-python-8f9eab0b8305" rel="noopener ugc nofollow" target="_blank">Part 1</a>, please see the Python tutorial on the Kelvin-Helmholtz Instability, which we build on. Here in Part 2, we will simulate a different instability: the Rayleigh-Taylor Instability, which is what occurs when a heavy fluid sits on top of a light fluid and is pulled down by gravity. In this problem, we will learn how to add&nbsp;<strong>source terms for gravitational acceleration</strong>&nbsp;and&nbsp;<strong>reflective boundary conditions</strong>.</p> <p>You may find the accompanying&nbsp;<a href="https://github.com/pmocz/finitevolume2-python" rel="noopener ugc nofollow" target="_blank">Python code on github</a>.</p> <p>Before we begin, below is a gif of what running our simulation looks like:</p> <p><a href="https://philip-mocz.medium.com/create-your-own-finite-volume-fluid-simulation-with-python-part-2-boundary-conditions-source-bda6994b4645"><strong>Visit Now</strong></a></p>
Tags: Finite Volume