Skip to content

Commit

Permalink
Add a setting to control auto-creation of Block grids
Browse files Browse the repository at this point in the history
These rely pretty heavily on MultiIndexLocation, which still isn't fully
supported across the code. Apps can override the default value of the
setting to opt out of the feature until it is more mature.
  • Loading branch information
youngmit committed Jul 28, 2021
1 parent e314ca8 commit f31a5bf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
3 changes: 2 additions & 1 deletion armi/reactor/blueprints/blockBlueprint.py
Expand Up @@ -26,6 +26,7 @@
from armi.reactor.blueprints import componentBlueprint
from armi.reactor.converters import blockConverters
from armi.reactor import grids
from armi.settings.fwSettings import globalSettings


def _configureGeomOptions():
Expand Down Expand Up @@ -162,7 +163,7 @@ def construct(
b.verifyBlockDims()
b.spatialGrid = spatialGrid

if b.spatialGrid is None:
if b.spatialGrid is None and cs[globalSettings.CONF_BLOCK_AUTO_GRID]:
try:
b.autoCreateSpatialGrids()
except (ValueError, NotImplementedError) as e:
Expand Down
34 changes: 16 additions & 18 deletions armi/settings/fwSettings/globalSettings.py
Expand Up @@ -110,6 +110,7 @@
CONF_OUTPUT_CACHE_LOCATION = "outputCacheLocation"
CONF_MATERIAL_NAMESPACE_ORDER = "materialNamespaceOrder"
CONF_DETAILED_AXIAL_EXPANSION = "detailedAxialExpansion"
CONF_BLOCK_AUTO_GRID = "autoGenerateBlockGrids"


def defineSettings() -> List[setting.Setting]:
Expand Down Expand Up @@ -185,9 +186,7 @@ def defineSettings() -> List[setting.Setting]:
description="Turn on the profiler for the submitted case. The profiler "
"results will not include all import times.",
isEnvironment=True,
oldNames=[
("turnOnProfiler", None),
],
oldNames=[("turnOnProfiler", None),],
),
setting.Setting(
CONF_COVERAGE,
Expand All @@ -211,9 +210,7 @@ def defineSettings() -> List[setting.Setting]:
description="Duration of one single cycle. If availability factor is below "
"1, the reactor will be at power less than this. If variable, use "
"cycleLengths setting.",
oldNames=[
("burnTime", None),
],
oldNames=[("burnTime", None),],
),
setting.Setting(
CONF_CYCLE_LENGTHS,
Expand All @@ -232,9 +229,7 @@ def defineSettings() -> List[setting.Setting]:
description="Availability factor of the plant. This is the fraction of the "
"time that the plant is operating. If variable, use availabilityFactors "
"setting.",
oldNames=[
("capacityFactor", None),
],
oldNames=[("capacityFactor", None),],
),
setting.Setting(
CONF_AVAILABILITY_FACTORS,
Expand Down Expand Up @@ -273,9 +268,7 @@ def defineSettings() -> List[setting.Setting]:
schema=vol.Any(
[float], None, float, msg="Expected NoneType, float, or list of floats."
),
oldNames=[
("betaComponents", None),
],
oldNames=[("betaComponents", None),],
),
setting.Setting(
CONF_DECAY_CONSTANTS,
Expand Down Expand Up @@ -443,9 +436,7 @@ def defineSettings() -> List[setting.Setting]:
label="Start Cycle",
description="Cycle number to continue calculation from. Database will "
"load from the time step just before. For snapshots use `dumpSnapshot`",
oldNames=[
("loadCycle", None),
],
oldNames=[("loadCycle", None),],
),
setting.Setting(
CONF_LOADING_FILE,
Expand All @@ -460,9 +451,7 @@ def defineSettings() -> List[setting.Setting]:
label="StartNode",
description="Timenode number (0 for BOC, etc.) to continue calulation from. "
"Database will load from the time step just before.",
oldNames=[
("loadNode", None),
],
oldNames=[("loadNode", None),],
),
setting.Setting(
CONF_LOAD_STYLE,
Expand Down Expand Up @@ -718,5 +707,14 @@ def defineSettings() -> List[setting.Setting]:
"than from the framework."
),
),
# It may make sense to remove this setting when MILs become more stable.
setting.Setting(
CONF_BLOCK_AUTO_GRID,
default=True,
label="Auto-generate Block grids",
description="Should block blueprints attempt to auto-generate a spatial "
"grid upon construction? This feature makes heavy use of multi-index "
"locations, which are not yet universally supported.",
),
]
return settings

0 comments on commit f31a5bf

Please sign in to comment.