Driven supersonic turbulence
The turbulent driving module implements an Ornstein–Uhlenbeck stirring pattern (Federrath; see Price & Federrath 2010, Tricco, Price & Federrath 2016). The algorithms and tests are described in the Phantom code paper (Section 2.4); this page explains how to run turbulence calculations.
Which SETUP to use
All three compile with PERIODIC=yes and DRIVING=yes (stirring compiled in).
Basic hydro turbulence run
Create a run directory outside the code tree:
mkdir -p ~/runs/turb
cd ~/runs/turb
~/phantom/scripts/writemake.sh turb > Makefile
make setup
make
Run the setup utility (interactive prompts, then edit turb.setup if needed):
./phantomsetup turb
Default geometry is a unit periodic cube with a cubic particle lattice
(ilattice=1; close-packed ilattice=2 is closer to a relaxed distribution).
Default units mimic a molecular cloud (3 pc box, low density, 0.2 km/s sound speed);
see setup_turb.f90 for defaults.
Run the simulation:
./phantom turb.in
MHD turbulence
The turb preset does not enable MHD by default. Rebuild with:
make MHD=yes
make setup MHD=yes
make MHD=yes
Then run phantomsetup again. Set Bz_0 in turb.setup for a uniform field in
\(z\). The setup prints MHD turbulence w/uniform field in z-direction when
MHD is active.
Dusty turbulence
Use the pre-cooked dusty preset:
~/phantom/scripts/writemake.sh dustyturb > Makefile
make setup
make
./phantomsetup turb
This uses setup_turb.f90 with DUST=yes and the dust-as-mixture method (see
Dust). Configure grain bins in turb.setup as for other dusty setups.
Stirring parameters (.in file)
Driving is controlled at runtime when DRIVING was enabled at compile time.
Key options (see also the code paper Table of parameters, Section 2.4):
A forcing.dat file may be written/read to continue an identical forcing pattern
across restarts.
Suggested starting values are written into a fresh turb.in by phantomsetup
(e.g. tmax, dtmax, nfulldump for several outputs per crossing time).
Tune st_energy and st_decay together: the module sets
st_OUvar = sqrt(st_energy/st_decay).
Resolution and timesteps
Use
hfactand kernel choice as in A brief guide to Phantom runtime options (the paper recommends quintic kernels for some dusty tests; defaultturbuses the setup default kernel).C_courandC_forcedefault to 0.3 and 0.25 (paper test suite values).Individual timesteps are enabled in the
turbpreset (IND_TIMESTEPS=yes).
Analysis and comparison
Visualise dumps with splash.
Measure \(\nabla\cdot\mathbf{v}\) and \(\nabla\times\mathbf{v}\) with
phantom2divv(see List of Phantom utilities).For standardised MHD benchmark problems from the code paper (e.g. Orszag–Tang), see the external phantom-examples repository (also mentioned in Getting started on Rusty (Flatiron cluster)).
Further reading
Compile-time configuration — compile-time flags (
PERIODIC,DRIVING,MHD)Initial conditions / pre-cooked configurations — full SETUP list
How to compute density on a set of particles with Phantom — periodic box without the dedicated
turbsetup fileCode paper Section 2.4 (physics); Section 5.1 (supersonic turbulence application)