terrapower / armi

An open-source nuclear reactor analysis automation framework that helps design teams increase efficiency and quality
https://terrapower.github.io/armi/
Apache License 2.0
231 stars 89 forks source link

`genDefaultNucFlags()` is inconsistent with the use of `explicitFissionProducts: True` #1322

Open keckler opened 1 year ago

keckler commented 1 year ago

There is an option to generate a default set of nuclide flags so that the user does not have to manually type out all the necessary flags: https://github.com/terrapower/armi/blob/6cf9558a557ca92b36bed290ff6e3abebfa4eed2/armi/reactor/blueprints/isotopicOptions.py#L556-L565

We recommend the use of this method in our docs for programmatically generating input files (which, incidentally, apparently cannot be accessed without a direct link to it): https://terrapower.github.io/armi/gallery/framework/run_programmaticReactorDefinition.html

The genDefaultNucFlags() method calls to the getDefaultNuclideFlags() method, which actually builds the flags themselves. From within there, flags are added for both DUMP and LFP nuclides: https://github.com/terrapower/armi/blob/6cf9558a557ca92b36bed290ff6e3abebfa4eed2/armi/reactor/blueprints/isotopicOptions.py#L412-L453

Unfortunately the presence of DUMP nuclides in the problem is causing some problems when the new explicitFissionProducts setting is True. But this begs the question of whether or not the DUMP nuclides are needed when using explicit fission products. I think the answer to that question is "no", but we are running some tests to make sure.

Under the assumption that both the DUMP and LFP nuclides are anathema to a problem with explicit fission products, we should do something to avoid having those nuclides in the problem in the first place.

Since genDefaultNucFlags() isn't aware of what is in the case settings, it doesn't seem possible to make that method any "smarter". But there is the autoUpdateNuclideFlags() method, which receives a case settings object: https://github.com/terrapower/armi/blob/6cf9558a557ca92b36bed290ff6e3abebfa4eed2/armi/reactor/blueprints/isotopicOptions.py#L568-L596

Right now that method only adds nuclides that are needed to represent the explicit fission products, but I could see a path forward where that method also either warns the user that they have DUMP/LFP nuclides in their explicit fission products problem, or just strips out those DUMP/LFP nuclides entirely, thereby making the nuclide flags self-consistent.

@jakehader Since you were the explicit fission products architect, what do you think?

keckler commented 1 year ago

Thanks to @tjayasa for discovering this inconsistency!

jakehader commented 1 year ago

I like the idea of a warning as some folks could want extra stuff in there. I'm not sure the exact failure with dump and LFP nuclides being there but maybe we can chat offline so I can understand how we can beat treat this.

john-science commented 1 month ago

@keckler We should check-in with this. It's been too long.