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

Commit

Permalink
Reduced the velocity dispersion in hit and run with disruption
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Jan 18, 2023
1 parent 34ec164 commit 5b2b16d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/fraggle/fraggle_generate.f90
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ module subroutine fraggle_generate_rot_vec(collider, nbody_system, param)
! Internals
real(DP), dimension(NDIM) :: Lbefore, Lafter, L_spin, rotdir
real(DP) :: v_init, v_final, mass_init, mass_final, rotmag, dKE, KE_init, KE_final
real(DP), parameter :: random_scale_factor = 0.01_DP !! The relative scale factor to apply to the random component of the rotation vector
real(DP), parameter :: random_scale_factor = 0.001_DP !! The relative scale factor to apply to the random component of the rotation vector
integer(I4B) :: i

associate(fragments => collider%fragments, impactors => collider%impactors, nfrag => collider%fragments%nbody)
Expand Down Expand Up @@ -543,14 +543,12 @@ module subroutine fraggle_generate_vel_vec(collider, nbody_system, param, lfailu
j = fragments%origin_body(i)
vrot(:) = impactors%rot(:,j) .cross. (fragments%rc(:,i) - impactors%rc(:,j))
if (lhitandrun) then
if (i == 1) then
fragments%vc(:,1) = impactors%vc(:,1)
if (i ==1) then
fragments%vc(:,i) = impactors%vc(:,1)
else
vmag = .mag.impactors%vc(:,2) / maxval(vscale(:))
fragments%vc(:,i) = vmag * vscale(i) * impactors%bounce_unit(:) * vsign(i) + vrot(:)
fragments%vc(:,i) = impactors%vc(:,2) + vsign(i) * impactors%bounce_unit(:) * (vscale(i) - 0.5_DP *(maxval(vscale(:)) - minval(vscale(:))))
end if
else
! Add more velocity dispersion to disruptions vs hit and runs.
vmag = vesc * vscale(i)
rimp(:) = fragments%rc(:,i) - impactors%rbimp(:)
vimp_unit(:) = .unit. (rimp(:) + vsign(i) * impactors%bounce_unit(:))
Expand Down

0 comments on commit 5b2b16d

Please sign in to comment.