Skip to content

Conversation

@nuclearkevin
Copy link
Contributor

Description

This PR implements temperature feedback in the random ray solver using nearest interpolation (in a manner consistent to the MGMC solver). A new array slice is added to the flattened MGXS data structures which corresponds to a temperature index. Each source region computes and stores this temperature index based off of the cell (instance) temperature, allowing for per-cell temperature feedback. The implementation was tested by manually adding a new MGXS set for the south-west pin in the 2x2 random ray example which is 1/2 that of the other pins, which is used as the gold file for tests/regression_tests/random_ray_cell_temperature. The generation of temperature-dependent cross sections is also supported in the automagic setup, where the entire model is isothermal at each temperature value in the list provided by the user. The automagic addition + tests accounts for the vast majority of the diff in this PR.

This PR also fixes a bug in the MGMC solver where cell temperatures were not being queried correctly. This stopped all temperature datapoints from being correctly loaded when initializing the MGXS library at runtime.

Future work should include other temperature interpolation types for both the MGMC solver and the random ray solver. This is complicated in the random ray case due to the flattening of the cross sections to improve cache locality during source region updates.

I am not the most savvy Python programmer, so feedback regarding the additions to the Python API would be greatly appreciated!

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 15) on any C++ source files (if applicable)
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

@yardasol
Copy link
Contributor

This is an awesome feature. It'd be nice if you could add some content to the theory and user manual on it's implementation and use :) (as well as for the cell density feature that was already merged)

@nuclearkevin
Copy link
Contributor Author

nuclearkevin commented Jan 16, 2026

Good catch @yardasol! I don't know if a discussion about the cell densities / temperatures really needs to be included in the random-ray user guide, as this was a feature in CE/MG Monte Carlo which these PRs extended to the random ray solver. I think it's definitely worth adding a discussion of the temperature automagic setup though.

Edit: I just realized that distributed cell temperatures and densities don't have an entry in the geometry user manual. I'll add those in a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants