Conversation
Replacing with updated version that can also perform PyNE R2S
gonuke
left a comment
There was a problem hiding this comment.
I've left several final (?) comments. We can probably move on from here to start focusing on comparing results.
WC_Layers/OpenMC_R2S.py
Outdated
| if str(mat.id) in activated_mats_list : | ||
| mat = results[-1].get_material(str(mat.id)) | ||
| energy = mat.get_decay_photon_energy() |
There was a problem hiding this comment.
This might be a good place for a little function
energy = get_decay_photon_energies(mat, results[-1])
There was a problem hiding this comment.
Could you elaborate on the benefit of doing this? get_decay_photon_energy() is also an openmc function, not my own
There was a problem hiding this comment.
Good question... (especially since I had to think about it myself to answer your question...)
Two motivations:
-
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.
-
That method could return
Noneif either the material wasn't in the activated materials list or if the energy wasNoneand then I think you could collapse the conditional clause somewhat
- 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)
…llow flux beyond initial geometry
…o query unstructured mesh
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.