Skip to content
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

Fix the hex orientation of pin locations. #730

Merged
merged 3 commits into from Jul 7, 2022

Conversation

ntouran
Copy link
Member

@ntouran ntouran commented Jun 22, 2022

The pin locations in a hex block were rotated 30 degrees from where they
should be. This was discovered when plotting pin-level assembly plots
and they were all sticking out the edges. The major confusion comes in
from the fact that even though pointed end up doesn't seem right when
you look at the pins, if you look at the little outline hexes
surrounding each pin then you can see that indeed the pointed end is
supposed to be up in this case.

This could impact results for anyone using auto-generated pin-level
grids and using the pin-wise pin coordinates.

Before:
image

After:
Screenshot from 2022-06-22 23-20-36


Checklist

  • The code is understandable and maintainable to people beyond the author.
  • Tests have been added/updated to verify that the new or changed code works.
  • There is no commented out code in this PR.
  • The commit message follows good practices.
  • All docstrings are still up-to-date with these changes.

If user exposed functionality was added/changed:

  • Documentation added/updated in the doc folder.

@ntouran ntouran added the bug Something is wrong: Highest Priority label Jun 22, 2022
@ntouran ntouran requested a review from keckler June 22, 2022 21:28
@ntouran ntouran force-pushed the fix-pin-orientation branch 2 times, most recently from 3b19d60 to 656bce4 Compare June 22, 2022 21:45
Copy link
Member

@keckler keckler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think also that your black tests are failing.

# note that it's the pointed end of the cell hexes that are up (but the
# macro shape of the pins forms a hex with a flat top fitting in the assembly)
grid = grids.HexGrid.fromPitch(
self.getPinPitch(cold=True), numRings=0, pointedEndUp=True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still working if a user puts into their layout blueprint the geom: hex_corners_up option?

I can't quite tell myself, but it feels like maybe in that case you should set pointedEndUp=False?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it only works on flat side up cases, you're right. I added a note in the docstring to the effect. It's be nice to detect that situation and throw an error, but we don't currently have a good way to look at a grid and determine which 'orientation' it is at this level.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't currently have a good way to look at a grid and determine which 'orientation'

Sad trombone noises.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found this researching #1284

armi/reactor/tests/test_blocks.py Show resolved Hide resolved
armi/reactor/blocks.py Show resolved Hide resolved
armi/reactor/blocks.py Outdated Show resolved Hide resolved
@john-science
Copy link
Member

@ntouran black is broken. I'd fix it for you, but it's in your private repo.

The pin locations in a hex block were rotated 30 degrees from where they
should be. This was discovered when plotting pin-level assembly plots
and they were all sticking out the edges. The major confusion comes in
from the fact that even though pointed end up  doesn't seem right when
you look at the pins, if you look at the little outline hexes
surrounding each pin then you can see that indeed the pointed end is
supposed to be up in this case.

This could impact results for anyone using auto-generated pin-level
grids and using the pin-wise pin coordinates.
After fixing the bug, I noticed that this other method was basically
duplicated and out of date. I updated it to be consistent with the
spatialLocators.
@john-science john-science merged commit b799d3e into terrapower:main Jul 7, 2022
scottyak pushed a commit to scottyak/armi that referenced this pull request Oct 27, 2022
The pin locations in a hex block were rotated 30 degrees from where they
should be. This was discovered when plotting pin-level assembly plots
and they were all sticking out the edges. The major confusion comes in
from the fact that even though pointed end up  doesn't seem right when
you look at the pins, if you look at the little outline hexes
surrounding each pin then you can see that indeed the pointed end is
supposed to be up in this case.

This could impact results for anyone using auto-generated pin-level
grids and using the pin-wise pin coordinates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is wrong: Highest Priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants