-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HexBlock.autoCreateSpatialGrids raises lots of spurious exceptions #1923
Comments
+1 on this issue. I see this warning ~10 bazillion times whenever I run, and the warning message is not very useful. I would also say that the warning is not entirely justified, considering that nobody guaranteed the user that a spatial grid would be created on their block. I guess this message feels more like a "extra" or "debug" kind of thing, to me. |
Totally get the confusion, especially for things that don't make sense to have grids. Surprise surprise, there's a setting, defaulting to armi/armi/settings/fwSettings/globalSettings.py Lines 832 to 839 in f1f3dbe
|
Well, I like an easy one. I think, perhaps, we should:
A quick review tells me that no one anywhere in the world uses this setting. So, if it's only job is to turn on this log statement, then fine the log statement can stay Alternatively:
Thoughts? |
Huh, didn't know about that setting! In light of that, I guess the warning message makes a little bit more sense then. I think that the assigning of auto-grids to the blocks is useful, ,so even if the default was changed for the setting, I would just turn it back on. And in light of this behavior being controlled by a setting, it feels a bit strange to bury the warning behind a Hmmm... Maybe the answer here is to have a No matter, the message statement that Drew originally posted is cryptic and should be made more instructive for the user. |
I think the answer is sneakier. No one turns the setting off or on explicitly, but I'm 100% certain people rely on the functionality this setting controls. We use it to get a spatial grid so we can have The alternative to not autosetting grids is to have a grids definition for every block in your reactor. Which would be extremely cumbersome. In simple cases, where you have the same pin-like thing at every lattice site in your reactor, and you have a mult that would fill an entire hexagonal grid, the auto creation of spatial grids is a huge time saver.
That's a step in the right direction I think. Slap a I would wager that 500 of those 500 blocks do not need a spatial grid. Because they are just blocks with single mult components. I would say there should be no warning and no grid created if |
Yeah, that's a good idea. |
Note that the setting mentioned above ( |
One way to potentially cut down on the messages would be to move this line up to the top of the Line 2322 in 1920ff0
That method is pretty inefficient, in the sense that it will do almost all of the work before even checking if the block needs a spatial grid. In cases where the block already has one, we can skip all the work entirely. |
Honestly, I have not fully tested Chris' idea to move the But it certainly looks like this check could be done at the top of the method now, with no problems. |
It's not uncommon for me to see messages like
which, what? I read this as "multiplicities are not 1 they are 1" which enforces a sense of distrust in warning messages.
Tracking this down, we try/except
Block.autoCreateSpatialGrids
when creating a block in blueprintsarmi/armi/reactor/blueprints/blockBlueprint.py
Lines 243 to 247 in f1f3dbe
and the
HexBlock
implementation throws this errorarmi/armi/reactor/blocks.py
Lines 2353 to 2358 in f1f3dbe
The error appears to be triggered because we don't have two multiplicities. Which I guess would be what you'd expect an assembly with pins to have: single multiplicity for a duct or other bounding component, and then a multiplicity > 1 for pin-like components.
Remedy
If there is only a single multiplicity, and it's close to one, do not attempt to make a spatial grid on the block. This feels acceptable. There's nothing here to make a spatial grid so we won't. It's not that we cannot make a spatial grid (e.g., invalid number of pins), just that it doesn't make sense to create on here. Maybe the autocreate method raises an exception that is silently discarded in the block blueprint?
The text was updated successfully, but these errors were encountered: