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

Add 1D Cylindrical Modeling to the XS Group Manager #1238

Merged
merged 12 commits into from
Apr 27, 2023
Merged

Add 1D Cylindrical Modeling to the XS Group Manager #1238

merged 12 commits into from
Apr 27, 2023

Conversation

jakehader
Copy link
Member

@jakehader jakehader commented Apr 11, 2023

Description

Implement a block collection type for managing 1D cylindrical
control rod modeling to ensure that number densities do not migrate
to other components. This is avoided by building a representative
block and setting number densities directly onto the components
instead of using b.setNumberDensities(). Setting number densities
directly on the blocks is not a good technique if the blocks are to
be treated heterogeneously because there is a chance that material
will migrate to other regions based on the "dehomogenization" logic
that is applied.


Checklist

  • This PR has only one purpose or idea.
  • Tests have been added/updated to verify that the new/changed code works.
  • The release notes (location doc/release/0.X.rst) are up-to-date with any bug fixes or new features.
  • The documentation is still up-to-date in the doc folder.
  • The dependencies are still up-to-date in setup.py.

control rod modeling to ensure that number densities do not migrate
to other components. This is avoided by building a representative
block and setting number densities directly onto the components
instead of using `b.setNumberDensities()`. Setting number densities
directly on the blocks is not a good technique if the blocks are to
be treated heterogeneously because there is a chance that material
will migrate to other regions based on the "dehomogenization" logic
that is applied.

Some TODO clean up on using Enums.
# Conflicts:
#	armi/physics/neutronics/latticePhysics/latticePhysicsInterface.py
#	armi/physics/neutronics/latticePhysics/tests/test_latticeInterface.py
@jakehader jakehader requested review from mgjarrett, onufer and albeanth and removed request for onufer April 11, 2023 18:58
Copy link
Contributor

@mgjarrett mgjarrett left a comment

Choose a reason for hiding this comment

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

The functionality of this looks good to me on the surface.

The new class CylindricalComponentsAverageBlockCollection is largely uncovered. (49 of 100 new lines were covered). More unit tests are needed.

@albeanth
Copy link
Member

Once Mike's comments are addressed and the coverage is up I will provide a secondary review. Thanks, Jake!

@mgjarrett
Copy link
Contributor

@albeanth I added unit tests. There's some coverage spray but coverage still increased overall in spite of that.

@albeanth albeanth marked this pull request as draft April 19, 2023 22:26
@albeanth
Copy link
Member

This PR is ready, but I am converting to draft while we figure out downstream merge dependencies.

info.append((b.getAverageTempInC(), b.getName(), b))
info.sort()
medianBlockData = info[len(info) // 2]
return medianBlockData[-1]
Copy link
Member

Choose a reason for hiding this comment

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

Why the median block temperature?

Copy link
Contributor

@mgjarrett mgjarrett Apr 27, 2023

Choose a reason for hiding this comment

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

I'm not sure, this is what @jakehader originally implemented. We do have a MedianBlockCollection but it's based on the median burnup, not the median temperature. Average probably does make more sense for temperature.

Edit: Although I guess it doesn't matter because then we just deepcopy it and then set the number densities based on the whole block collection. So it's probably not too important which block gets selected here.

Copy link
Member

Choose a reason for hiding this comment

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

So it's probably not too important which block gets selected here.

Agreed. You could probably simplify _selectCandidateBlock to use just the first block in getCandidateBlocks(). For what it's worth, the unit test within this PR still works with that change.

armi/physics/neutronics/crossSectionGroupManager.py Outdated Show resolved Hide resolved
armi/physics/neutronics/crossSectionGroupManager.py Outdated Show resolved Hide resolved
armi/nuclearDataIO/xsCollections.py Outdated Show resolved Hide resolved
armi/physics/neutronics/crossSectionSettings.py Outdated Show resolved Hide resolved
self._TWO_DIMENSIONAL_GEOM = "2D"
self._SLAB_MODEL = " slab"
self._CYLINDER_MODEL = " cylinder"
self._HEX_MODEL = " hex"
Copy link
Member

Choose a reason for hiding this comment

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

Are these removed because they are unused?

Copy link
Member

Choose a reason for hiding this comment

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

I see they were used downstream but no longer are. Ok.

Copy link
Contributor

Choose a reason for hiding this comment

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

They have been replaced by the XSGeometryTypes Enum. This could affect other users' downstream repos that use the latticePhysicsInterface, but it seems like good practice to force the usage of XSGeometryTypes throughout.

Copy link
Member

@albeanth albeanth Apr 27, 2023

Choose a reason for hiding this comment

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

@sombrereau @drewj-usnctech tagging for visibility and a heads up

@albeanth
Copy link
Member

@mgjarrett @jakehader sorry for the delayed review. This is a particular section of the framework that I have yet to spend a lot of time, so it was newer territory for me and I went a little slower. Also, I think it would have helped expedite the review if either 1) more context was given in the PR description (e.g., from a high-level what changes were being made to each file or groups of files and why), or 2) rebase the commits with sufficient comments in the commits so that they are in nice chunks and can be reviewed sequentially. In its current state it just took some time to parse through and wrap my head around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants