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:
The photon life cycle without forced scattering terminates any photon packets that reach zero luminosity.
The documentation of the PhotonPacketOptions class indicates that path length stretching is not implemented for the photon life cycle without forced scattering.
A warning is issued at runtime if path length stretching is requested for a photon life cycle without forced scattering.
Tests
All functional tests produce the same results.
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.