Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Improved disruptive hit and run by removing the velocity dispersion o…
Browse files Browse the repository at this point in the history
…f runner fragments (kept the rotational shear though)
  • Loading branch information
daminton committed Dec 26, 2022
1 parent e9cfe23 commit b190d03
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/collision/collision_generate.f90
Original file line number Diff line number Diff line change
Expand Up @@ -559,15 +559,20 @@ module subroutine collision_generate_simple_vel_vec(collider)

fragments%vc(:,1) = .mag.impactors%vc(:,1) * impactors%bounce_unit(:)
do concurrent(i = 2:nfrag)
rimp(:) = fragments%rc(:,i) - impactors%rbimp(:)
vimp_unit(:) = .unit. rimp(:)

j = fragments%origin_body(i)
vrot(:) = impactors%rot(:,j) .cross. (fragments%rc(:,i) - impactors%rb(:,j) + impactors%rbcom(:))

vmag = .mag.impactors%vc(:,j) * vscale(i)

fragments%vc(:,i) = vmag * 0.5_DP * (impactors%bounce_unit(:) + vimp_unit(:)) * vsign(i) + vrot(:)
if (lhitandrun) then
fragments%vc(:,i) = vmag * 0.5_DP * impactors%bounce_unit(:) * vsign(i) + vrot(:)
else
! Add more velocity dispersion to disruptions vs hit and runs.
rimp(:) = fragments%rc(:,i) - impactors%rbimp(:)
vimp_unit(:) = .unit. rimp(:)
fragments%vc(:,i) = vmag * 0.5_DP * (impactors%bounce_unit(:) + vimp_unit(:)) * vsign(i) + vrot(:)
end if
end do
do concurrent(i = 1:nfrag)
fragments%vb(:,i) = fragments%vc(:,i) + impactors%vbcom(:)
Expand Down

0 comments on commit b190d03

Please sign in to comment.