Builds and writes resolved particles.
subroutine SetUpCaseRP() !> Builds and writes resolved particles. use particles_resolved implicit none ! Work variables type(ResPart_set) :: RP character(str64) :: filename real(wp) :: diam real(wp) :: rhop real(wp) :: dl integer :: n call parser%Get('RP IC file', filename ) call parser%Get("Particle diameter", diam ) call parser%Get("Particle density", rhop ) ! Initialze resolved particles call RP%Initialize('ResPart',block,parallel) if (parallel%RankIsRoot()) then ! Activate only 1 particle on this Rank call RP%Resize(2) ! IB resolution dl=0.5_wp*minval(block%dx) select type(particle => RP%p) type is (ResPart_obj) do n=1,RP%count_ ! Particle globabl ID particle(n)%id = int(n,kind=8) ! Diameter particle(n)%d = diam select case (n) case (1) ! Particle position particle(n)%p(1) = 0.5_wp*(block%pmin(1) + block%pmax(1)) - particle(n)%d particle(n)%p(2) = 0.5_wp*(block%pmin(2) + block%pmax(2)) particle(n)%p(3) = 0.5_wp*(block%pmin(3) + block%pmax(3)) ! Particle velocity particle(n)%v = [ 1.0_wp, 0.0_wp, 0.0_wp] case (2) ! Particle position particle(n)%p(1) = 0.5_wp*(block%pmin(1) + block%pmax(1)) + particle(n)%d particle(n)%p(2) = 0.5_wp*(block%pmin(2) + block%pmax(2)) particle(n)%p(3) = 0.5_wp*(block%pmin(3) + block%pmax(3)) ! Particle velocity particle(n)%v = [-1.0_wp, 0.0_wp, 0.0_wp] end select ! Angular velocity particle(n)%w = 0.0_wp ! Density particle(n)%rho = rhop ! Zero force and torque particle(n)%Fh = 0.0_wp particle(n)%Th = 0.0_wp particle(n)%Fc = 0.0_wp particle(n)%Tc = 0.0_wp ! Add surface markers call RP%ib%AddSphere(particle(n)%p,particle(n)%d/2.0_wp,particle(n)%v,dl,particle(n)%id) end do end select end if ! Treatment for periodicity call RP%ApplyPeriodicity call RP%ib%ApplyPeriodicity ! Send to the right rank call RP%Communicate call RP%ib%Communicate ! Localize centers and markers on grid call RP%Localize call RP%ib%Localize ! Write data to disk call RP%SetWriteFileName(filename) call RP%Write(0,0.0_WP) ! Finalize call RP%Finalize end subroutine SetUpCaseRP