Turbulox

Documentation for Turbulox.

Turbulox.CollType

1D collocated grid position (at the volume center in a given direction).

source
Turbulox.StagType

1D staggered grid position (at the right boundary of a volume in a given direction).

source
Turbulox.apply!Method

Apply kernel! on args... over the entire domain. The args are typically input and output fields. The kernel should be of the form

using KernelAbstractions
@kernel function kernel!(args...)
    # content
end
source
Turbulox.get_scale_numbersMethod

Get the following dimensional scale numbers [2]:

  • Velocity $u_\text{avg} = \langle u_i u_i \rangle^{1/2}$
  • Dissipation rate $\epsilon = 2 \nu \langle S_{ij} S_{ij} \rangle$
  • Kolmolgorov length scale $\eta = (\frac{\nu^3}{\epsilon})^{1/4}$
  • Taylor length scale $\lambda = (\frac{5 \nu}{\epsilon})^{1/2} u_\text{avg}$
  • Taylor-scale Reynolds number $Re_\lambda = \frac{\lambda u_\text{avg}}{\sqrt{3} \nu}$
  • Integral length scale $L = \frac{3 \pi}{2 u_\text{avg}^2} \int_0^\infty \frac{E(k)}{k} \, \mathrm{d} k$
  • Large-eddy turnover time $\tau = \frac{L}{u_\text{avg}}$
source
Turbulox.randomfield_shellMethod

Make random velocity field with prescribed energy spectrum profile.

Note: The profile takes the scalar wavenumber norm as input, define it as profile(k).

source
Turbulox.randomfield_simpleMethod

Make random velocity field with prescribed energy spectrum profile.

Note: The profile takes the scalar squared wavenumber norm as input, define it as profile(k2).

source
Turbulox.spectral_stuffMethod

Precompute wavenumber shell indices and create cache arrays for spectrum computation.

If npoint is nothing, the spectrum is computed for all resolved shells. If npoint = 100, the spectrum is only computed for 100 evenly log-spaced wavenumbers.

source
Turbulox.tensordivergence!Method

Divergence of staggered tensor field $σ$. Subtract result from existing force field $f$. The operation is $f_i \leftarrow f_i - ∂_j σ_{i j}$.

source
Turbulox.tensordivergence_collocatedMethod

Divergence of collocated tensor field $\sigma$. First interpolate to staggered points. Subtract result from existing force field $f$. The operation is $f_i \leftarrow f_i - ∂_j σ_{i j}$.

source
Turbulox.wavenumberMethod

FFT wavenumber (similar to fftfreq, but returns integers).

Example

julia> Turbulox.wavenumber.(1:8, 8)
8-element Vector{Int64}:
  0
  1
  2
  3
 -4
 -3
 -2
 -1
source