Skip to content

Commit

Permalink
Small refactor of the UniformMeshConverter to allow users to provide
Browse files Browse the repository at this point in the history
just the block-level parameter names as a single list rather than
requiring the users/developers to differentiate in the code which
parameters are scalar or array values. This will now auto-detect the
type based on the parameter definition and then apply the correct
setters/getters.

Add an optional argument the ``makeAssemWithUniformMesh`` and
``setAssemblyStateFromOverlaps`` staticmethods to disable the
mapping of number densities on the creation of a new uniform assembly
or when mapping block-level parameter data between two assemblies.
This allows for more application-dependent flexibility for handling edge
cases. An example of where this is useful is in the situation of
moving meshes in vertical control rod movements.
  • Loading branch information
jakehader committed Sep 9, 2022
1 parent 4f50b6d commit 3778c86
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 153 deletions.
12 changes: 4 additions & 8 deletions armi/reactor/converters/tests/test_uniformMesh.py
Expand Up @@ -92,8 +92,7 @@ def test_makeAssemUniformMeshParamMappingSameMesh(self):
newAssem = self.converter.makeAssemWithUniformMesh(
sourceAssem,
sourceAssem.getAxialMesh(),
blockScalarParamNames=["flux", "power"],
blockArrayParamNames=["mgFlux"],
blockParamNames=["flux", "power", "mgFlux"],
)
for b, origB in zip(newAssem, sourceAssem):
self.assertEqual(b.p.flux, 1.0)
Expand All @@ -116,8 +115,7 @@ def test_makeAssemUniformMeshParamMappingSameMesh(self):
uniformMesh.UniformMeshGeometryConverter.setAssemblyStateFromOverlaps(
sourceAssembly=newAssem,
destinationAssembly=sourceAssem,
blockScalarParamNames=["flux", "power"],
blockArrayParamNames=["mgFlux"],
blockParamNames=["flux", "power", "mgFlux"],
)
for b, updatedB in zip(newAssem, sourceAssem):
self.assertEqual(b.p.flux, 2.0)
Expand Down Expand Up @@ -148,8 +146,7 @@ def test_clearAssemblyState(self):
cachedBlockParams = (
uniformMesh.UniformMeshGeometryConverter.clearStateOnAssemblies(
[sourceAssem],
blockScalarParamNames=["flux", "power"],
blockArrayParamNames=["mgFlux"],
blockParamNames=["flux", "power", "mgFlux"],
cache=True,
)
)
Expand Down Expand Up @@ -360,8 +357,7 @@ def test_setStateFromOverlaps(self):
uniformMesh.UniformMeshGeometryConverter.setAssemblyStateFromOverlaps(
self.sourceAssem,
self.destinationAssem,
blockScalarParamNames=paramList,
blockArrayParamNames=["mgNeutronVelocity"],
blockParamNames=paramList + ["mgNeutronVelocity"],
)

for paramName in paramList:
Expand Down

0 comments on commit 3778c86

Please sign in to comment.