Matlab Code for 3D Turbulence Simulations

The following .m files implement the simulation described in our column. You must be running Matlab to use these files. Choose a grid size, for example

M=32; N=32; P=32;

Then run the script initbabc; This initializes the flow as a superposition of ABC flows and sets values of other parameters: the time step deltat for forward integration, the viscosity nu, and the body force per unit mass g. Other initialization may be added here. This script calls the function makek.m. To integrate forward, invoke rk4;. This script calls several functions, written as .m files, nonlinear.m, fft3.m, iff3.m. The flow appears to be turbulent after a transient period estimated at t=15. The script rk4 can be interrupted with CTRL-C and restarted where it left off.