AFD-Illinois / ipole

Polarized covariant radiative transport code
BSD 3-Clause "New" or "Revised" License
16 stars 12 forks source link

Fix some odd pixels #57

Closed bprather closed 3 years ago

bprather commented 3 years ago

In areas of very low emissivity but high absorptivity, even the analytic solution to the transport equation becomes numerically unstable due to catastrophic cancellation.

This can cause two undesired effects:

  1. sqrt(Q^2 + U^2 + V^2) >> I
  2. I < 0

These effects are usually not a problem, as they occur only for pixels with very small total emission. However, when exacerbated by numerically difficult tetrad choices, they can fail to cancel and produce low total emission, resulting in significantly negative or NaN-valued intensity in a few unlucky pixels.

This branch enforces that neither (1) nor (2) are true of the results of a fluid-frame step when solving the transport equation.

Ideally, the proper solution here is to avoid the vast scale separations which cause these catastrophic cancellations in the first place...

bprather commented 3 years ago

It appears that the significantly negative pixels are actually a result of inadequate absorption. Here is a particular pixel which turns out varying degrees of negative using most emissivities, plotted along with the absorptivity. image

And here is a pixel which appears to be within normal range, but exhibits the same pathology in nearly the same point in space image

Both are fixed by using this branch (Stokes parameters appear as flat lines at O(1e-32) and all pixels in the resulting image are positive)