Builds and writes point particles.
subroutine SetUpCasePP() use particles_point !> Builds and writes point particles. implicit none ! Work variables type(particle_set) :: PP character(str64) :: filename character(str64) :: part_type real(wp) :: L(3) integer :: Np real(wp) :: dp real(wp) :: VFP real(wp) :: Vmag real(wp) :: Vp real(wp) :: Lp real(wp) :: rhop real(wp) :: rand(3) integer :: i,j,k,n integer :: iimax,jjmax,kkmax real(wp),parameter :: Pi=4.0_wp*atan(1.0_wp) ! Get info from parser call parser%Get("PP IC file", filename) call parser%Get("Particle vol. frac.", VFP ) call parser%Get("Particle diameter", dp ) call parser%Get("Particle density", rhop ) call parser%Get("Particle velocity", Vmag ) call parser%Get("Particle type", part_type, default = 'default') ! Initialize point particle data data call PP%Initialize('PP',block,parallel) call PP%ChangePartType(part_type) if (parallel%RankIsRoot()) then L = block%pmax - block%pmin ! Particle volume Vp = Pi/6.0_wp*dp**3 ! Particle spacing LP = (VP/VFP)**(1.0_wp/3.0_wp) ! Particle lattice iimax = floor( L(1)/Lp) jjmax = floor( L(2)/Lp) kkmax = floor( L(3)/Lp) Np = iimax*jjmax*kkmax ! Activate Np particles call PP%Resize(Np) ! Place particles in head-on collisions select type (particle => PP%p) class is (particle_obj) do k=1,kkmax do j=1,jjmax do i=1,iimax n = i + (j-1)*iimax + (k-1)*jjmax*iimax ! Particle global ID particle(n)%id = int(n, kind=8) ! Particle diameter particle(n)%d = dp ! Particle position particle(n)%p(1) = block%pmin(1) + real(i-0.5_wp,wp)*L(1)/real(iimax,wp) particle(n)%p(2) = block%pmin(2) + real(j-0.5_wp,wp)*L(2)/real(jjmax,wp) particle(n)%p(3) = block%pmin(3) + real(k-0.5_wp,wp)*L(3)/real(kkmax,wp) ! Particle velocity call random_number(rand) particle(n)%v = Vmag*(rand-0.5_wp) ! Particle density particle(n)%rho= rhop ! Force and Torque on particle particle(n)%Fh = 0.0_wp particle(n)%Th = 0.0_wp particle(n)%Fc = 0.0_wp particle(n)%Tc = 0.0_wp end do end do end do end select end if ! Apply periodicity call PP%ApplyPeriodicity() ! Write data to disk call PP%SetWriteFileName(filename) call PP%Write(0,0.0_wp) ! Clear data call PP%Finalize() return end subroutine SetUpCasePP