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

Use clearer input syntax for hexagonal lattice pitch #1654

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

mgjarrett
Copy link
Contributor

@mgjarrett mgjarrett commented Feb 27, 2024

What is the change?

Added an option for a user to specify a hexagonal pitch directly:

latticePitch: {hex: 1.5}

Why is the change being made?

Previously, a user had to specify the triangular pitch using the x attribute of latticePitch, which is confusing because the pitch is not necessarily equal to the x distance between two neighbors in a hex grid.

latticePitch: {x: 1.5}

https://github.com/terrapower/armi/blob/main/armi/reactor/grids/hexagonal.py#L152-L161


Checklist

  • The release notes have been updated if necessary.
  • The documentation is still up-to-date in the doc folder.
  • The dependencies are still up-to-date in pyproject.toml.

@john-science
Copy link
Member

I'm just thinking aloud here, but what something "flat-to-flat" be better for hex grids?

Isn't the goal to call out that we are going to be explicitly picking one over the other?

Calculating the pitch with a square root creates a machine precision
error.
@mgjarrett
Copy link
Contributor Author

I'm just thinking aloud here, but what something "flat-to-flat" be better for hex grids?

Isn't the goal to call out that we are going to be explicitly picking one over the other?

I'm not sure I understand what you are proposing. Do you mean specifying the pitch/flat-to-flat distance as flat-to-flat in the blueprints instead of latticePitch? I think latticePitch is still a fine descriptor of that parameter for a hexagonal lattice. And this allows us to not break any backwards compatibility with existing blueprints files, which would be an enormous pain.

@mgjarrett mgjarrett added the bug Something is wrong: Highest Priority label Feb 27, 2024
@mgjarrett
Copy link
Contributor Author

The bug fix was pulled out of this PR and into #1649

The remaining part of this PR is an optional/nice-to-have feature. It's just allowing users to define the hex pitch in blueprints in a slightly different way than before. No rush to push this through now, really.

@john-science
Copy link
Member

The unit tests broke after my PR merged. Sorry!

@mgjarrett
Copy link
Contributor Author

The unit tests broke after my PR merged. Sorry!

No worries! I just have to pull out what was moved over to #1649 and I think it will work.

Copy link

This pull request has been automatically marked as stale because it has not had any activity in the last 100 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Inactive PRs cannot be open forever label Sep 24, 2024
@john-science
Copy link
Member

@mgjarrett Forgive me, I have totally lost where this PR was at. When you think it is ready for review, take it out of Draft mode.

@github-actions github-actions bot removed the stale Inactive PRs cannot be open forever label Sep 27, 2024
@mgjarrett
Copy link
Contributor Author

I think the PR is ready. For context, I was trying to address the issue that Drew and Mitch were discussing 3 years ago over on this issue #252:

image

@mgjarrett mgjarrett marked this pull request as ready for review October 4, 2024 23:13
@mgjarrett
Copy link
Contributor Author

I had unintentionally added some files that were sitting around in my git directory to this PR. These files have been removed, so this PR is now ready.

@john-science john-science self-requested a review October 11, 2024 16:53
@john-science
Copy link
Member

@mgjarrett Does this PR require changes downstream? (Is it backwards compatible, or do we need to fix dozens of downstream input files after merging this PR?)

@@ -360,7 +361,8 @@ def tearDown(self):

def test_simpleRead(self):
gridDesign = self.grids["control"]
_ = gridDesign.construct()
grid = gridDesign.construct()
self.assertAlmostEqual(grid.pitch, 1.2)
Copy link
Member

Choose a reason for hiding this comment

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

I was thinking it would be nice to show that this works for corners up and flats up.

I was think you could copy/paste this test, and just search/replace "geom: hex_corners_up" with "geom: hex.

Thoughts?

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.

Finding hexagonal pin pitch for wire-less assemblies
2 participants