SKIRT / SKIRT9

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

Required changes for the non-LTE + dust radiative transfer calculations #189

Closed Koseimatsu closed 1 year ago

Koseimatsu commented 1 year ago

Motivation and Guidelines To realize the dust + non-LTE line radiative transfer, I had to make some options in SKIRT, as shown in the commits.  (listed in order of importance.)

  1. add an option for considering the Doppler shift of dust emission (Low risk disrupting other classes).

  2. Update MonteCarloSimulation.cpp (This change reduces the computational time. The estimation of the dust temperature takes much time, so it is better to stop updating the dust temperature after it converged. Here, I expect that the iterative update of the dust temperatures is more quickly converged than that of level populations of atoms or molecules, which is typically true.) (medium risk disrupting other classes).

  3. Change the definition of indexes of collision transitions. (Low risk)

  4. Changed spatial bias to be set in EmittigaGasMix and DustEmissionOption (Medium risk disrupting other classes). If we want to see molecular emission lines in the MIR or NIR, dust emission usually comes from diffuse regions although molecular emission comes from dense regions. The individual option will help with this problem.

  5. add OH with hyperfine structures and H2 molecules. level populations of OH in the current SKIRT do not include hyperfine structures. This OH includes hyperfine structures, but the calculation can be more complex. Thus, it is better to make another option.

  6. Debug: for the calculations of mean intensities and solving a matrix (Low risk). This helps to understand what makes errors. Even in public SKIRT, I feel this message is nice.

Unnecessary commits Please ignore these commits.

  1. enable to define the initial level population manually (not required now).
  2. add a lower limit of opacity (already done by you)

Tests I have tested how these changes affect other functionalities, and I don't see risks disrupting other classes. but I'm not investigating these things in the entire SKIRT, so I'm not sure. If you feel some risk to these changes, please cancel these requests.

petercamps commented 1 year ago

@Koseimatsu As a first step, I merged the public master branch into your branch, resolving the merge conflicts by removing the changes you indicated as to be ignored. Below are some comments and further questions on your proposed changes.

  1. Why do we need an option to disable the Doppler shift for dust emission? The current behavior is to always include it (just as for other media). Granted, the simulation assumes that all medium components have the same bulk velocity, but even if this assumption would be invalid, the effect for dust is small because the cross sections vary slowly with wavelength. Do you have an example of a simulation where it actually matters? If not, I'd rather not add this option.

  2. Once dust convergence has been reached, you skip calculating and logging the dust convergence parameters (essentially, the total dust-absorbed luminosity over all cells). This would effect the simulation results if, in a subsequent iteration, the radiation field (emitted by other primary or secondary components) changes enough to break that dust convergence. This is unlikely to occur in your simulations but I'm not sure this is true in general. Does the logging (and corresponding calculation) really take significant time compared to photon emission? Can you send me (perhaps via regular email) an example of a simulation where this is an issue (preferably including ski file and log file)? As an alternative, perhaps I can look into speeding up this calculation.

  3. We previously assumed that the transitions (not the coefficients) are identical for all collision partners. Apparently this assumption is no longer valid and you had to update the code. Does this require a change in any of the existing data files? If so, you need to send them over.

  4. Sounds reasonable, although it adds another complication to the user configuration and it is an incompatible change to the ski file. Do you have an example of a simulation where this actually matters, and where your have improved the simulation time and/or the results by specifying a different spatial bias for each medium component?

  5. Please send the data files corresponding to these new species.

  6. OK.

I look forward to your responses.

petercamps commented 1 year ago

Further comments on each of the points raised earlier in this discussion:

  1. Doppler shift in dust emission. @Koseimatsu provided documentation through other channels showing that the spatial discretization of the dust emission Doppler shift causes some noise at the edges of the line profiles produced by the simulation. In principle this noise could be reduced by increasing the spatial resolution but in practice this is not feasible. Although the discretization noise is perhaps annoying in the provided example, the dust emission Doppler shift is an actual physical process that may have more significant effects in other simulations. Therefore, the core team has decided not to add a user option that would allow disabling the dust emission Doppler shift.
  2. Convergence calculation. With pull request https://github.com/SKIRT/SKIRT9/pull/190, the total dust-absorbed luminosity (required for evaluating convergence) is now calculated in parallel. In the example provided by @Koseimatsu, running on a multi-node system employing 500+ cores, the wall-time for this calculation went down from 6 minutes to less than 1 second, compared to over 40 minutes of photon shooting for the iteration. Therefore, it is not longer needed to skip this calculation in some cases.
  3. Specific set of transitions for each collision partner. With pull request https://github.com/SKIRT/SKIRT9/pull/191, the code has been updated to load a separate set of transitions for each collision partner, and the data files were updated were needed.
  4. Separate spatial bias for dust and emission. @Koseimatsu indicated in separate communication that this change does not seem very important. Because of the implied additional configuration complexity (and ski file incompatibility), we decided not to implement this suggested change.
  5. New species. This is incorporated in pull request https://github.com/SKIRT/SKIRT9/pull/191.
  6. Debug message. This is incorporated in pull request https://github.com/SKIRT/SKIRT9/pull/191.

Given that the various points were either resolved in another pull request, or were decided to be skipped, we can close this pull request.