From 9011c0b56926c5f49835a4e887252d98129ccdd4 Mon Sep 17 00:00:00 2001 From: Mark Onufer Date: Fri, 13 Dec 2024 12:17:39 -0800 Subject: [PATCH 1/3] reactivity swing --- .../neutronics/globalFlux/globalFluxInterface.py | 10 ++++------ armi/reactor/reactorParameters.py | 6 +++++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/armi/physics/neutronics/globalFlux/globalFluxInterface.py b/armi/physics/neutronics/globalFlux/globalFluxInterface.py index 9e51adab5..dfcf37e3a 100644 --- a/armi/physics/neutronics/globalFlux/globalFluxInterface.py +++ b/armi/physics/neutronics/globalFlux/globalFluxInterface.py @@ -33,7 +33,7 @@ from armi.reactor.converters import uniformMesh from armi.reactor.flags import Flags from armi.settings.caseSettings import Settings -from armi.utils import units, codeTiming, getMaxBurnSteps, getBurnSteps +from armi.utils import units, codeTiming, getMaxBurnSteps ORDER = interfaces.STACK_ORDER.FLUX @@ -112,17 +112,15 @@ def _setRxSwingRelatedParams(self): # track boc uncontrolled keff for rxSwing param. self._bocKeff = self.r.core.p.keffUnc or self.r.core.p.keff - # A 1 burnstep cycle would have 2 nodes, and the last node would be node index 1 (first is zero) - lastNodeInCycle = getBurnSteps(self.cs)[self.r.p.cycle] - if self.r.p.timeNode == lastNodeInCycle and self._bocKeff is not None: + if self._bocKeff is not None: eocKeff = self.r.core.p.keffUnc or self.r.core.p.keff swing = (eocKeff - self._bocKeff) / (eocKeff * self._bocKeff) self.r.core.p.rxSwing = swing * units.ABS_REACTIVITY_TO_PCM runLog.info( f"BOC Uncontrolled keff: {self._bocKeff}, " - f"EOC Uncontrolled keff: {self.r.core.p.keffUnc}, " - f"Cycle Reactivity Swing: {self.r.core.p.rxSwing} pcm" + f"Current Uncontrolled keff: {self.r.core.p.keffUnc}, " + f"Cycle Reactivity Swing (so far): {self.r.core.p.rxSwing} pcm" ) def checkEnergyBalance(self): diff --git a/armi/reactor/reactorParameters.py b/armi/reactor/reactorParameters.py index 90eeb185b..e00fef2c3 100644 --- a/armi/reactor/reactorParameters.py +++ b/armi/reactor/reactorParameters.py @@ -433,7 +433,11 @@ def defineCoreParameters(): description="Max percent burnup on any block in the problem", ) - pb.defParam("rxSwing", units=units.PCM, description="Reactivity swing") + pb.defParam( + "rxSwing", + units=units.PCM, + description="Current Reactivity swing from BOC reactivity", + ) pb.defParam( "maxBuF", From c76066100565c74258c47230c98a996ab7d9fea0 Mon Sep 17 00:00:00 2001 From: Mark Onufer Date: Fri, 13 Dec 2024 12:22:19 -0800 Subject: [PATCH 2/3] release --- doc/release/0.5.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/release/0.5.rst b/doc/release/0.5.rst index f730979d6..133d43734 100644 --- a/doc/release/0.5.rst +++ b/doc/release/0.5.rst @@ -9,6 +9,7 @@ Release Date: TBD New Features ------------ #. Move instead of copy files from TemporaryDirectoryChanger. (`PR#2022 `_) +#. `rXSwing`` is now calculated for all time nodes making snapshots less failure prone due to non-relevant inputs. (`PR#2035 `_) API Changes ----------- From 52adc68baadb6904332120f64035cc8c62be2cb7 Mon Sep 17 00:00:00 2001 From: Mark Onufer Date: Fri, 13 Dec 2024 12:48:45 -0800 Subject: [PATCH 3/3] quick rename --- armi/physics/neutronics/globalFlux/globalFluxInterface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/armi/physics/neutronics/globalFlux/globalFluxInterface.py b/armi/physics/neutronics/globalFlux/globalFluxInterface.py index dfcf37e3a..8cb9a9cbc 100644 --- a/armi/physics/neutronics/globalFlux/globalFluxInterface.py +++ b/armi/physics/neutronics/globalFlux/globalFluxInterface.py @@ -114,8 +114,8 @@ def _setRxSwingRelatedParams(self): if self._bocKeff is not None: - eocKeff = self.r.core.p.keffUnc or self.r.core.p.keff - swing = (eocKeff - self._bocKeff) / (eocKeff * self._bocKeff) + currentKeff = self.r.core.p.keffUnc or self.r.core.p.keff + swing = (currentKeff - self._bocKeff) / (currentKeff * self._bocKeff) self.r.core.p.rxSwing = swing * units.ABS_REACTIVITY_TO_PCM runLog.info( f"BOC Uncontrolled keff: {self._bocKeff}, "