karllark / DIRTY_dustrt

DIRTY: 3D dust radiative transfer for dusty astrophysical sources
https://dirty-dustrt.readthedocs.io
5 stars 1 forks source link

Output Radiation Field updates #35

Closed karllark closed 2 months ago

karllark commented 2 months ago

Updating the output radiation field information.

Adding subgrid mapping to radiation field and uncertainties.

Fixing radiation field uncertainties to be correct using Camps & Baes (2018). Empirical testing with the slab geometry shows the uncertainties correctly scale with number of photons and slightly overestimate the real uncertainties. This overestimate may be "correct" as variations inside the cell will be included in the unc calculation. This effect discussed in Gordon et al. (2001).

Outputting radiation field density U instead of internally used the mean intensity of the radiation field J. Conversion is U = (4*pi/c)J

karllark commented 2 months ago

For models with few grid cells and lots of photons, the use of short ints is an issue as the values then roll and become negative. May need to go back to long ints.

karllark commented 2 months ago

Empirical tests show good scaling with N, but low by a factor of 2 for the slab benchmark.

Fixed! To get 1-1 scaling between ave and empirical use the total number of photons instead of number of photons in each cell. I do not understand this, but this is formally what Camps & Baes (2018) use. When discussed with Peter and Maarten, it was indicated this is because that was in the reference they used. None of us fully understood the reasons, need to get back to that reference and read more carefully.

karllark commented 2 months ago

Plot showing correspondence between empirical unc from 200 runs and eqn based unc. Three different runs included with 1e4, 1e5, and 1e6 photons.

Clearly Camps & Baes (2018) result in a slight overestimate of the radiation field uncertainty. This may be reflecting the inclusion of the variation in the radiation field inside a cell in the unc calculation. This effect discussed in Gordon et al. (2001).

unctest_cb18

karllark commented 2 months ago

Note that adding the contribution to the sum of x2 at each interaction instead of the total for each photon (summed over each interaction before squaring) leads to a slight under prediction of the unc. Noting this for completeness.

All the testing has been done for a slab tau = 1 (z dir). Might be different for higher taus.

karllark commented 2 months ago

Testing for tau=5 shows a larger under-prediction for the x2 summing every interaction while the x2 summing every photon does not. Good evidence for summing every photon.