Skip to content

Commit

Permalink
Merge 9516af6 into 907f2b4
Browse files Browse the repository at this point in the history
  • Loading branch information
jakehader authored Apr 5, 2022
2 parents 907f2b4 + 9516af6 commit 2f3ab1f
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 82 deletions.
30 changes: 0 additions & 30 deletions armi/reactor/assemblies.py
Original file line number Diff line number Diff line change
Expand Up @@ -973,36 +973,6 @@ def getBlocksBetweenElevations(self, zLower, zUpper):

return blocksHere

def getBlockLengthAboveAndBelowHeight(self, height):
"""
Returns a tuple with the amount of a block above or below a given height in an assembly.
Used to determine what fraction of the block should be merged with a control
rod.
Parameters
----------
height : float
The height of interest to grab a block (cm)
Returns
-------
distances : tuple
tuple containing the distance from height to top of block followed by
distance of height to bottom of block
"""
for b in self:
if height > b.p.zbottom and height <= b.p.ztop:
distanceFromTop = abs(b.p.ztop - height)
distanceFromBottom = abs(height - b.p.zbottom)
break
else:
raise ValueError(
"There are no blocks in {} at a height of {} cm".format(self, height)
)
return (distanceFromTop, distanceFromBottom)

def getParamValuesAtZ(
self, param, elevations, interpType="linear", fillValue=numpy.NaN
):
Expand Down
75 changes: 42 additions & 33 deletions armi/reactor/assemblyParameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,48 @@ def detailedNDens(self, value):
categories=[parameters.Category.assignInBlueprints],
)

with pDefs.createBuilder(
location="N/A", default=0.0, categories=["control rods"]
) as pb:

pb.defParam(
"crCriticalElevation",
units="cm",
description="The elevation of the bottom of the moveable section of a control rod assembly when the core is critical.",
saveToDB=True,
)

pb.defParam(
"crCurrentElevation",
units="cm",
description="The current elevation of the bottom of the moveable section of a control rod assembly.",
categories=[parameters.Category.assignInBlueprints],
saveToDB=True,
)

pb.defParam(
"crEndingElevation",
units="cm",
description="The final elevation of the bottom of the control material when fully inserted.",
categories=[parameters.Category.assignInBlueprints],
saveToDB=True,
)

pb.defParam(
"crRodLength",
units="cm",
description="length of the control material within the control rod",
saveToDB=True,
)

pb.defParam(
"crStartingElevation",
units="cm",
description="The initial starting elevation of the moveable section of a control rod assembly when fully withdrawn.",
categories=[parameters.Category.assignInBlueprints],
saveToDB=True,
)

with pDefs.createBuilder(
location=ParamLocation.AVERAGE, default=0.0, categories=["thermal hydraulics"]
) as pb:
Expand Down Expand Up @@ -234,39 +276,6 @@ def detailedNDens(self, value):
default=0, # integer default
)

with pDefs.createBuilder(
location="N/A", default=0.0, categories=["control rods"]
) as pb:

pb.defParam(
"crCurrentHeight",
units="cm",
description="The current height of the bottom of the control material from the 0 point in the reactor model",
)

pb.defParam(
"crEndingHeight",
units="cm",
description="The final position of the bottom of the control material when "
"starting control operations as measured from the 0 point in the reactor model",
)

pb.defParam(
"crRodLength",
units="cm",
description="length of the control material within the control rod",
)

pb.defParam(
"crStartingHeight",
units="cm",
description="The initial starting position of the bottom of the control "
"material when starting control operations as measured from the 0 point in the "
"reactor model. Note that the starting height is taken to be a maximum withdrawn "
"location for the control rod for determining the position when the control rod "
"is fully withdrawn.",
)

with pDefs.createBuilder() as pb:

pb.defParam(
Expand Down
47 changes: 37 additions & 10 deletions armi/reactor/reactorParameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,27 +168,46 @@ def detailedNucKeys(self, value):

pb.defParam("numMoves", units="", description="numMoves", default=0)

with pDefs.createBuilder(default=0.0, location="N/A") as pb:
with pDefs.createBuilder(
location="N/A", default="None", categories=["control rods"]
) as pb:

pb.defParam(
"breedingRatio2",
units="N/A",
description="Ratio of fissile Burned and discharged to fissile discharged",
saveToDB=False,
"crMostValuablePrimaryRodLocation",
units=None,
saveToDB=True,
description=(
"Core assembly location for the most valuable primary control rod."
),
)
pb.defParam(
"crMostValuableSecondaryRodLocation",
units=None,
saveToDB=True,
description=(
"Core assembly location for the most valuable secondary control rod."
),
)

pb.defParam(
"crWorthRequiredPrimary",
units="$",
units="pcm",
description="The total worth in $ required for primary control rods to shutdown reactor accounting for uncertainties and margins",
)

pb.defParam(
"crWorthRequiredSecondary",
units="$",
units="pcm",
description="The total worth in $ required for secondary control rods to shutdown reactor accounting for uncertainties and margins",
)

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

pb.defParam(
"breedingRatio2",
units="N/A",
description="Ratio of fissile Burned and discharged to fissile discharged",
saveToDB=False,
)

pb.defParam(
"critSearchSlope", units=None, description="Critical keff search slope"
)
Expand Down Expand Up @@ -224,7 +243,15 @@ def detailedNucKeys(self, value):
description="The item index of the inner matrix in an optimization case",
)

pb.defParam("keffUnc", units=None, description="Uncontrolled keff")
pb.defParam(
"keffUnc",
units=None,
saveToDB=True,
default=0.0,
description=(
"Uncontrolled k-effective for the reactor core (with control rods fully removed).."
),
)

pb.defParam(
"lastKeff",
Expand Down
9 changes: 0 additions & 9 deletions armi/reactor/tests/test_assemblies.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,15 +1003,6 @@ def test_getDominantMaterial(self):

self.assertEqual(self.Assembly.getDominantMaterial().getName(), ref)

def test_getBlockLengthAboveAndBelowHeight(self):
above, below = self.Assembly.getBlockLengthAboveAndBelowHeight(1)
self.assertEqual(above, 9.0)
self.assertEqual(below, 1.0)

above, below = self.Assembly.getBlockLengthAboveAndBelowHeight(5)
self.assertEqual(above, 5.0)
self.assertEqual(below, 5.0)

def test_iteration(self):
r"""
Tests the ability to doubly-loop over assemblies (under development)
Expand Down

0 comments on commit 2f3ab1f

Please sign in to comment.