Flux

Numerical fluxes in KitAMR.jl are abstracted as

To distinguish with Navier-Stokes and other types of fluxes (which may be implemented in future version), the fluxes corresponding to DVM are abstracted to

Currently, the best supported flux is

KitAMR.CAIDVMType
abstract type CAIDVM <: AbstractDVMFluxType

Conserved adaptive implicit DVM flux.

source

Here are functions related to flux calculation and update:

Backend functions

KitAMR.flux!Method
flux!(ka::KA)

Outer function for flux computation and update. The iteration is carried out through faces, which avoids redundant computation.

source

Methods for different types of faces. Through these methods, different scenarios are decomposed into a unified interface, and the same core functions can be invoked for solving.


KitAMR.update_flux!Function
update_flux!(
    flux::AbstractVector,
    micro_flux::Vector{Matrix{Float64}},
    face::Union{FluxData, FullFace},
    heavi::Vector{Bool}
)
source
update_flux!(
    _::Nothing,
    micro_flux::Vector{Matrix{Float64}},
    face::Union{FluxData, FullFace},
    heavi::Vector{Bool}
)
source

A shell for the dispatch according to whether the macro flux update is required. The method for DomainFace is separately defined: update_domain_flux!.


KitAMR.update_domain_flux!Function
update_domain_flux!(
    flux::AbstractVector,
    micro_flux::Vector{Matrix{Float64}},
    face::DomainFace,
    heavi::Vector{Bool}
)
source
update_domain_flux!(
    _::Nothing,
    micro_flux::Vector{Matrix{Float64}},
    face::DomainFace,
    heavi::Vector{Bool}
)
source

Refer to update_flux!.


KitAMR.update_micro_flux!Function
update_micro_flux!(
    here_micro,
    there_micro,
    here_data::PsData{DIM},
    _::SolidNeighbor{DIM},
    heavi::Vector{Bool}
)
source
update_micro_flux!(
    here_micro,
    there_micro,
    here_data::PsData{DIM, NDF},
    there_data::PsData,
    heavi::Vector{Bool}
)
source
update_micro_flux!(
    here_micro,
    there_micro,
    here_data::PsData{DIM, NDF},
    there_data::KitAMR.AbstractGhostPsData,
    heavi::Vector{Bool}
)
source

Update flux in AbstractVsData. Mapping between velocity cells with different refinement level is considered.


KitAMR.update_macro_flux!Function
update_macro_flux!(
    flux::Vector,
    here_data::PsData,
    there_data::PsData
)
source
update_macro_flux!(
    flux::Vector,
    here_data::PsData,
    _::KitAMR.AbstractGhostPsData
)
source
update_macro_flux!(
    flux::Vector,
    here_data::PsData,
    _::SolidNeighbor
)
source

Update flux in AbstractPsData, which is necessary to predict the macroscopic state in implicit DVM. The conserved correction in the mapping between different velocity cells also depends on this.


KitAMR.make_face_vsFunction
make_face_vs(face::DomainFace{DIM, NDF}) -> FaceVsData
source
make_face_vs(
    face::FullFace{DIM, NDF}
) -> Tuple{FaceVsData, FaceVsData}
source
make_face_vs(
    face::HangingFace{DIM, NDF}
) -> Tuple{FaceVsData, Array{FaceVsData{_A, _B}, 1} where {_A, _B}}
source
make_face_vs(
    face::BackHangingFace{DIM, NDF}
) -> Tuple{Array{FaceVsData{_A, _B}, 1} where {_A, _B}, FaceVsData}
source

Construct FaceVsData corresponding to here_data and there_data in AbstractFace.

User interfaces

Developers may hope to use their own numerical flux to meet their requirements. KitAMR.jl provides compact user interfaces. User only needs to define the flux across a single inner face and a single domain face. KitAMR.jl will automatically dispatch them for different mesh cases. As an example, the methods corresponding to CAIDVM are defined as

KitAMR.calc_fluxMethod
calc_flux(
    _::Type{CAIDVM},
    here_vs,
    there_vs,
    flux_data::Union{FluxData, FullFace},
    ka::KA{DIM, NDF}
) -> Tuple{Any, Any}

Compute the flux across a single inner face. For CAIDVM, both macro and micro fluxes are computed.

source

KitAMR.calc_domain_fluxMethod
calc_domain_flux(
    _::Type{CAIDVM},
    here_vs::FaceVsData,
    face::DomainFace{DIM, NDF, Maxwellian},
    ka::KA
) -> Tuple{Any, Any}
source
KitAMR.calc_domain_fluxMethod
calc_domain_flux(
    _::Type{CAIDVM},
    here_vs::FaceVsData,
    face::DomainFace{DIM, NDF, SuperSonicInflow},
    ka::KA
) -> Tuple{Any, Any}
source
KitAMR.calc_domain_fluxMethod
calc_domain_flux(
    _::Type{CAIDVM},
    here_vs::FaceVsData,
    face::DomainFace{DIM, NDF, UniformOutflow},
    ka::KA
) -> Tuple{Any, Any}
source
KitAMR.calc_domain_fluxMethod
calc_domain_flux(
    _::Type{CAIDVM},
    here_vs::FaceVsData,
    face::DomainFace{2, NDF, InterpolatedOutflow},
    ka::KA
) -> Tuple{Any, Any}
source

Compute the flux across a single domain face. Methods for different types AbstractBoundCond of Domain are defined.


A positivity preserving reconstruction is adopted when compute CAIDVM flux: