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

Commit

Permalink
Finally getting hit and runs that are closer to what I imagine they s…
Browse files Browse the repository at this point in the history
…hould be
  • Loading branch information
daminton committed Dec 23, 2022
1 parent 4930ee3 commit 09a508d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/collision/collision_generate.f90
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ module subroutine collision_generate_simple_vel_vec(collider)
logical :: lhr
real(DP), dimension(NDIM) :: vimp_unit, vcom, rnorm
real(DP), dimension(NDIM,collider%fragments%nbody) :: vnoise
real(DP), parameter :: VNOISE_MAG = 0.10_DP
real(DP), parameter :: VNOISE_MAG = 0.50_DP
real(DP) :: vmag

associate(fragments => collider%fragments, impactors => collider%impactors, nfrag => collider%fragments%nbody)
Expand All @@ -528,7 +528,7 @@ module subroutine collision_generate_simple_vel_vec(collider)
vcom(:) = impactors%vb(:,i) - impactors%vbcom(:)
rnorm(:) = impactors%y_unit(:)
! Do the reflection
vcom(:) = vcom(:) - 2 * dot_product(vcom(:),rnorm(:)) * rnorm(:)
if (.not. lhr) vcom(:) = vcom(:) - 2 * dot_product(vcom(:),rnorm(:)) * rnorm(:)
fragments%vc(:,i) = vcom(:)
end do

Expand All @@ -542,11 +542,11 @@ module subroutine collision_generate_simple_vel_vec(collider)
vnoise = (2 * vnoise - 1.0_DP) * vmag
do i = 3, nfrag
vimp_unit(:) = .unit. (fragments%rc(:,i) + impactors%rbcom(:) - impactors%rbimp(:))
fragments%vc(:,i) = vmag * vimp_unit(:) + vnoise(:,i)
fragments%vc(:,i) = vmag * vimp_unit(:) + vnoise(:,i)
if (lhr) fragments%vc(:,i) = fragments%vc(:,i) + fragments%vc(:,2)
end do
do concurrent(i = 1:nfrag)
fragments%vb(:,i) = fragments%vc(:,i) + impactors%vbcom(:)
if (lhr) fragments%vb(:,i) = fragments%vb(:,i) + impactors%vb(:,2)
end do

impactors%vbcom(:) = 0.0_DP
Expand Down

0 comments on commit 09a508d

Please sign in to comment.