Initial and boundary conditions
To launch a simulation, initial and boundary conditions are necessary.
Initial conditions
The types of initial conditions are abstracted as
KitAMR.AbstractInitCond — Type
abstract type AbstractInitCondCurrently, available options are
KitAMR.Uniform — Type
struct Uniform <: AbstractInitCondUniform initial condition. The field will be initialized with the Maxwellian distribution determined by the unified primary macroscopic variables in ic.
Fields
ic::AbstractVector
KitAMR.PCoordFn — Type
struct PCoordFn <: AbstractInitCondPhysical-coordinates-determined initial condition. The field will be initialized with the Maxwellian distribution determined by the user-defined-function in PCIC_fn. The function will return primary macroscopic variables vector according to the information of the physical grid (mostly the physical coordinates).
Fields
PCIC_fn::Function
Boundary conditions
The type of the boundary conditions is determined by
KitAMR.AbstractBoundCond — Type
abstract type AbstractBoundCondCurrently, available options are
KitAMR.Maxwellian — Type
abstract type Maxwellian <: AbstractBoundCondFully diffused Maxwellian gas-surface interaction model.
KitAMR.SuperSonicInflow — Type
abstract type SuperSonicInflow <: AbstractBoundCondKitAMR.SuperSonicOutflow — Type
abstract type SuperSonicOutflow <: AbstractBoundCondKitAMR.UniformOutflow — Type
abstract type UniformOutflow <: AbstractBoundCondKitAMR.InterpolatedOutflow — Type
abstract type InterpolatedOutflow <: AbstractBoundCondKitAMR.Period — Type
abstract type Period <: AbstractBoundCondWith these types of boundary conditions,
KitAMR.AbstractBoundary — Type
abstract type AbstractBoundarycan be constructed. There are two types of the boundary.
Domain boundary
KitAMR.jl always adopts square simulation domain. At the edges of the domain, proper conditions are required to maintain the well-posedness.
KitAMR.Domain — Type
struct Domain{T<:AbstractBoundCond} <: AbstractBoundaryStructure of domain boundary.
Fields
id::Int64: Index of the domain boundary. From 1 to 6, it represents the boundary ofxmin,xmax,ymin,ymax,zmin,zmax.refine::Bool: Whether refine at the domain boundary. Default isfalse.bc::Union{Function, Vector}: The boundary condition at the domain boundary.
Immersed boundary
KitAMR.jl adopts the immersed boundary method (IBM) to resolve boundaries with complex geometry. To define the geometry, KitAMR.jl provides following interface.
As the special case, the cirlce in 2D and sphere in 3D are defined separately, and are abstracted as AbstractCircle=Union{Circle,Sphere}.
KitAMR.Circle — Type
struct Circle{T<:AbstractBoundCond} <: AbstractBoundarycenter::Vector: Center of the circle.radius::Real: Radius of the circle.solid::Bool: Is solid inside the circle?search_coeffi::Real: Refinement coefficient.bc::Union{Function, Vector}: Primary macroscopic variables of the solid.search_radius::Real: Maximum distance of the refinement region from the boundary.
KitAMR.Sphere — Type
struct Sphere{T<:AbstractBoundCond} <: AbstractBoundarycenter::Vectorradius::Realsolid::Boolsearch_coeffi::Realbc::Union{Function, Vector}search_radius::Real
For other cases, KitAMR.jl read .csv file for 2D, which defines the vertices coordinates of the closed boundary curve; and .stl file for 3D, which provides the triangular discretization of the boundary surface. The example can be find in /example/airfoil and /example/X38 respectively.
KitAMR.Vertices — Type
struct Vertices{DIM, T<:AbstractBoundCond} <: AbstractBoundaryvertices::Vector{Vector{Float64}}: Vertices of the boundary, sorted in clockwise or counterclockwise order.solid::Boolbc::Union{Function, Vector}box::Vector{Vector{Float64}}: The outer box of the vertices as[[xmin,ymin,zmin],[xmax,ymax,zmax]].search_radius::Real: The number of cell layers refined from the boundary.
The most common constructor is
KitAMR.Vertices — Method
Vertices(
_::Type{T<:AbstractBoundCond},
file::String,
solid,
refine_coeffi,
bc
) -> Vertices
fileis the path to the.csvfile.
KitAMR.Triangles — Type
struct Triangles{T<:AbstractBoundCond} <: AbstractBoundarysolid::Boolbc::Union{Function, Vector}search_radius::Realtkdt::TriangleKDT
The most common constructor is
KitAMR.Triangles — Method
Triangles(
_::Type{T<:AbstractBoundCond},
file::String,
solid,
search_radius,
bc
) -> Triangles
fileis the path to the.stlfile.
TriangleKDT is a struct containing information related to K-D tree for efficient mesh generation:
KitAMR.TriangleKDT — Type
struct TriangleKDTkdt::NearestNeighbors.KDTreemesh::GeometryBasics.Meshtable::Vector{NearestNeighbors.HyperRectangle{StaticArraysCore.SVector{3, Float64}}}triangle_recs::Vector{NearestNeighbors.HyperRectangle{StaticArraysCore.SVector{3, Float64}}}triangle_edges::Vector{Vector{StaticArraysCore.SVector{3, Float64}}}