Create Your Own Constrained Transport Magnetohydrodynamics Simulation (With Python)

Philip Mocz
Level Up Coding
Published in
7 min readApr 19, 2023

--

In today’s recreational coding exercise, we will simulate the Orszag-Tang vortex — a demonstration of supersonic 2D magnetohydrodynamics (MHD) turbulence — using a constrained transport finite volume algorithm. This tutorial builds on our Finite Volume tutorial for the compressible Euler equations. Here, we will add a magnetic field coupled to the fluid flow.

You may find the accompanying Python code on github.

--

--

Computational Physicist. Sharing intro tutorials on creating your own computer simulations! Harvard ’12 (A.B), ’17 (PhD). Connect with me @PMocz