Builds and writes immersed boundary.
subroutine SetUpCaseIB() !> Builds and writes immersed boundary. use immersed_boundaries implicit none ! Work variables character(str64) :: filename type(marker_set) :: IB !! IB real(wp) :: IBy(2) !! IB plane vertical position real(wp) :: center(3,2) !! IB plane centroid character(len=3) :: normal(2) !! IB plane normal direction real(wp) :: width(3,2) !! IB plane width real(wp) :: vel(3,2) !! IB plane velocity real(wp) :: dl !! IB plane resolution (marker spacing) select case (CASE_ID) case (CASE_NORMAL_IB) call parser%Get('IB IC file', filename ) call parser%Get("IB 1 position", IBy(1) ) case (CASE_CHANNEL_IB) call parser%Get('IB IC file', filename ) call parser%Get("IB 1 position", IBy(1) ) call parser%Get("IB 2 position", IBy(2) ) end select ! Initialze resolved particles call IB%Initialize('IB',block,parallel) ! Root creates planes if (parallel%RankIsRoot()) then ! Plane 1 (bottom) center(:,1) = [ 0.5_wp*(block%pmin(1)+block%pmax(1)), & IBy(1), & 0.5_wp*(block%pmin(3)+block%pmax(3))] normal(1) = '+x2' width(:,1) = [ block%pmax(1)-block%pmin(1), & 0.0_wp, & block%pmax(3)-block%pmin(3) ] vel(:,1) = 0.0_wp dl = 0.5_wp*minval(block%dx) call IB%AddPlane(center(:,1),normal(1),width(:,1),vel(:,1),dl) ! Plane 2 (top) if (CASE_ID.eq.CASE_CHANNEL_IB) then center(:,2) = [ 0.5_wp*(block%pmin(1)+block%pmax(1)), & IBy(2), & 0.5_wp*(block%pmin(3)+block%pmax(3))] normal(2) = '-x2' width(:,2) = [ block%pmax(1)-block%pmin(1), & 0.0_wp, & block%pmax(3)-block%pmin(3) ] vel(:,2) = 0.0_wp dl = 0.5_wp*minval(block%dx) call IB%AddPlane(center(:,2),normal(2),width(:,2),vel(:,2),dl) end if end if ! Treatment for periodicity call IB%ApplyPeriodicity ! Send to the right rank call IB%Communicate ! Localize centers and markers on grid call IB%Localize ! Write data to disk call IB%SetWriteFileName(filename) call IB%Write(0,0.0_WP) ! Finalize call IB%Finalize end subroutine SetUpCaseIB