3D Pseudo-Spectral Navier-Stokes Solver in Julia

This video is a translation of the "Spectral-DNS in Python" paper by Mortensen and Langtangen. We will solve the Taylor-Green Vortex turbulence simulation in Julia using a three-dimensional pseudo spectral solver with the FFT. Here is the code: https://github.com/Ceyron/machine-lea... The Fast Fourier Transform allows for a super efficient computation of the Navier-Stokes equations of fluid motion when we have periodic Boundary Condition. This allows us to perform Direct Numerical Simulations of Turbulence for simple (artificial) scenarios. Here, we will look at the well known case in Computational Fluid Dynamics: the 3D Taylor-Green Vortex. Over the course of the simulation, we will see multiple stages of Turbulence ------- 📝 : Check out the GitHub Repository of the channel, where I upload all the handwritten notes and source-code files (contributions are very welcome): https://github.com/Ceyron/machine-lea... 📢 : Follow me on LinkedIn or Twitter for updates on the channel and other cool Machine Learning & Simulation stuff:   / felix-koehler   and   / felix_m_koehler   💸 : If you want to support my work on the channel, you can become a Patreon here:   / mlsim   ------- Timestamps: 00:00 Intro 01:01 Scenario: 3D Taylor-Green Vortex 01:45 Multiple Stages 02:37 The Pseudo-Spectral Algorithm 09:47 Reference to the Python Code 10:06 Imports 10:45 Defining Simulation Constants 12:00 Main Function Boilerplate 12:12 Creating the Mesh 13:48 Defining the Wavenumber 17:21 Prescribing the Initial Condition 18:51 Pre-Plan the Fast-Fourier Transformation 19:47 Array Pre-Allocation 22:25 Pre-Compute Dealiasing 24:51 Time-Loop Boilerplate 25:12 (1) Compute Curl in Fourier Domain 25:48 Function to compute cross product 29:30 (1) cont. 30:40 (2) Transform Curl to Spatial Domain (inverse FFT) 31:52 (3) Compute "Convection" in Spatial Domain 32:57 (4) Transform "Convection" to Fourier Domain 33:35 (5) De-Alias High Frequency components 34:47 (6) Compute "Pseudo-Pressure" in Fourier Domain 35:58 (7) Assemble rhs to ODE system in Fourier Domain 37:26 (8) Explicit Euler step update 37:55 (9+10) Transform updated velocity to Spatial domain (inverse FFT) 39:05 Viz: Boilerplate Conditional 39:33 Viz: Compute Curl Magnitude 40:38 Viz: Makie.jl Preparations 44:22 Viz: Updating Makie.jl plot 46:18 Running and Discussion 49:35 Outro