Refactoring moltres_xs to be able to use mgxs.Library() functionality. #340
Refactoring moltres_xs to be able to use mgxs.Library() functionality. #340Jeremyb8707bigbrain wants to merge 22 commits intoarfc:develfrom
Conversation
… tallies. Includes a built in .json dump file that can be removed/configured. Issue arfc#319
|
Hey everyone, I ran local tests myself for the godiva.json files, mostly everything lines up like it should. Another discrepancy that may be noted is the version, I am on OpenMC version 0.15.2 so the numbers are within std. dev, but for the smaller values it had a bit more range. 99% of everything works as it should, and I plan to add support for multiple statepoints and summaries soon. I added the openmc_mgxslib class so even if it is not 100% it can be added (maybe). Also I forgot to say, this one does not require an input file that specifies energy groups delayed etc, that all comes with a properly configured mgxs.Library(). Also I am working on ordering the files consistently in the.json. |
…ed sorting inside of the JSON.
…ned up spacing, extra lines, and more type checking and error catching.
…. Tweaked division by zero handling to be more readable and less complex.
… added back the consistent nu-scatter matrix requirement because I was testing stuff and forgot to add that back.
…sted the consistent nu-scatter matrix processing to allow all legendre_order types.
|
Hey @Jeremyb8707bigbrain thanks again for working on this PR. I have been very busy, but I have some general feedback:
|
|
Perfect I can do all of that! |
Changed main openmc (0.15.3) calls to run new function rather than the old one, added a way to manually build old case logic via inputs and inspecting python file for the mgxs.Library Added better logging for errors at mgxslib.load_from_statepoints.... Adapted it so that it will correctly use burn_idexes to comply with read_input() formatting. Set generate_openmc_talies_xml as a staticmethod explicitly
Local tests were ran and all files looked correct.
|
Hey @smpark7, everything for the most part is in order! I kept the openmc_xs class still available just in case you wanted to mark it for deprecation so users know that they will need to change their parameters slightly. I have a few questions, did you want me to include the SPN calculation? I can easily (I hope) include that I was just wondering if you would like me to. I also added TOTXS which is not present in the reference godiva.json file, but I see it in the code, would you like me to keep that or remove it? Last question, for your suggestion of having the mgxs.Library() be compatible with OpenMC's own multigroup mode, it would require an additional tally (Absorption), would you like me to add that and add the OpenMC Function check_library_for_openmc_mgxs() to the process_mgxslib() function to ensure advanced users must also meet that requirement? I did a few tests with multiple statepoints and summaries, here are the results, again I do not have access to all 8 delayed groups so some areas will be off very slightly. If you have any other concerns or questions please reach out! I also credit my research partner @rafainn for help with the input file work, very helpful! Example Python File: (I again dont have the cross sections at 900K or 1200K so I made them myself, which means sadly only 6 delayed groups) Input File: Output: I did another test with a different material, and same temperature and it worked as it should. |
importing where required rather than global to save compute for non-openmc based input functions Changed add_to_tallies_file to the newest non-deprecated version
|
Compatible until openMC 0.15.3 - since not mentioned explicitly elsewhere. |
|
Thanks @rafainn for also contributing to this PR. Yes SPN and TOTXS should be included. They're missing in the godiva files because the godiva test case was created before SPN and TOTXS were required for the new SN solver. (You can use this 1-D MSRE test case for an example that generates SPN and TOTXS) I see now that there are some incompatibilities between Moltres and multigroup OpenMC (OpenMC-MG) regarding required group constants:
One solution may be to stick with group constants that Moltres requires (as you have done) and let advanced users who want to use the same library for multigroup OpenMC add I think you need the JEFF cross section library to get 8 delayed groups, but that's not a big deal. |
…t becomes deprecated in a future update, because no version other than latest has that new name, and it still works with the latest version.
… for advanced users to match moltres input-file generated list.
|
@smpark7 I got the SPN Stuff down, adding new constants is quite easy with the library method. |
|
Thanks! I hope to have time next week to review this in detail. |
Summary of changes
Types of changes
Required for Merging
Associated Issues and PRs
Associated Developers
Checklist for Reviewers
Reviewers should use this link to get to the
Review Checklist before they begin their review.