Filters a quantity to the Eulerian grid.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(particle_set), | intent(inout) | :: | this |
Set of Lagrangian objects |
||
| character(len=*), | intent(in) | :: | var |
Variable to compute |
||
| type(eulerian_obj_r), | intent(inout) | :: | field |
Filtered quantity |
impure subroutine particle_set_Filter(this,var,field) !> Filters a quantity to the Eulerian grid. implicit none class(particle_set), intent(inout) :: this !! Set of Lagrangian objects character(len=*), intent(in) :: var !! Variable to compute type(eulerian_obj_r), intent(inout) :: field !! Filtered quantity ! Work variables real(wp),allocatable :: bump(:,:,:) real(wp):: coef integer :: slo(3),shi(3) integer :: n,i,j,k real(wp),parameter :: Pi=4.0_wp*atan(1.0_wp) ! Initialize field field%cell=0.0_wp select type(particles=>this%p) class is (particle_obj) select case(trim(adjustl(var))) case ('volume fraction') do n=1,this%count_ ! Get a bump function centered ! on the marker ! -------------------------- ! slo=particles(n)%c-this%stib/2 shi=particles(n)%c+this%stib/2 call particles(n)%extrapolate(this%l_filter,slo,shi,this%block,this%g1ex,bump) ! Scale the bump function ! -------------------------- ! do k=slo(3),shi(3) do j=slo(2),shi(2) do i=slo(1),shi(1) coef=Pi*particles(n)%d**3/6.0_wp field%cell(i,j,k) = field%cell(i,j,k)+ coef*bump(i,j,k) end do end do end do end do case ('V1') do n=1,this%count_ ! Get a bump function centered ! on the marker ! -------------------------- ! slo=particles(n)%c-this%stib/2 shi=particles(n)%c+this%stib/2 call particles(n)%extrapolate(this%l_filter,slo,shi,this%block,this%g1ex,bump) ! Scale the bump function ! -------------------------- ! do k=slo(3),shi(3) do j=slo(2),shi(2) do i=slo(1),shi(1) coef=Pi*particles(n)%d**3/6.0_wp*particles(n)%v(1) field%cell(i,j,k) = field%cell(i,j,k)+ coef*bump(i,j,k) end do end do end do end do case ('V2') do n=1,this%count_ ! Get a bump function centered ! on the marker ! -------------------------- ! slo=particles(n)%c-this%stib/2 shi=particles(n)%c+this%stib/2 call particles(n)%extrapolate(this%l_filter,slo,shi,this%block,this%g1ex,bump) ! Scale the bump function ! -------------------------- ! do k=slo(3),shi(3) do j=slo(2),shi(2) do i=slo(1),shi(1) coef=Pi*particles(n)%d**3/6.0_wp*particles(n)%v(2) field%cell(i,j,k) = field%cell(i,j,k)+ coef*bump(i,j,k) end do end do end do end do case ('V3') do n=1,this%count_ ! Get a bump function centered ! on the marker ! -------------------------- ! slo=particles(n)%c-this%stib/2 shi=particles(n)%c+this%stib/2 call particles(n)%extrapolate(this%l_filter,slo,shi,this%block,this%g1ex,bump) ! Scale the bump function ! -------------------------- ! do k=slo(3),shi(3) do j=slo(2),shi(2) do i=slo(1),shi(1) coef=Pi*particles(n)%d**3/6.0_wp*particles(n)%v(3) field%cell(i,j,k) = field%cell(i,j,k)+ coef*bump(i,j,k) end do end do end do end do case default call this%parallel%Stop("Unkown quantity to filter") end select end select ! Free memory if (allocated(bump)) deallocate(bump) ! Update ghostcells call field%AddUpGhostCells return end subroutine particle_set_Filter