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
212 stars 82 forks source link

Custom isotopics specified as number densities only work on 'Custom' materials #1739

Closed AidanMcDonald closed 6 days ago

AidanMcDonald commented 1 week ago

When defining a material from an existing material class but specifying custom isotopics with number densities, I get warning messages like the following and the custom isotopics are ignored.

You either specified a custom mass density or number densities (which implies a mass density) on <Material: UraniumOxide> with custom isotopics UO2. This has no effect on this Material class; you can only override mass density on Custom materials. Consider switching to number fraction input. Continuing to use mass density.

To replicate the warnings, run armi.configure; o=armi.init(fName="c5g7-settings.yaml") inside armi/tests/tutorials/

This is coming up in the context of running the c5g7 benchmark case with the openmc plugin, so while I could redefine the custom isotopics with number fraction input, I think having the exact same numbers and input format as the reference makes sense and I'm not sure it's necessary to not allow overriding density with custom isotopics. So far I have renamed every material in c5g7-settings.py to "custom", but now I'm missing the useful data from the predefined materials like thermal scattering data.

Could armi override the density and warn the user that they're doing so rather than warning the user that they're trying and ignoring the custom isotopics?

keckler commented 1 week ago

There has been discussion on something similar in the past. Take a look at this: https://github.com/terrapower/armi/issues/535

keckler commented 1 week ago

Also https://github.com/terrapower/armi/issues/1272

AidanMcDonald commented 6 days ago

Thanks! I agree that this is a duplicate of #1272, and it looks like pull request #1745 is the fix I had in mind.