Skip to content

Conversation

@anu1217
Copy link
Contributor

@anu1217 anu1217 commented May 29, 2025

This PR contains a script that performs all the necessary R2S physics steps using only OpenMC. It works as intended for the model with W and C spherical shells, and works with some modifications for the HCPB model. The latter may also require some variance reduction that could be hard-coded into the script, or perhaps selected using argparse.

Copy link
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @anu1217 - just one high-level comment on reusing the code in the OpenMC input file that relies on ALARA

Copy link
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left several final (?) comments. We can probably move on from here to start focusing on comparing results.

Comment on lines 199 to 201
if str(mat.id) in activated_mats_list :
mat = results[-1].get_material(str(mat.id))
energy = mat.get_decay_photon_energy()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be a good place for a little function

energy = get_decay_photon_energies(mat, results[-1])

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you elaborate on the benefit of doing this? get_decay_photon_energy() is also an openmc function, not my own

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question... (especially since I had to think about it myself to answer your question...)

Two motivations:

  1. It isolates the details of the logic behind checking if a material is in the activated material list and then extracting the right piece of the results, thus lowing the cognitive burden of understanding the bigger picture of what's going on here.

  2. That method could return None if either the material wasn't in the activated materials list or if the energy was None and then I think you could collapse the conditional clause somewhat

@anu1217 anu1217 marked this pull request as draft July 14, 2025 16:38
anu1217 added 7 commits July 14, 2025 11:56
- Generalize make_settings() to take source as input instead of neutron_source
- Call make_settings() twice to assign neutron settings and photon settings separately
- Rearrange some .export_to_model_xml() calls
- Added new functions import_ext_model(), make_native_model(), run_pyne_r2s(), run_openmc_r2s() to simplify logic executed in main()
- Modify argparse options
-  Remove args.photon_transport condition for OpenMC R2S (always run all R2S steps)
@anu1217 anu1217 marked this pull request as ready for review July 16, 2025 19:59
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