Advances markers to next timestep
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ResPart_set), | intent(inout) | :: | this |
Collection of Resolved Particles |
||
| real(kind=wp), | intent(in) | :: | dt |
Timestep |
pure subroutine ResPart_set_AdvanceMarkers(this,dt) !> Advances markers to next timestep class(ResPart_set), intent(inout) :: this !! Collection of Resolved Particles real(wp), intent(in) :: dt !! Timestep ! Work variables integer :: n,m integer(leapI8):: id real(wp) :: rot_rate real(wp) :: angle real(wp) :: axis(3) real(wp) :: disp_old(3) real(wp) :: a1,a2,a3 select type (particle =>this%p) type is (ResPart_obj) select type(markers=>this%ib%p) type is (marker_obj) do m=1,this%ib%count_ ! Get ID of parent centroid id=markers(m)%s ! Get local index of the centroid n = this%lookup(id) ! prepare rotation coefficients rot_rate = norm2(particle(n)%w) axis = particle(n)%w/(rot_rate+epsilon(1.0_wp)) angle = dt*rot_rate a1 = cos(angle) a2 = sin(angle) a3 = (1.0_wp-cos(angle)) ! Old displacement disp_old = markers(m)%disp ! New rotated displacement markers(m)%disp = a1*disp_old & + a2*cross_product(axis,disp_old) & + a3*dot_product(disp_old,axis)*axis ! Update position and velocity markers(m)%p = particle(n)%p + markers(m)%disp markers(m)%v = particle(n)%v + cross_product(particle(n)%w,markers(m)%disp) ! Update normals markers(m)%n = markers(m)%disp/norm2(markers(m)%disp) end do end select end select return end subroutine ResPart_set_AdvanceMarkers