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

Commit

Permalink
Implemented a hard upper-limit on the number of fragments generated
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Feb 12, 2023
1 parent 881a97f commit 5e9509c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/fraggle/fraggle_util.f90
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,9 @@ module subroutine fraggle_util_set_mass_dist(self, param)
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 = 1000 !! 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 Down Expand Up @@ -136,7 +135,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 5e9509c

Please sign in to comment.