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

Commit

Permalink
Fixed issue that can occur if the mass of the largest remnant is larg…
Browse files Browse the repository at this point in the history
…er than the target body (a partial accretion). The mass of the second-largest fragment was not being computed correctly based on the remaining mass available after the partial accretion.
  • Loading branch information
daminton committed Feb 9, 2023
1 parent 287beed commit d50121b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/collision/collision_regime.f90
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ subroutine collision_regime_LS12_SI(Mcb, m1, m2, rad1, rad2, rh1, rh2, vb1, vb2,
real(DP) :: a1, alpha, aint, b, bcrit, c_star, egy, zeta, l, lint, mu, phi, theta, ke, pe
real(DP) :: Qr, Qrd_pstar, Qr_erosion, Qr_supercat
real(DP) :: Vhr, Verosion, Vescp, Vhill, Vimp, Vsupercat
real(DP) :: Mint, Mtot, Mtmp
real(DP) :: Mint, Mtot, Mtmp, Mbig, Msmall
real(DP) :: Rp, rhill
real(DP) :: Mresidual
real(DP) :: U_binding
Expand Down Expand Up @@ -282,8 +282,9 @@ subroutine collision_regime_LS12_SI(Mcb, m1, m2, rad1, rad2, rh1, rh2, vb1, vb2,
else
Mlr = max((1.0_DP - Qr / Qrd_pstar / 2.0_DP) * Mtot, min_mfrag) ! [kg] # LS12 eq (5)
end if

Mslr_hitandrun = max(calc_Qrd_rev(m2, m1, Mint, den1, den2, Vimp, c_star), min_mfrag)
Mbig = max(m1,Mlr)
Msmall = mtot - Mbig
Mslr_hitandrun = max(calc_Qrd_rev(Msmall, Mbig, Mint, den1, den2, Vimp, c_star), min_mfrag)
if (regime == COLLRESOLVE_REGIME_HIT_AND_RUN ) then
Mslr = Mslr_hitandrun
else
Expand Down
2 changes: 1 addition & 1 deletion src/fraggle/fraggle_util.f90
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ module subroutine fraggle_util_set_mass_dist(self, param)
mremaining = impactors%mass_dist(iMrem)
do while (i <= nfrag)
mfrag = (1 + i - iMslr)**(-3._DP / BETA) * impactors%mass_dist(iMslr)
if (mremaining - mfrag < 0.0_DP) exit
if (mremaining - mfrag <= 0.0_DP) exit
mremaining = mremaining - mfrag
i = i + 1
end do
Expand Down

0 comments on commit d50121b

Please sign in to comment.