Create Your Own Navier-Stokes Spectral Method Fluid Simulation (With Python)

Philip Mocz
Level Up Coding
Published in
7 min readAug 4, 2023

--

For today’s recreational coding exercise, we solve the Navier-Stokes equations for an incompressible viscous fluid. To do so, we will implement a spectral method. The Navier-Stokes equations approximately describe the motions of a fluid such as water. The equations can capture the phenomenon of turbulence. The system is also of interest in mathematics as a general proof for the existence and smoothness of solutions in 3D is one of the open Millenium Prize Problems.

--

--

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