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

Commit

Permalink
Merge branch 'debug'
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Feb 12, 2023
2 parents e4fda58 + 002dfc3 commit f32d1fb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/fraggle/fraggle_util.f90
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,15 @@ module subroutine fraggle_util_set_mass_dist(self, param)
class(collision_fraggle), intent(inout) :: self !! Fraggle collision system object
class(swiftest_parameters), intent(in) :: param !! Current Swiftest run configuration parameters
! Internals
integer(I4B) :: i, j, jproj, jtarg, nfrag, istart
integer(I4B) :: i, j, jproj, jtarg, nfrag, istart, nfragmax
real(DP), dimension(2) :: volume
real(DP), dimension(NDIM) :: Ip_avg
real(DP) :: mfrag, mremaining, mtot, mcumul, G, mass_noise
real(DP), dimension(:), allocatable :: mass
real(DP), parameter :: BETA = 2.85_DP
integer(I4B), parameter :: MASS_NOISE_FACTOR = 4 !! The number of digits of random noise that get added to the minimum mass value to prevent identical masses from being generated in a single run
integer(I4B), parameter :: NFRAGMAX = 100 !! Maximum number of fragments that can be generated
integer(I4B), parameter :: MASS_NOISE_FACTOR = 5 !! The number of digits of random noise that get added to the minimum mass value to prevent identical masses from being generated in a single run
integer(I4B), parameter :: NFRAGMAX_UNSCALED = 3000 !! Maximum number of fragments that can be generated
integer(I4B), parameter :: NFRAGMIN = 1 !! Minimum number of fragments that can be generated (set by the fraggle_generate algorithm for constraining momentum and energy)
integer(I4B), parameter :: NFRAG_SIZE_MULTIPLIER = 10 !! Log-space scale factor that scales the number of fragments by the collisional system mass
integer(I4B), parameter :: iMlr = 1
integer(I4B), parameter :: iMslr = 2
integer(I4B), parameter :: iMrem = 3
Expand All @@ -108,6 +107,7 @@ module subroutine fraggle_util_set_mass_dist(self, param)
mtot = sum(impactors%mass(:))
G = impactors%Gmass(1) / impactors%mass(1)
Ip_avg(:) = (impactors%mass(1) * impactors%Ip(:,1) + impactors%mass(2) * impactors%Ip(:,2)) / mtot
nfragmax = ceiling(NFRAGMAX_UNSCALED / param%nfrag_reduction)

if (impactors%mass(1) >= impactors%mass(2)) then
jtarg = 1
Expand Down Expand Up @@ -136,7 +136,7 @@ module subroutine fraggle_util_set_mass_dist(self, param)
mfrag = max((nfrag - 1)**(-3._DP / BETA) * impactors%mass_dist(iMslr), min_mfrag)
mremaining = mremaining - mfrag
end do
nfrag = ceiling(nfrag / param%nfrag_reduction)
nfrag = min(ceiling(nfrag / param%nfrag_reduction), nfragmax)
call self%setup_fragments(nfrag)

case (COLLRESOLVE_REGIME_MERGE, COLLRESOLVE_REGIME_GRAZE_AND_MERGE)
Expand Down

0 comments on commit f32d1fb

Please sign in to comment.