Skip to content

Commit

Permalink
new core param + change to createAssemblyOfType
Browse files Browse the repository at this point in the history
Summary:
- adding a reactor.core parameter to store the geometric axial mesh (_not_ the neutronics mesh that is currently stored on reactor.core.axialMesh). This new parameter is: `core.p.currentGeometryAxialMesh`
-  ensuring that when new assemblies are created from blueprint assemblies that the geometric block mesh on the assembly is set to align with the `core.p.currentGeometryAxialMesh` if `detailedAxialExpansion: False`.
  • Loading branch information
albeanth committed Jun 29, 2022
1 parent e7c3cf7 commit e8713de
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
7 changes: 7 additions & 0 deletions armi/reactor/reactorParameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,13 @@ def detailedNucKeys(self, value):

with pDefs.createBuilder(default=0.0, location="N/A") as pb:

pb.defParam(
"currentGeometryAxialMesh",
units="cm",
description="Current core axial mesh.",
default=None,
)

pb.defParam(
"breedingRatio2",
units="N/A",
Expand Down
11 changes: 11 additions & 0 deletions armi/reactor/reactors.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ def __init__(self, name):
self._automaticVariableMesh = False
self._minMeshSizeRatio = 0.15
self._inputHeightsConsideredHot = True
self._detailedAxialExpansion = False

def setOptionsFromCs(self, cs):
# these are really "user modifiable modeling constants"
Expand All @@ -227,6 +228,7 @@ def setOptionsFromCs(self, cs):
self._automaticVariableMesh = cs["automaticVariableMesh"]
self._minMeshSizeRatio = cs["minMeshSizeRatio"]
self._inputHeightsConsideredHot = cs["inputHeightsConsideredHot"]
self._detailedAxialExpansion = cs["detailedAxialExpansion"]

def __getstate__(self):
"""Applies a settings and parent to the core and components."""
Expand Down Expand Up @@ -1688,6 +1690,12 @@ def createAssemblyOfType(self, assemType=None, enrichList=None, cs=None):
# therefore breaks the burnup metric.
b.adjustUEnrich(enrich)

if not self._detailedAxialExpansion:
# if detailedAxialExpansion: False, make sure that the assembly being created has the correct core mesh
a.setBlockMesh(
self.p.currentGeometryAxialMesh[1:], conserveMassFlag="auto"
) # pass [1:] to skip 0.0

return a

def saveAllFlux(self, fName="allFlux.txt"):
Expand Down Expand Up @@ -2221,6 +2229,9 @@ def processLoading(self, cs):
"Please make sure that this is intended and not a input error."
)

self.p.currentGeometryAxialMesh = self.findAllAxialMeshPoints(
applySubMesh=False
)
self.p.axialMesh = self.findAllAxialMeshPoints()
refAssem = self.refAssem

Expand Down
7 changes: 7 additions & 0 deletions armi/reactor/tests/test_reactors.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,13 @@ def test_createAssemblyOfType(self):
aNew = self.r.core.createAssemblyOfType(aOld.getType())
self.assertAlmostEqual(aOld.getMass(), aNew.getMass())

# test axial mesh alignment
aNewMesh = aNew.getAxialMesh()
for i, meshValue in enumerate(aNewMesh):
self.assertAlmostEqual(
meshValue, self.r.core.p.currentGeometryAxialMesh[i + 1]
) # use i+1 to skip 0.0

# creation with modified enrichment
aNew2 = self.r.core.createAssemblyOfType(aOld.getType(), 0.195)
fuelBlock = aNew2.getFirstBlock(Flags.FUEL)
Expand Down

0 comments on commit e8713de

Please sign in to comment.