CFTransport

Documentation for CFTransport.

CFTransport.GodunovSchemeType
godunov! = GodunovScheme(kind, dim, rank) <: OneDimFV{dim, rank, kind}
godunov!(backend, newtransported, transported, flux, mass)

Returns the callable godunov! that applies a one-dimensional Godunov scheme to dimension dim among rank. Computations are offloaded to backend.

If kind==:density then transported is a density. If kind==:scalar then transported is a scalar whose density is mass*transported.

If newtransported is the same as transported, it is updated in-place.

The Godunov scheme has 2, possibly 3 steps : 0 - (for densities) : compute scalar from density 1 - compute fluxes (upwind/downwind) 2 - update scalar or density

Boundary conditions are left to the user. If BCs must be enforced between steps 1-2 (e.g. zero boundary fluxes), the user should rather call individual steps concentrations!, fluxes! and FV_update! .

source
CFTransport.OneDimFVType
abstract type OneDimFV{kind,dim,rank} end

One-dimensional finite volume transport operator acting on dimension dim of arrays of rank rank. If kind==:density the operator transports a density field (e.g. in kg/m3) If kind==:scalar the operator transports a scalar field (e.g. in kg/kg)

source
CFTransport.OneDimOpType
abstract type OneDimOp{dim,rank} end

One-dimensional operator acting on dimension dim of arrays of rank rank.

source
CFTransport.StencilType

A one-dimensional stencil is a function/closure/callable of the form

function stencil(i, params, arrays)
    a, b, ... = arrays
    a[i] = expression(params, b[i], b[i+1], b[i-1], ...)
end

A two-dimensional stencil is a function/closure/callable of the form

function stencil((i,j), params, arrays)
    a, b, ... = arrays
    a[i,j] = expression(params, b[i,j], b[i+1,j], b[i,j+1], ...)
end

A stencil acts at a single index. For performance, stencils should be @inline and use @inbounds.

source
CFTransport.VanLeerSchemeType
vanleer! = VanLeerScheme(kind, limiter, dim, rank) <: OneDimFV{dim, rank, kind}
vanleer!(backend, newtransported, transported, flux, mass)

Returns the callable vanleer that applies a one-dimensional Van Leer scheme with limiter to dimension dim among rank. Computations are offloaded to backend.

If kind==:density then transported is a density. If kind==:scalar then transported is a scalar whose density is mass*transported.

If newtransported is the same as transported, it is updated in-place.

The VanLeer scheme has 3, possibly 4 steps : 0 - (for densities) : compute scalar from density 1 - compute slopes (with slope limiter) 2 - compute fluxes (upwind/downwind) 3 - update scalar or density

Boundary conditions are left to the user. If BCs must be enforced between steps 1-2 (e.g. zero boundary slopes) and 2-3 (e.g. zero boundary fluxes), the user should rather call individual steps concentrations!, slopes!, fluxes! and FV_update! .

source
CFTransport.expand_stencilType
stencil = expand_stencil(dim, rank, stencil1)

Returns a stencil of rank rank that applies the one-dimensional stencil stencil1 to dimension dim.

stencil = apply_stencil(dims, rank, stencilN)

Returns a stencil of rank rank that applies the N-dimensional stencil stencilN to the N-tuple of dimensions dims.

stencil can be passed to forall :

forall(stencil, backend, ranges, arrays)

where arrays is the tuple of arrays on which the stencil acts and ranges is more or less axes(a) with a one of the arrays, except that the range over the stencil index shoud be reduced according to the stencil width to avoid out-of-bounds accesses.

See also Stencil

source
CFTransport.apply_stencilMethod
kernel = apply_stencil(dim, rank, stencil)

Returns a kernel that applies a one-dimensional stencil to dimension dim of input/output arrays of rank rank

kernel = apply_stencil(dims, rank, stencil)

Returns a kernel that applies a multi-dimensional stencil to dimensions 'dims' of input/output arrays of rank rank.

kernel can be called directly or offloaded to a backend :

kernel(ranges, arrays)
(kernel=>backend)(ranges, arrays)

where ranges is more or less axes(a) with a one of the arrays, except that the range over the stencil index shoud be reduced according to the stencil width to avoid out-of-bounds accesses.

See also Stencil

source
CFTransport.minmod_simdMethod
slope = minmod_simd(slope1, slope2)

Minmod limiter. This implementation avoids branching and may be more suitable for SIMD vectorization.

source