Builds and writes immersed boundary.
subroutine SetUpCaseIB !> Builds and writes immersed boundary. use immersed_boundaries implicit none type(marker_set) :: IB character(str64) :: filename real(wp) :: diam real(wp) :: xc(3) real(wp) :: d_axis integer :: n_axis real(wp) :: d_theta integer :: n_theta integer :: i,j,m real(wp), parameter :: Pi=4.0*atan(1.0_wp) ! Get info from parser call parser%Get("IB IC file", filename) call parser%Get("Cylinder diameter", diam ) call parser%Get("Cylinder center", xc ) ! Initialize Immersed Boundaries call IB%Initialize('IB',block,parallel) ! Create a cylinder if (parallel%RankIsRoot()) then ! Count the number of markers d_axis = 0.5_wp*block%dx(3) n_axis = max(1,floor((block%pmax(3)-block%pmin(3))/d_axis)) d_axis = (block%pmax(3)-block%pmin(3))/real(n_axis,wp) n_theta=ceiling(Pi*diam/d_axis) d_theta=2.0_wp*Pi/real(n_theta,wp) ! Create markers call IB%Resize(n_theta*n_axis) select type (markers=>IB%p) type is (marker_obj) do i=1,n_theta do j=1,n_axis ! ID m = n_axis*(i-1)+j markers(m)%id = int(m,kind=8) ! Position markers(m)%p(1)= xc(1)+0.5_wp*diam*cos((i-1)*d_theta + d_theta/2.0_wp) markers(m)%p(2)= xc(2)+0.5_wp*diam*sin((i-1)*d_theta + d_theta/2.0_wp) markers(m)%p(3)= xc(3)+(j-1)*d_axis + d_axis/2.0_wp + block%pmin(3) ! Surface Area markers(m)%SA = 0.5_wp*diam*d_theta*d_axis ! Normal markers(m)%n(1)= cos((i-1)*d_theta + d_theta/2.0_wp) markers(m)%n(2)= sin((i-1)*d_theta + d_theta/2.0_wp) markers(m)%n(3)= 0.0_wp ! velocity markers(m)%v = 0.0_wp end do end do end select 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