Builds and writes resolved particles.
subroutine SetUpCaseRP() !> Builds and writes resolved particles. use particles_resolved implicit none ! Work variables type(ResPart_set) :: RP !! Resolved particles real(wp) :: diam real(wp) :: rhop(2) real(wp) :: dl real(wp) :: center(3,2) real(wp) :: velp(3,2) character(str64) :: filename integer :: n select case (CASE_ID) case (CASE_NORMAL_WALL,CASE_NORMAL_IB,CASE_CHANNEL_WALL,CASE_CHANNEL_IB) call parser%Get('RP IC file', filename ) call parser%Get("Particle diameter", diam ) call parser%Get("Particle density", rhop(1) ) call parser%Get("Particle center", center(:,1) ) call parser%Get("Particle velocity", velp(:,1), & default = [0.0_wp,0.0_wp,0.0_wp]) RP%count = 1 case (CASE_NORMAL_PAIR) call parser%Get('RP IC file', filename ) call parser%Get("Particle diameter", diam ) call parser%Get("Particle 1 density", rhop(1) ) call parser%Get("Particle 2 density", rhop(2) ) call parser%Get("Particle 1 center", center(:,1) ) call parser%Get("Particle 2 center", center(:,2) ) call parser%Get("Particle 1 velocity", velp(:,1), & default = [0.0_wp,0.0_wp,0.0_wp]) call parser%Get("Particle 2 velocity", velp(:,2), & default = [0.0_wp,0.0_wp,0.0_wp]) RP%count = 2 end select ! Initialze resolved particles call RP%Initialize('ResPart',block,parallel) ! Seed particles on root if (parallel%RankIsRoot()) then ! Activate particle call RP%Resize(RP%count) 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 ! Position particle(n)%p = center(:,n) ! Velocity particle(n)%v = velp(:,n) ! Angular velocity particle(n)%w = 0.0_wp ! Density particle(n)%rho = rhop(n) ! 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