API

FiniteDiffWENO5.WENOSchemeMethod
WENOScheme(c0::Array{T, N}; boundary::NTuple=ntuple(i -> 0, N*2), stag::Bool=false,  multithreading::Bool=false) where {T, N}

Structure containing the Weighted Essentially Non-Oscillatory (WENO) scheme of order 5 constants and arrays for N-dimensional data of type T. The formulation is from Borges et al. 2008.

Arguments

  • c0::Array{T, N}: The input field for which the WENO scheme is to be created. Only used to get the type and size.
  • boundary::NTuple{2N, Int}: A tuple specifying the boundary conditions for each dimension (0: homogeneous Neumann, 1: homogeneous Dirichlet, 2: periodic). Default to homogeneous Neumann (0).
  • stag::Bool: Whether the grid is staggered (velocities on cell faces) or not (velocities on cell centers). Default to false.
  • multithreading::Bool: Whether to use multithreading (only for 2D and 3D). Default to true.

Fields

  • γ::NTuple{3, T}: Upwind and downwind constants.
  • χ::NTuple{2, T}: Betas' constants.
  • ζ::NTuple{5, T}: Stencil weights.
  • ϵ::T: Tolerance, fixed to machine precision.
  • stag::Bool: Whether the grid is staggered (velocities on cell faces) or not (velocities on cell centers).
  • boundary::NTuple{N_boundary, Int}: Boundary conditions for each dimension (0: homogeneous Neumann, 1: homogeneous Dirichlet, 2: periodic). Default to homogeneous Neumann.
  • multithreading::Bool: Whether to use multithreading (only for 2D and 3D).
  • fl::NamedTuple: Fluxes in the left direction for each dimension.
  • fr::NamedTuple: Fluxes in the right direction for each dimension.
  • du::Array{T, N}: Semi-discretisation of the advection term.
  • ut::Array{T, N}: Temporary array for intermediate calculations using Runge-Kutta.
source
FiniteDiffWENO5.WENO_step!Method
WENO_step!(u::T,
           v::NamedTuple{(:x, :y), <:Tuple{Vararg{AbstractArray{<:Real}, 2}}},
           weno::WENOScheme,
           Δt, Δx, Δy) where {T <: AbstractArray{<:Real, 2}}

Advance the solution u by one time step using the 3rd-order SSP Runge-Kutta method with WENO5-Z as the spatial discretization in 2D.

Arguments

  • u::T: Current solution array to be updated in place.
  • v::NamedTuple{(:x, :y), <:Tuple{Vararg{AbstractArray{<:Real}, 2}}}: Velocity array (can be staggered or not based on weno.stag).
  • weno::WENOScheme: WENO scheme structure containing necessary parameters and temporary arrays.
  • Δt: Time step size.
  • Δx: Spatial grid size in the x-direction.
  • Δy: Spatial grid size in the y-direction.

Citation: Borges et al. 2008: "An improved weighted essentially non-oscillatory scheme for hyperbolic conservation laws" doi:10.1016/j.jcp.2007.11.038

source
FiniteDiffWENO5.WENO_step!Method
WENO_step!(u::T,
           v::NamedTuple{(:x, :y, :z), <:Tuple{Vararg{Array{<:Real}, 3}}},
           weno::WENOScheme,
           Δt, Δx, Δy, Δz) where T <: AbstractArray{<:Real, 3}

Advance the solution u by one time step using the 3rd-order SSP Runge-Kutta method with WENO5-Z as the spatial discretization in 3D.

Arguments

  • u::T: Current solution array to be updated in place.
  • v::NamedTuple{(:x, :y, :z), <:Tuple{Vararg{Array{<:Real}, 3}}}: Velocity fields in each direction, possibly staggered depending on weno.stag.
  • weno::WENOScheme: WENO scheme structure containing necessary parameters and temporary arrays.
  • Δt: Time step size.
  • Δx: Spatial grid size in the x-direction.
  • Δy: Spatial grid size in the y-direction.
  • Δz: Spatial grid size in the z-direction.

Citation: Borges et al. 2008: "An improved weighted essentially non-oscillatory scheme for hyperbolic conservation laws" doi:10.1016/j.jcp.2007.11.038

source
FiniteDiffWENO5.WENO_step!Method
WENO_step!(u::T,
           v::NamedTuple{(:x,), <:Tuple{<:Vector{<:Real}}},
           weno::WENOScheme,
           Δt, Δx) where T <: AbstractVector{<:Real}

Advance the solution u by one time step using the 3rd-order SSP Runge-Kutta method with WENO5-Z as the spatial discretization in 1D.

Arguments

  • u::T: Current solution array to be updated in place.
  • v::NamedTuple{(:x,), <:Tuple{<:Vector{<:Real}}}: Velocity array (can be staggered or not based on weno.stag).
  • weno::WENOScheme: WENO scheme structure containing necessary parameters and temporary arrays.
  • Δt: Time step size.
  • Δx: Spatial grid size.

Citation: Borges et al. 2008: "An improved weighted essentially non-oscillatory scheme for hyperbolic conservation laws" doi:10.1016/j.jcp.2007.11.038

source