Builds and writes immersed boundary.
subroutine SetUpCaseIB !> Builds and writes immersed boundary. use immersed_boundaries implicit none type(marker_set) :: IB character(str64) :: filename character(len=3) :: normal real(wp) :: xc(3) real(wp) :: xc_default(3) real(wp) :: width(3) real(wp) :: dl ! Default position (if not supplied by user in input file) xc_default = [ 0.5_wp*(block%pmin(1)+block%pmax(1)), & block%pmin(2)+4.0_wp*block%dx(2), & 0.5_wp*(block%pmin(3)+block%pmax(3)) ] ! Get info from parser call parser%Get("IB IC file", filename ) call parser%Get("IB position", xc, default = xc_default) call parser%Get("IB normal", normal, default = "+x2" ) ! Initialize Immersed Boundaries call IB%Initialize('IB',block,parallel) ! IB resolution dl=0.5_wp*minval(block%dx) ! Determine plane width to cover domain from end to end width = block%pmax-block%pmin select case (trim(adjustl(normal))) case ("+x1", "-x1") width(1) = 0.0_wp case ("+x2", "-x2") width(2) = 0.0_wp case ("+x3", "-x3") width(3) = 0.0_wp case default call parallel%Stop("Invalid plane normal") end select if (parallel%RankIsRoot()) then ! Add plane call IB%AddPlane(xc,normal,width,[0.0_wp,0.0_wp,0.0_wp],dl) end if ! Treatment for periodicity call IB%ApplyPeriodicity() ! Send to the right rank call IB%Communicate() ! Localize marker points call IB%Localize() ! Write data to disk call IB%SetWriteFileName(filename) call IB%Write(0,0.0_WP) ! Finalize call IB%Finalize() return end subroutine SetUpCaseIB