Turbulox
Documentation for Turbulox.
Turbulox.TurbuloxTurbulox.CollTurbulox.DirectionTurbulox.GridTurbulox.LazyScalarFieldTurbulox.PositionTurbulox.ScalarFieldTurbulox.StagTurbulox.TensorFieldTurbulox.VectorFieldTurbulox.apply!Turbulox.applyfilter!Turbulox.applyfilter!Turbulox.applyfilter!Turbulox.clark_model!Turbulox.collocated_tensorfieldTurbulox.convTurbulox.desymmetrize!Turbulox.deviatorTurbulox.divergence!Turbulox.dxTurbulox.eTurbulox.eddyviscosity_closureTurbulox.eddyviscosity_model!Turbulox.expand_tensorbasis!Turbulox.fill_invariants!Turbulox.fill_tensorbasis!Turbulox.finelineTurbulox.gaussianTurbulox.get_axisTurbulox.get_scale_numbersTurbulox.getvalTurbulox.lapTurbulox.mergestencilTurbulox.nicoud_viscosity!Turbulox.orderTurbulox.poissonsolverTurbulox.pol_tensor_collocatedTurbulox.pol_tensor_stagTurbulox.pressuregradient!Turbulox.project!Turbulox.propose_timestepTurbulox.randomfield_shellTurbulox.randomfield_simpleTurbulox.right_hand_side!Turbulox.s3pqr_viscosity!Turbulox.smagorinsky_viscosity!Turbulox.spectral_stuffTurbulox.stressTurbulox.symmetric_tensorfieldTurbulox.tensorapply!Turbulox.tensorapply_add!Turbulox.tensorbasisTurbulox.tensordivergence!Turbulox.tensordivergence_collocatedTurbulox.tensorproduct_coll!Turbulox.tensorproduct_stag!Turbulox.timestep!Turbulox.verstappen_viscosity!Turbulox.volumefilter_explicit!Turbulox.vreman_viscosity!Turbulox.wale_viscosity!Turbulox.wavenumber
Turbulox.Turbulox — ModuleSimulate turbulence in a box.
Turbulox.Coll — Type1D collocated grid position (at the volume center in a given direction).
Turbulox.Direction — TypeCardinal direction i.
Turbulox.Grid — TypeStaggered grid of half order ho.
Turbulox.LazyScalarField — TypeLazily computed scalar field. Entries at index I are given by func(stuff..., I).
Turbulox.Position — TypePosition in a 3D finite volume.
Turbulox.ScalarField — TypeScalar field.
Turbulox.Stag — Type1D staggered grid position (at the right boundary of a volume in a given direction).
Turbulox.TensorField — TypeTensor field.
Turbulox.VectorField — TypeVector field.
Turbulox.apply! — MethodApply 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
endTurbulox.applyfilter! — MethodFilter scalar field.
Turbulox.applyfilter! — MethodFilter staggered tensor field.
Turbulox.applyfilter! — MethodFilter staggered vector field.
Turbulox.clark_model! — MethodClark's gradient model [1].
Turbulox.collocated_tensorfield — MethodAllocate empty tensor field (collocated).
Turbulox.conv — MethodApproximate the convective force $\partial_j (u_i u_j)$.
Turbulox.desymmetrize! — MethodCopy symmetric tensor to normal tensor
Turbulox.deviator — MethodCompute deviatoric part of a tensor.
Turbulox.divergence! — FunctionCompute divergence of vector field u. Put the result in div.
Turbulox.dx — MethodGet grid spacing.
Turbulox.e — MethodGet unit index in direction i.
Turbulox.eddyviscosity_closure — MethodDivergence of -2 * visc * S. Interpolate visc to staggered points first. Subtract result from existing force field f.
Turbulox.eddyviscosity_model! — MethodEddy viscosity closure model.
Turbulox.expand_tensorbasis! — MethodExpand tensor basis B and fill τ[x] = c[i, x] * B[i, x] (sum over i).
Turbulox.fill_invariants! — MethodFill V with invariants.
Turbulox.fill_tensorbasis! — MethodFill B with basis tensors.
Turbulox.fineline — MethodGet fine grid offset indices corresponding to coarse grid index at position.
Turbulox.gaussian — MethodGaussian filter kernel.
Turbulox.get_axis — MethodGet grid points along axis.
Turbulox.get_scale_numbers — MethodGet 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}}$
Turbulox.getval — MethodGet value from Val.
Turbulox.lap — MethodLaplacian.
Turbulox.mergestencil — MethodMerge stencil periodically if the stencil is longer than the grid size n.
Turbulox.nicoud_viscosity! — MethodTurbulox.order — MethodGet order of grid.
Turbulox.poissonsolver — MethodCreate spectral Poisson solver from grid.
Turbulox.pol_tensor_collocated — MethodInterpolate staggered tensor to volume centers.
Turbulox.pol_tensor_stag — MethodInterpolate collocated tensor to staggered tensor.
Turbulox.pressuregradient! — FunctionSubtract pressure gradient.
Turbulox.project! — MethodProject velocity field onto divergence-free space.
Turbulox.propose_timestep — MethodGet proposed maximum time step for convection and diffusion terms.
Turbulox.randomfield_shell — MethodMake random velocity field with prescribed energy spectrum profile.
Note: The profile takes the scalar wavenumber norm as input, define it as profile(k).
Turbulox.randomfield_simple — MethodMake random velocity field with prescribed energy spectrum profile.
Note: The profile takes the scalar squared wavenumber norm as input, define it as profile(k2).
Turbulox.right_hand_side! — MethodDefault right-hand side function (without projection).
Turbulox.s3pqr_viscosity! — MethodTurbulox.smagorinsky_viscosity! — MethodCompute Smagorinsky's original eddy viscosity [5]. Proposed value for C is 0.17.
Turbulox.spectral_stuff — MethodPrecompute 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.
Turbulox.stress — MethodGet convection-diffusion stress tensor component i,j.
Turbulox.symmetric_tensorfield — MethodAllocate empty tensor field (symmetric, staggered).
Turbulox.tensorapply! — MethodCompute $v_i(I) = \sum_j f(args..., i, j, I)$.
Turbulox.tensorapply_add! — MethodCompute $v_i(I) = v_i(I) + \sum_j f(args..., i, j, I)$.
Turbulox.tensorbasis — FunctionCompute Pope's tensor basis [2].
Turbulox.tensordivergence! — MethodDivergence of staggered tensor field $σ$. Subtract result from existing force field $f$. The operation is $f_i \leftarrow f_i - ∂_j σ_{i j}$.
Turbulox.tensordivergence_collocated — MethodDivergence 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}$.
Turbulox.tensorproduct_coll! — MethodCompute $u v^T$ in the collocated points.
Turbulox.tensorproduct_stag! — MethodCompute $u v^T$ in the staggered points.
Turbulox.timestep! — MethodPerform time step using Wray's third-order scheme.
Turbulox.verstappen_viscosity! — MethodTurbulox.volumefilter_explicit! — MethodFilter without reducing the grid size.
Turbulox.vreman_viscosity! — MethodTurbulox.wale_viscosity! — MethodTurbulox.wavenumber — MethodFFT 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