Reconstruction

Slope

In current version, the distribution function is reconstructed as a linear function. Besides the function value at center of the cell, the slope is also required. The slope is obtained by finite difference. To eliminate the oscillation near discontinuities, the vanLeer limiter is adopted.


The finite difference is not that simple considering cells in templates may exhibit different refinement level, in both physical and velocity space. Here we list related methods. For more detailed explanation, one may refer to our future paper.

KitAMR.diff_vs!Function
diff_vs!(
    vs_data::AbstractVsData{DIM, NDF},
    vs_data_n::AbstractVsData{DIM, NDF},
    dsL::Float64,
    sL::AbstractMatrix
)

Difference through all velocity cells in two neighboring physical cells.

source

Outer function to update sdf in VsData and sw in PsData.


Here are methods corresponding to different cases in physical space. The first two argument types refer to the number of the neighboring cells in negative and positive direction along the dirth dimension. Val{i} refers to there are i neighboring cells across the face. -1 represents a single cell with lower refinement level. Because the mesh is balanced, only following cases are required to consider.

KitAMR.update_slope!Method
update_slope!(
    _::Val{0},
    _::Val{1},
    ps_data::PsData,
    kinfo::KInfo{DIM, NDF},
    Ldata::AbstractVector,
    Rdata::AbstractVector,
    dir::Integer
)
source
KitAMR.update_slope!Method
update_slope!(
    _::Val{1},
    _::Val{0},
    ps_data::PsData,
    kinfo::KInfo{DIM, NDF},
    Ldata::AbstractVector,
    Rdata::AbstractVector,
    dir::Integer
)
source
KitAMR.update_slope!Method
update_slope!(
    _::Val{0},
    _::Val{-1},
    ps_data::PsData,
    kinfo::KInfo{DIM, NDF},
    Ldata::AbstractVector,
    Rdata::AbstractVector,
    dir::Integer
)
source
KitAMR.update_slope!Method
update_slope!(
    _::Val{-1},
    _::Val{0},
    ps_data::PsData,
    kinfo::KInfo{DIM, NDF},
    Ldata::AbstractVector,
    Rdata::AbstractVector,
    dir::Integer
)
source
KitAMR.update_slope!Method
update_slope!(
    _::Val{0},
    _::Union{Val{2}, Val{4}},
    ps_data::PsData,
    kinfo::KInfo{DIM, NDF},
    Ldata::AbstractVector,
    Rdata::AbstractVector,
    dir::Integer
)
source
KitAMR.update_slope!Method
update_slope!(
    _::Union{Val{2}, Val{4}},
    _::Val{0},
    ps_data::PsData,
    kinfo::KInfo{DIM, NDF},
    Ldata::AbstractVector,
    Rdata::AbstractVector,
    dir::Integer
)
source

Update both micro and macro slopes in cells neighboring to domain edges.


KitAMR.update_slope!Method
update_slope!(
    _::Val{1},
    _::Val{1},
    ps_data::PsData,
    kinfo::KInfo{DIM, NDF},
    Ldata::AbstractVector,
    Rdata::AbstractVector,
    dir::Integer
)
source
KitAMR.update_slope!Method
update_slope!(
    _::Val{1},
    _::Val{-1},
    ps_data::PsData,
    kinfo::KInfo{DIM, NDF},
    Ldata::AbstractVector,
    Rdata::AbstractVector,
    dir::Integer
)
source
KitAMR.update_slope!Method
update_slope!(
    _::Val{-1},
    _::Val{1},
    ps_data::PsData,
    kinfo::KInfo{DIM, NDF},
    Ldata::AbstractVector,
    Rdata::AbstractVector,
    dir::Integer
)
source
KitAMR.update_slope!Method
update_slope!(
    _::Val{1},
    _::Union{Val{2}, Val{4}},
    ps_data::PsData,
    kinfo::KInfo{DIM, NDF},
    Ldata::AbstractVector,
    Rdata::AbstractVector,
    dir::Integer
)
source
KitAMR.update_slope!Method
update_slope!(
    _::Union{Val{2}, Val{4}},
    _::Val{1},
    ps_data::PsData,
    kinfo::KInfo{DIM, NDF},
    Ldata::AbstractVector,
    Rdata::AbstractVector,
    dir::Integer
)
source
KitAMR.update_slope!Method
update_slope!(
    _::Val{-1},
    _::Union{Val{2}, Val{4}},
    ps_data::PsData,
    kinfo::KInfo{DIM, NDF},
    Ldata::AbstractVector,
    Rdata::AbstractVector,
    dir::Integer
)
source
KitAMR.update_slope!Method
update_slope!(
    _::Union{Val{2}, Val{4}},
    _::Val{-1},
    ps_data::PsData,
    kinfo::KInfo{DIM, NDF},
    Ldata::AbstractVector,
    Rdata::AbstractVector,
    dir::Integer
)
source
KitAMR.update_slope!Method
update_slope!(
    _::Union{Val{2}, Val{4}},
    _::Union{Val{2}, Val{4}},
    ps_data::PsData,
    kinfo::KInfo{DIM, NDF},
    Ldata::AbstractVector,
    Rdata::AbstractVector,
    dir::Integer
)
source
KitAMR.update_slope!Method
update_slope!(
    _::Val{-1},
    _::Val{-1},
    ps_data::PsData,
    kinfo::KInfo{DIM, NDF},
    Ldata::AbstractVector,
    Rdata::AbstractVector,
    dir::Integer
)
source

Update both micro and macro in internal cells.


KitAMR.update_slope_inner_vs!Function
update_slope_inner_vs!(
    vs_data::AbstractVsData{DIM, NDF},
    Ldata::Vector,
    Rdata::Vector,
    dsL::Float64,
    dsR::Float64,
    dir::Int64
)
source

Update micro slope sdf.


KitAMR.update_slope_inner_ps!Function
update_slope_inner_ps!(
    ps_data::PsData{DIM, NDF},
    Ldata::AbstractVector,
    Rdata::AbstractVector,
    dsL::Float64,
    dsR::Float64,
    dir::Int64
)
source

Update macro slope sw. Currently, sw is only used as an indicator for AMR in physical space. Hence, the calculation is carried out without a limiter. On the contrary, the slope with larger absolute value in two sides slopes is adopted for more sufficient refinement.


To preserve the positivity of the distribution function, a positivity-preserving reconstruction strategy is adopted. Detailed information is in Flux.

Immersed boundary method

Boundaries with complex geometry are resolved with immersed boundary method. More specifically, a sharp interface method with ghost cell is adopted. Detailed information can be found in our paper https://doi.org/10.48550/arXiv.2512.20252. KitAMR.jl provided interfaces for the reconstruction of the ghost cells