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

Commit

Permalink
Improved the positioning of hit and run fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Feb 10, 2023
1 parent 6fb2626 commit ae92f15
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/fraggle/fraggle_generate.f90
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ module subroutine fraggle_generate_pos_vec(collider, nbody_system, param, lfailu
real(DP), dimension(collider%fragments%nbody) :: mass_rscale, phi, theta, u
integer(I4B) :: i, j, loop, istart
logical :: lsupercat, lhitandrun
integer(I4B), parameter :: MAXLOOP = 100
integer(I4B), parameter :: MAXLOOP = 1000
real(DP), parameter :: rdistance_scale_factor = 1.0_DP ! Scale factor to apply to distance scaling of cloud centers in the event of overlap
! The distance is chosen to be close to the original locations of the impactors
! but far enough apart to prevent a collisional cascade between fragments
Expand Down Expand Up @@ -404,6 +404,9 @@ module subroutine fraggle_generate_pos_vec(collider, nbody_system, param, lfailu

! Shift to the cloud center coordinates
fragments%rc(:,i) = fragments%rc(:,i) + fragment_cloud_center(:,j)
if (lhitandrun) then ! Stretch out the hit and run cloud along the flight trajectory
fragments%rc(:,i) = fragments%rc(:,i) + cloud_size_scale_factor * rdistance * fragments%rmag(i) * impactors%bounce_unit(:)
end if

! Make sure that the fragments are positioned away from the impact point
direction = dot_product(fragments%rc(:,i) - impactors%rcimp(:), fragment_cloud_center(:,j) - impactors%rcimp(:))
Expand Down

0 comments on commit ae92f15

Please sign in to comment.