Initial and boundary conditions

To launch a simulation, initial and boundary conditions are necessary.

Initial conditions

The types of initial conditions are abstracted as

Currently, available options are

KitAMR.UniformType
struct Uniform <: AbstractInitCond

Uniform initial condition. The field will be initialized with the Maxwellian distribution determined by the unified primary macroscopic variables in ic.

Fields

  • ic::AbstractVector
source
KitAMR.PCoordFnType
struct PCoordFn <: AbstractInitCond

Physical-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
source

Boundary conditions

The type of the boundary conditions is determined by

Currently, available options are

KitAMR.MaxwellianType
abstract type Maxwellian <: AbstractBoundCond

Fully diffused Maxwellian gas-surface interaction model.

source

With these types of boundary conditions,

can 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.DomainType
struct Domain{T<:AbstractBoundCond} <: AbstractBoundary

Structure of domain boundary.

Fields

  • id::Int64: Index of the domain boundary. From 1 to 6, it represents the boundary of xmin, xmax, ymin, ymax, zmin, zmax.

  • refine::Bool: Whether refine at the domain boundary. Default is false.

  • bc::Union{Function, Vector}: The boundary condition at the domain boundary.

source

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.CircleType
struct Circle{T<:AbstractBoundCond} <: AbstractBoundary
  • center::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.

source
KitAMR.SphereType
struct Sphere{T<:AbstractBoundCond} <: AbstractBoundary
  • center::Vector

  • radius::Real

  • solid::Bool

  • search_coeffi::Real

  • bc::Union{Function, Vector}

  • search_radius::Real

source

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.VerticesType
struct Vertices{DIM, T<:AbstractBoundCond} <: AbstractBoundary
  • vertices::Vector{Vector{Float64}}: Vertices of the boundary, sorted in clockwise or counterclockwise order.

  • solid::Bool

  • bc::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.

source

The most common constructor is

KitAMR.VerticesMethod
Vertices(
    _::Type{T<:AbstractBoundCond},
    file::String,
    solid,
    refine_coeffi,
    bc
) -> Vertices
  • file is the path to the .csv file.
source
KitAMR.TrianglesType
struct Triangles{T<:AbstractBoundCond} <: AbstractBoundary
  • solid::Bool

  • bc::Union{Function, Vector}

  • search_radius::Real

  • tkdt::TriangleKDT

source

The most common constructor is

KitAMR.TrianglesMethod
Triangles(
    _::Type{T<:AbstractBoundCond},
    file::String,
    solid,
    search_radius,
    bc
) -> Triangles
  • file is the path to the .stl file.
source

TriangleKDT is a struct containing information related to K-D tree for efficient mesh generation:

KitAMR.TriangleKDTType
struct TriangleKDT
  • kdt::NearestNeighbors.KDTree

  • mesh::GeometryBasics.Mesh

  • table::Vector{NearestNeighbors.HyperRectangle{StaticArraysCore.SVector{3, Float64}}}

  • triangle_recs::Vector{NearestNeighbors.HyperRectangle{StaticArraysCore.SVector{3, Float64}}}

  • triangle_edges::Vector{Vector{StaticArraysCore.SVector{3, Float64}}}

source