SKIRT / SKIRT9

SKIRT version 9 -- advanced radiative transfer in dusty systems
http://www.skirt.ugent.be
GNU Affero General Public License v3.0
34 stars 30 forks source link

Fix performance issue in photon life cycle without forced scattering #192

Closed petercamps closed 1 year ago

petercamps commented 1 year ago

Motivation The photon life cycle without forced scattering terminates only after the photon packet escapes from the model. However, in some cases, the luminosity of a photon packet may fall to zero long before it actually escapes from the model. A zero-luminosity packet can no longer make any contributions to the simulation results, so it does not make sense to continue tracking its path through the medium.

Context This issue was reported by @BertVdM. In the provided example (a torus of XRayAtomicGasMix gas with a central point source) some photon packets would experience more than 25 million scattering events before escaping from the model, most of which after reaching zero luminosity.

Description With this pull request:

Tests All functional tests produce the same results.