diff --git a/examples/Fragmentation/Fragmentation_Movie.py b/examples/Fragmentation/Fragmentation_Movie.py index 90199fd4b..054d90b21 100755 --- a/examples/Fragmentation/Fragmentation_Movie.py +++ b/examples/Fragmentation/Fragmentation_Movie.py @@ -61,11 +61,11 @@ vel_vectors = {"disruption_headon" : [np.array([ 0.00, 6.280005, 0.0]), np.array([ 0.00, -6.280005, 0.0])], "disruption_off_axis" : [np.array([ 0.00, 6.280005, 0.0]), - np.array([ 0.50, -6.280005, 0.0])], + np.array([ 0.05, 4.28, 0.0])], "supercatastrophic_headon": [np.array([ 0.00, 6.28, 0.0]), np.array([ 0.00, -6.28, 0.0])], "supercatastrophic_off_axis": [np.array([ 0.00, 6.28, 0.0]), - np.array([ 0.50, -6.28, 0.0])], + np.array([ 0.05, 5.28, 0.0])], "hitandrun_disrupt" : [np.array([ 0.00, 6.28, 0.0]), np.array([-1.45, -6.28, 0.0])], "hitandrun_pure" : [np.array([ 0.00, 6.28, 0.0]), @@ -76,12 +76,12 @@ rot_vectors = {"disruption_headon" : [np.array([0.0, 0.0, 0.0]), np.array([0.0, 0.0, 0.0])], - "disruption_off_axis": [np.array([0.0, 0.0, -6.0e3]), - np.array([0.0, 0.0, 1.0e4])], + "disruption_off_axis": [np.array([0.0, 0.0, 0.0]), + np.array([0.0, 0.0, 0.0])], "supercatastrophic_headon": [np.array([0.0, 0.0, 0.0]), np.array([0.0, 0.0, 0.0])], - "supercatastrophic_off_axis": [np.array([0.0, 0.0, -6.0e3]), - np.array([0.0, 0.0, 1.0e4])], + "supercatastrophic_off_axis": [np.array([0.0, 0.0, 0.0]), + np.array([0.0, 0.0, 0.0])], "hitandrun_disrupt" : [np.array([0.0, 0.0, 6.0e3]), np.array([0.0, 0.0, 1.0e4])], "hitandrun_pure" : [np.array([0.0, 0.0, 6.0e3]), @@ -100,9 +100,9 @@ } tstop = {"disruption_headon" : 5.0e-4, - "disruption_off_axis" : 5.0e-4, + "disruption_off_axis" : 2.0e-3, "supercatastrophic_headon" : 5.0e-4, - "supercatastrophic_off_axis": 5.0e-4, + "supercatastrophic_off_axis": 2.0e-3, "hitandrun_disrupt" : 2.0e-4, "hitandrun_pure" : 2.0e-4, "merge" : 2.0e-3, diff --git a/src/collision/collision_generate.f90 b/src/collision/collision_generate.f90 index a7ef92363..b3ef6303e 100644 --- a/src/collision/collision_generate.f90 +++ b/src/collision/collision_generate.f90 @@ -46,7 +46,7 @@ module subroutine collision_generate_bounce(self, nbody_system, param, t) real(DP), intent(in) :: t !! The time of the collision ! Internals integer(I4B) :: i,j,nimp - real(DP), dimension(NDIM) :: vcom, rnorm + real(DP), dimension(NDIM) :: rcom, vcom, rnorm logical, dimension(:), allocatable :: lmask select type(nbody_system) @@ -70,10 +70,13 @@ module subroutine collision_generate_bounce(self, nbody_system, param, t) nimp = size(impactors%id(:)) do i = 1, nimp j = impactors%id(i) + rcom(:) = pl%rb(:,j) - impactors%rbcom(:) vcom(:) = pl%vb(:,j) - impactors%vbcom(:) - rnorm(:) = .unit. (impactors%rb(:,2) - impactors%rb(:,1)) + rnorm(:) = .unit. rcom(:) ! Do the reflection vcom(:) = vcom(:) - 2 * dot_product(vcom(:),rnorm(:)) * rnorm(:) + ! Shift the positions so that the collision doesn't immediately occur again + pl%rb(:,j) = pl%rb(:,j) + 0.5_DP * pl%radius(j) * rnorm(:) pl%vb(:,j) = impactors%vbcom(:) + vcom(:) self%status = DISRUPTED pl%status(j) = ACTIVE diff --git a/src/fraggle/fraggle_generate.f90 b/src/fraggle/fraggle_generate.f90 index fd8f79014..b562e0952 100644 --- a/src/fraggle/fraggle_generate.f90 +++ b/src/fraggle/fraggle_generate.f90 @@ -26,7 +26,7 @@ module subroutine fraggle_generate(self, nbody_system, param, t) real(DP), intent(in) :: t !! Time of collision ! Internals integer(I4B) :: i, j, ibiggest, nfrag, nimp - real(DP), dimension(NDIM) :: vcom, rnorm + real(DP), dimension(NDIM) :: rcom, vcom, rnorm character(len=STRMAX) :: message logical :: lfailure @@ -60,16 +60,18 @@ module subroutine fraggle_generate(self, nbody_system, param, t) do i = 1, nimp j = impactors%id(i) vcom(:) = pl%vb(:,j) - impactors%vbcom(:) - rnorm(:) = .unit. (impactors%rb(:,2) - impactors%rb(:,1)) + rcom(:) = pl%rb(:,j) - impactors%rbcom(:) + rnorm(:) = .unit. rcom(:) ! Do the reflection vcom(:) = vcom(:) - 2 * dot_product(vcom(:),rnorm(:)) * rnorm(:) self%fragments%vb(:,i) = impactors%vbcom(:) + vcom(:) - self%fragments%rb(:,i) = pl%rb(:,j) self%fragments%mass(i) = pl%mass(j) self%fragments%Gmass(i) = pl%Gmass(j) self%fragments%radius(i) = pl%radius(j) self%fragments%rot(:,i) = pl%rot(:,j) self%fragments%Ip(:,i) = pl%Ip(:,j) + ! Ensure that the bounce doesn't happen again + self%fragments%rb(:,i) = pl%rb(:,j) + 0.5_DP * self%fragments%radius(i) * rnorm(:) end do end if @@ -302,7 +304,7 @@ module subroutine fraggle_generate_pos_vec(collider) else if (lsupercat) then rdistance = 0.5_DP * sum(impactors%radius(:)) else - rdistance = 10 * impactors%radius(2) + rdistance = 2 * impactors%radius(2) end if ! Give the fragment positions a random value that is scaled with fragment mass so that the more massive bodies tend to be closer to the impact point ! Later, velocities will be scaled such that the farther away a fragment is placed from the impact point, the higher will its velocity be.