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

Update reactivity coefficient parameters #1355

Merged
merged 12 commits into from
Aug 17, 2023
5 changes: 4 additions & 1 deletion armi/physics/thermalHydraulics/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def _getBlockParams():
)

with pDefs.createBuilder(
default=0.0, categories=["thermal hydraulics", "mongoose"], saveToDB=True
default=None, categories=["thermal hydraulics", "mongoose"], saveToDB=True
) as pb:

pb.defParam(
Expand All @@ -285,6 +285,9 @@ def _getBlockParams():
location=ParamLocation.TOP | ParamLocation.EDGES,
)

with pDefs.createBuilder(
default=0, categories=["thermal hydraulics", "mongoose"], saveToDB=True
) as pb:
pb.defParam(
"THhotChannel",
units=units.UNITLESS,
Expand Down
2 changes: 1 addition & 1 deletion armi/reactor/blockParameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ def xsTypeNum(self, value):

with pDefs.createBuilder(
default=0.0,
location=ParamLocation.AVERAGE,
location=ParamLocation.VOLUME_INTEGRATED,
categories=[
"reactivity coefficients",
"spatially dependent",
Expand Down
8 changes: 4 additions & 4 deletions armi/reactor/converters/tests/test_uniformMesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ def test_applyStateToOriginal(self):

self.converter.convert(self.r)
for ib, b in enumerate(self.converter.convReactor.core.getBlocks()):
b.p.mgFlux = range(33)
b.p.adjMgFlux = range(33)
b.p.mgFlux = list(range(33))
b.p.adjMgFlux = list(range(33))
b.p.fastFlux = 2.0
b.p.flux = 5.0
b.p.power = 5.0
Expand Down Expand Up @@ -507,8 +507,8 @@ def test_applyStateToOriginal(self):

# set original parameters on pre-mapped core with non-uniform assemblies
for b in self.r.core.getBlocks():
b.p.mgFlux = range(33)
b.p.adjMgFlux = range(33)
b.p.mgFlux = list(range(33))
b.p.adjMgFlux = list(range(33))
b.p.fastFlux = 2.0
b.p.flux = 5.0
b.p.power = 5.0
Expand Down
21 changes: 5 additions & 16 deletions armi/reactor/converters/uniformMesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ def paramSetter(block, vals, paramNames):
if val is None:
continue

if isinstance(val, (list, numpy.ndarray)):
if isinstance(val, (tuple, list, numpy.ndarray)):
ParamMapper._arrayParamSetter(block, [val], [paramName])
else:
ParamMapper._scalarParamSetter(block, [val], [paramName])
Expand All @@ -1327,22 +1327,11 @@ def paramGetter(self, block, paramNames):
paramVals = []
for paramName in paramNames:
val = block.p[paramName]
defaultValue = self.paramDefaults[paramName]
valType = type(defaultValue)
# Array / list parameters can be have values that are `None`, lists, or numpy arrays. This first
# checks if the value type is any of these and if so, the block-level parameter is treated as an
# array.
if isinstance(valType, (list, numpy.ndarray)) or isinstance(None, valType):
if val is None or len(val) == 0:
paramVals.append(None)
else:
paramVals.append(numpy.array(val))
# Otherwise, the parameter is treated as a scalar, like a float/string/integer.
# list-like should be treated as a numpy array
if isinstance(val, (tuple, list, numpy.ndarray)):
paramVals.append(numpy.array(val) if len(val) > 0 else None)
else:
if val == defaultValue:
paramVals.append(defaultValue)
else:
paramVals.append(val)
paramVals.append(val)

return numpy.array(paramVals, dtype=object)

Expand Down
4 changes: 4 additions & 0 deletions armi/reactor/parameters/parameterDefinitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ class Category:
* `neutronics` parameters are calculated in a neutronics global flux solve
* `gamma` parameters are calculated in a fixed-source gamma solve
* `detailedAxialExpansion` parameters are marked as such so that they are mapped from the uniform mesh back to the non-uniform mesh
* `reactivity coefficients` parameters are related to reactivity coefficient or kinetics parameters for kinetics solutions
* `thermal hydraulics` parameters come from a thermal hydraulics physics plugin (e.g., flow rates, temperatures, etc.)
"""

depletion = "depletion"
Expand All @@ -83,6 +85,8 @@ class Category:
neutronics = "neutronics"
gamma = "gamma"
detailedAxialExpansion = "detailedAxialExpansion"
reactivityCoefficients = "reactivity coefficients"
thermalHydraulics = "thermal hydraulics"
mgjarrett marked this conversation as resolved.
Show resolved Hide resolved


class ParamLocation(enum.Flag):
Expand Down
6 changes: 6 additions & 0 deletions armi/reactor/reactorParameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,12 @@ def defineCoreParameters():
description="Fuel Axial Expansion Coefficient",
)

pb.defParam(
"rxFuelAxialExpansionCoeffPerPercent",
units="dk/kk'-%",
description="Fuel Axial Expansion Coefficient",
)

pb.defParam(
"rxGridPlateRadialExpansionCoeffPerTemp",
units=f"{units.REACTIVITY}/{units.DEGK}",
Expand Down
1 change: 1 addition & 0 deletions doc/release/0.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ What's new in ARMI
#. Added SHA1 hashes of XS control files to the welcome text. (`PR#1334 <https://github.com/terrapower/armi/pull/1334>`_)
#. Put back ``avgFuelTemp`` block parameter. (`PR#1362 <https://github.com/terrapower/armi/pull/1362>`_)
#. Make cylindrical component block collection less strict about pre-homogenization checks. (`PR#1347 <https://github.com/terrapower/armi/pull/1347>`_)
#. Updated some parameter definitions and defaults. (`PR#1355 <https://github.com/terrapower/armi/pull/1355>`_)
#. TBD

Bug fixes
Expand Down
Loading