jf1uids.initial_condition_generation.turb module

jf1uids.initial_condition_generation.turb module#

jf1uids.initial_condition_generation.turb.create_incompressible_turb_field(Ndim, A0, slope, kmin, kmax, seed=None)[source]#

Creates an incompressible turbulent vector field with a given power spectrum.

Parameters:
  • Ndim (int) – Dimension of the cubic grid (Ndim x Ndim x Ndim).

  • A0 (float) – Amplitude scaling factor for the power spectrum.

  • slope (float) – Slope of the power spectrum (typically -5/3 for Kolmogorov).

  • kmin (float) – Minimum wavenumber.

  • kmax (float) – Maximum wavenumber.

  • seed (int, optional) – Random seed for reproducibility.

Returns:

(vx, vy, vz), each of shape (Ndim, Ndim, Ndim).

Return type:

tuple

jf1uids.initial_condition_generation.turb.create_turb_field(Ndim, A0, slope, kmin, kmax, seed=None)[source]#
Creates a turbulent field with given slope, amplitude

and cutoffs in Fourier space for a uniform grid in 3D.

Parameters:
  • Ndim (int) – the number of grid points in each dimension

  • A0 (float) – the amplitude of the field

  • slope (float) – the slope of the power spectrum

  • kmin (float) – the minimum wavenumber

  • kmax (float) – the maximum wavenumber

Returns:

rfield – the real field

Return type:

np.ndarray