Flux
Numerical fluxes in KitAMR.jl are abstracted as
KitAMR.AbstractFluxType — Type
abstract type AbstractFluxTypeTo distinguish with Navier-Stokes and other types of fluxes (which may be implemented in future version), the fluxes corresponding to DVM are abstracted to
KitAMR.AbstractDVMFluxType — Type
abstract type AbstractDVMFluxType <: AbstractFluxTypeCurrently, the best supported flux is
KitAMR.CAIDVM — Type
abstract type CAIDVM <: AbstractDVMFluxTypeConserved adaptive implicit DVM flux.
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.
KitAMR.flux! — Method
flux!(face::DomainFace, ka::KA)
KitAMR.flux! — Method
flux!(face::FullFace, ka::KA)
KitAMR.flux! — Method
flux!(face::HangingFace{DIM, NDF}, ka::KA)
KitAMR.flux! — Method
flux!(face::BackHangingFace{DIM, NDF}, ka::KA)
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}
)
update_flux!(
_::Nothing,
micro_flux::Vector{Matrix{Float64}},
face::Union{FluxData, FullFace},
heavi::Vector{Bool}
)
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}
)
update_domain_flux!(
_::Nothing,
micro_flux::Vector{Matrix{Float64}},
face::DomainFace,
heavi::Vector{Bool}
)
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}
)
update_micro_flux!(
here_micro,
there_micro,
here_data::PsData{DIM, NDF},
there_data::PsData,
heavi::Vector{Bool}
)
update_micro_flux!(
here_micro,
there_micro,
here_data::PsData{DIM, NDF},
there_data::KitAMR.AbstractGhostPsData,
heavi::Vector{Bool}
)
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
)
update_macro_flux!(
flux::Vector,
here_data::PsData,
_::KitAMR.AbstractGhostPsData
)
update_macro_flux!(
flux::Vector,
here_data::PsData,
_::SolidNeighbor
)
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_vs — Function
make_face_vs(face::DomainFace{DIM, NDF}) -> FaceVsData
make_face_vs(
face::FullFace{DIM, NDF}
) -> Tuple{FaceVsData, FaceVsData}
make_face_vs(
face::HangingFace{DIM, NDF}
) -> Tuple{FaceVsData, Array{FaceVsData{_A, _B}, 1} where {_A, _B}}
make_face_vs(
face::BackHangingFace{DIM, NDF}
) -> Tuple{Array{FaceVsData{_A, _B}, 1} where {_A, _B}, FaceVsData}
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_flux — Method
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.
KitAMR.calc_domain_flux — Method
calc_domain_flux(
_::Type{CAIDVM},
here_vs::FaceVsData,
face::DomainFace{DIM, NDF, Maxwellian},
ka::KA
) -> Tuple{Any, Any}
KitAMR.calc_domain_flux — Method
calc_domain_flux(
_::Type{CAIDVM},
here_vs::FaceVsData,
face::DomainFace{DIM, NDF, SuperSonicInflow},
ka::KA
) -> Tuple{Any, Any}
KitAMR.calc_domain_flux — Method
calc_domain_flux(
_::Type{CAIDVM},
here_vs::FaceVsData,
face::DomainFace{DIM, NDF, UniformOutflow},
ka::KA
) -> Tuple{Any, Any}
KitAMR.calc_domain_flux — Method
calc_domain_flux(
_::Type{CAIDVM},
here_vs::FaceVsData,
face::DomainFace{2, NDF, InterpolatedOutflow},
ka::KA
) -> Tuple{Any, Any}
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:
KitAMR.positivity_preserving_reconstruct — Function
positivity_preserving_reconstruct(
here_df,
here_sdf,
here_ds,
dx,
vn
) -> Any
Positivity preserving reconstruction (10.1016/j.jcp.2009.12.030).