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

Inherit XS Settings when creating a new XS ID #1653

Closed mgjarrett closed 3 weeks ago

mgjarrett commented 4 months ago

What is the change?

When the cross section group manager creates a new XS ID that is based on a previous XS ID within CrossSectionGroupManager._getModifiedReprBlocks(), the new settings will now be inherited from the settings for the original XS group.

Why is the change being made?

Previously, a new XS ID would just be initialized with default cross section settings. Typically, when a user is creating a modified representative block with a new XS ID, they would want to keep the cross section settings from the original XS group.


Checklist

jakehader commented 4 months ago

Hi @mgjarrett - I might be misremembering but I think that we need to handle the case where the original XS settings are a link to an external cross section file or files. In that case we might need to default to 0D. Maybe I am misrememberinf why I implemented it this way.

mgjarrett commented 4 months ago

Hi @mgjarrett - I might be misremembering but I think that we need to handle the case where the original XS settings are a link to an external cross section file or files. In that case we might need to default to 0D. Maybe I am misrememberinf why I implemented it this way.

We shouldn't be trying to make a modified representative block based on a XS group that uses pregenerated cross sections. There is a warning logged in that situation:

https://github.com/terrapower/armi/blob/6163e942abe873129533b84a6f2efa632f260b47/armi/physics/neutronics/crossSectionGroupManager.py#L1255-L1261

No error is thrown, and you could even end up not getting the warning, depending on the arguments passed into _getModifiedReprBlocks. Maybe we need stronger controls around this. I can't tell if the intention is actually to prevent the user from passing in pregenerated XS to this method, or just to warn and allow it anyway.