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

Limit negative optical depth for NonLTE line gas mix #172

Closed petercamps closed 1 year ago

petercamps commented 1 year ago

Motivation The absorption opacity returned by the NonLTELineGasMix class is negative in case the medium exhibits stimulated emission. The explicit absorption technique (see the MonteCarloSimulation class) supports the corresponding negative optical depths along a photon path. However, numerical problems arise if the negative optical depth magnitude becomes too high. This may happen, for example, as a result of Monte Carlo noise, or in the early stages when a simulation has not yet converged.

Description With this update, the NonLTELineGasMix class imposes a user-configurable lower limit on the (negative) optical depth along a cell diagonal before returning an absorption opacity. The default optical depth limit is -2.

Tests Verified that an example simulation no longer shows infinite or NaN luminosities. All functional tests still work.