turbicgen creates 3D vector fields using fourier transforms to translate from a power-law spectrum in K-space to a position-space realization of a random field.

The IC generator is MPI-parallelized, making it possible to create arbitrarily large random fields. Fourier transforms are calculated using the FFTW library.

The IC generator was originally written by Mark Krumholz. The RNG is a Mersenne Twister implementation written by Geoff Kuenning.

Command Line Arguments


turbicgen outputname ngrid kmin kmax kidx
  • outputname

    • Base name for the output files. Outputs will be named $outputname.[1-3].
  • ngrid

    • Number of grid cells along any given dimension.
  • kmin

    • Minimum k for which the power spectrum is nonzero.
  • kmax

    • Maximum k for which the power spectrum is nonzero.
  • kidx

    • Power law index for the power spectrum in k-space.

Optional Command Line Arguments

  • stddev
    • Standard deviation of the output values. Only used if compiled with --enable-normalized.


  1. An MPI libary. So far this has been tested on openmpi 1.6 on OSX.
  2. fftw 2.1.5 compiled with mpi. I would like to port to fftw 3 in the future, but this code predates the new version of fftw.

Build options

  • --enable-verbose

    • Enable verbose output
  • --enable-binary

    • Write to a binary data file instead of ascii
  • --enable-solenoidal

    • Return a purely solenoidal turbulent field
  • --enable-face

    • Return a solenoidal vector field appropriate for a face-centered stencil
  • --enable-normalized

    • Normalize the field components. Must specify the stddev of the result.