-
Notifications
You must be signed in to change notification settings - Fork 87
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
Rotate more parameters in HexBlock.rotate #1877
base: main
Are you sure you want to change the base?
Conversation
Can and will be used to signify that a parmeter should be rotated during calls to Block.rotate and Assembly.rotate.
Should make documentation a lot more powerful, linking the information directly to the attribute.
First step in showing intent for better parameter rotation #1860
Tests are failing because we have a test that does I'm of the opinion those should be moved to the block tests. Then we just need to make sure that |
Maybe @alexhjames since he wrote some of the rotation stuff, I believe |
I haven't look at the tests in question, but if they are repetitive and can be moved, then I think it's probably fair to do. |
i agree with this. it makes no sense to rotate rates (flux/fast flux/dpa rate). When you rotate an assembly the solution changes so the rates need to be recalculated (and we do that). Integrated params (fluence, fast fluence, dpa) should be rotated and we intend to. Thanks! |
Not sure I agree with this. The rotate method gets called both during shuffling, in which case your comment makes sense, but also during maybe we should have two methods, one for growing to full core and one for shuffling? Like a |
armi/reactor/blocks.py
Outdated
----- | ||
Parameters marked with the ``rotatable`` | ||
:class:`~armi.reactor.parameters.parameterDefinitions.Category` will be rotated. | ||
These parameters must adhere to one of the following rules to be rotated: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing vector valued quantities like displacementX
and displacementY
where two block parameters form a vector. Alternatively, you could restructure displacementX
and displacmentY
to be a single parameter that follows these rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that was not called out in the docs. I've revamped the PR and kept the existing rotation routines (displacement, orientation) so those should be unimpacted
Summarizing a separate chat. During rotation from shuffling and moving assemblies, some parameters will be wrong because they don't match the state of the reactor. And that's acceptable for now. I'll make a separate ticket to capture that |
If we were only rotating certain parameters during shuffling-based |
Imagine storing neutron, gamma, and total multi-group flux per cell. That is not something we currently do, but it's not outside the realm of something someone might want to do. We do store multigroup flux per hex cell, but that would still be a vector of data per cell.
This gets harder to make consise if we check 200+ entries. So instead, the test checks 1. Are the first two rings exactly correct? Using existing helper functionality. 2. If we rotated, are all entries except the center different? 3. If we did not, or rotated a full 360 degrees, did we get the original array? 4. If we rotate again to reach the original state (e.g., 2 and then 4 rotations), do we get the original data?
Felt redundant. Rather infer the number of sites in a full hexagonal lattice and compare against that.
okay @HunterPSmith @john-science @alexhjames @onufer this feels much better now. Existing rotation is not touched. Duct params, orientation, and displacement should be rotated as they were before. Any block parameter with the A couple cases where this could be a problem:
A concrete example of where this could be a problem would be the MHTGR 350 benchmark (#224). The assemblies have fuel compacts and coolant channels on the same hexagonal lattice. Users would have to make sure the things that are populating If we want to remove that assumption, we need to find a way to pass through the pin positions. Maybe with the spatial grid locations? But that's not clear to me right now. |
@@ -2167,6 +2175,25 @@ def _rotatePins(self, rotNum, justCompute=False): | |||
|
|||
return rotateIndexLookup | |||
|
|||
def _rotatePinParameters(self, rotNum: int): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use a one-line comment. WE had to talk about this a lot, so there must be something interesting to say about it.
Up to you though; not a deal breaker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good with me
Love the tests, man! |
Co-authored-by: John Stilley <[email protected]>
@@ -2167,6 +2175,25 @@ def _rotatePins(self, rotNum, justCompute=False): | |||
|
|||
return rotateIndexLookup | |||
|
|||
def _rotatePinParameters(self, rotNum: int): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good with me
""" | ||
A "namespace" for storing parameter categories. | ||
|
||
Notes | ||
----- | ||
* `cumulative` parameters are accumulated over many time steps | ||
* `pinQuantities` parameters are defined on the pin level within a block | ||
* `multiGroupQuantities` parameters have group dependence (often a 1D numpy array) | ||
* `fluxQuantities` parameters are related to neutron or gamma flux | ||
* `neutronics` parameters are calculated in a neutronics global flux solve | ||
* `gamma` parameters are calculated in a fixed-source gamma solve | ||
* `detailedAxialExpansion` parameters are marked as such so that they are mapped from the | ||
uniform mesh back to the non-uniform mesh | ||
* `reactivity coefficients` parameters are related to reactivity coefficient or kinetics | ||
parameters for kinetics solutions | ||
* `thermal hydraulics` parameters come from a thermal hydraulics physics plugin (e.g., flow | ||
rates, temperatures, etc.) | ||
""" | ||
"""A "namespace" for storing parameter categories.""" | ||
|
||
depletion = "depletion" | ||
"""Parameters used in or calculated by a depletion plugin.""" | ||
cumulative = "cumulative" | ||
"""Parameters are accumulated over many time steps""" | ||
cumulativeOverCycle = "cumulative over cycle" | ||
"""Parameters that are reset at beginning of cycle and accumulated over each cycle.""" | ||
assignInBlueprints = "assign in blueprints" | ||
"""Parameters that should be assigned in blueprints (e.g., control rod elevation)""" | ||
retainOnReplacement = "retain on replacement" | ||
pinQuantities = "pinQuantities" | ||
"""Parameters are defined on the pin level within a block""" | ||
fluxQuantities = "fluxQuantities" | ||
"""Parameters are related to neutron or gamma flux""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This came up in a chat so wanted to put my motivation here)
The change here is to make these docstrings attached to the class constants. They were already documented in the Category
docstring (some of them at least) but I found two flaws
- They were documented in the
Notes
section but would make more sense to be properly documented as class attributes - Attaching the docstring to the object itself means tools like python, ipython, vscode, etc. can provide context where you are about the thing you're looking at. You don't need to separately pull up the ARMI docs.
I'm not going to die on this hill if people have stronger opinions. This is just my rationale for this change.
What is the change?
Calls to
HexBlock.rotate
will additionally rotate parameters on the block with theParamLocation.CHILDREN
tag.Why is the change being made?
Rotating a block previously did not update all of the relevant parameters.
Closes #1860
Checklist
doc
folder.pyproject.toml
.