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

Commit

Permalink
Fixed issues arising when the mass contrast in fragments gets too big.
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Feb 21, 2023
1 parent d3b9a93 commit 5264393
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/collision/collision_util.f90
Original file line number Diff line number Diff line change
Expand Up @@ -833,8 +833,8 @@ module subroutine collision_util_set_natural_scale_factors(self)

associate(collider => self, fragments => self%fragments, impactors => self%impactors)
! Set primary scale factors (mass, length, and time) based on the impactor properties at the time of collision
collider%mscale = minval(fragments%mass(:))
collider%dscale = minval(fragments%radius(:))
collider%mscale = minval(impactors%mass(:))
collider%dscale = minval(impactors%radius(:))

vesc = sqrt(2 * sum(impactors%Gmass(:)) / sum(impactors%radius(:)))
collider%tscale = collider%dscale / vesc
Expand Down
2 changes: 1 addition & 1 deletion src/fraggle/fraggle_generate.f90
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ module subroutine fraggle_generate_vel_vec(collider, nbody_system, param, lfailu
if (all(dL_metric(:) <= 1.0_DP)) exit angmtm

do i = istart, fragments%nbody
dL(:) = -L_residual(:) / (fragments%nbody - istart + 1)
dL(:) = -L_residual(:) * fragments%mass(i) / sum(fragments%mass(istart:fragments%nbody))
call collision_util_velocity_torque(dL, fragments%mass(i), fragments%rc(:,i), fragments%vc(:,i))
call collision_util_shift_vector_to_origin(fragments%mass, fragments%vc)
fragments%vmag(i) = .mag.fragments%vc(:,i)
Expand Down

0 comments on commit 5264393

Please sign in to comment.