From cc59b0069412671f92a0bdb16f703e40f6b18084 Mon Sep 17 00:00:00 2001 From: bdlafleur Date: Wed, 29 Nov 2023 08:39:32 -0600 Subject: [PATCH] Adding miscellaneous crumbs (#1505) --- .../neutronics/globalFlux/globalFluxInterface.py | 4 ++++ .../globalFlux/tests/test_globalFluxInterface.py | 13 +++++++++++++ armi/reactor/converters/geometryConverters.py | 11 ++++++++++- .../converters/tests/test_geometryConverters.py | 7 ++++++- armi/reactor/tests/test_reactors.py | 6 ++++++ 5 files changed, 39 insertions(+), 2 deletions(-) diff --git a/armi/physics/neutronics/globalFlux/globalFluxInterface.py b/armi/physics/neutronics/globalFlux/globalFluxInterface.py index 752ffdfe7..d4ace8ff9 100644 --- a/armi/physics/neutronics/globalFlux/globalFluxInterface.py +++ b/armi/physics/neutronics/globalFlux/globalFluxInterface.py @@ -1174,6 +1174,10 @@ def computeDpaRate(mgFlux, dpaXs): r""" Compute the DPA rate incurred by exposure of a certain flux spectrum. + .. impl:: Compute DPA and DPA rates. + :id: I_ARMI_FLUX_DPA + :implements: R_ARMI_FLUX_DPA + Parameters ---------- mgFlux : list diff --git a/armi/physics/neutronics/globalFlux/tests/test_globalFluxInterface.py b/armi/physics/neutronics/globalFlux/tests/test_globalFluxInterface.py index 84837ff73..a7726ba26 100644 --- a/armi/physics/neutronics/globalFlux/tests/test_globalFluxInterface.py +++ b/armi/physics/neutronics/globalFlux/tests/test_globalFluxInterface.py @@ -141,6 +141,19 @@ def test_savePhysicsFiles(self): class TestGlobalFluxInterface(unittest.TestCase): + def test_computeDpaRate(self): + """ + Compute DPA and DPA rates from multi-group neutron flux and cross sections. + + .. test:: Compute DPA and DPA rates. + :id: T_ARMI_FLUX_DPA + :tests: R_ARMI_FLUX_DPA + """ + xs = [1, 2, 3] + flx = [0.5, 0.75, 2] + res = globalFluxInterface.computeDpaRate(flx, xs) + self.assertEqual(res, 10**-24 * (0.5 + 1.5 + 6)) + def test_interaction(self): """ Ensure the basic interaction hooks work. diff --git a/armi/reactor/converters/geometryConverters.py b/armi/reactor/converters/geometryConverters.py index 0f1d5ef4e..e9b8777c6 100644 --- a/armi/reactor/converters/geometryConverters.py +++ b/armi/reactor/converters/geometryConverters.py @@ -1243,6 +1243,10 @@ def convert(self, r): """ Run the conversion. + .. impl:: Convert a one-third-core geometry to a full-core geometry. + :id: I_ARMI_THIRD_TO_FULL_CORE0 + :implements: R_ARMI_THIRD_TO_FULL_CORE + Parameters ---------- sourceReactor : Reactor object @@ -1329,7 +1333,12 @@ def convert(self, r): ) def restorePreviousGeometry(self, r=None): - """Undo the changes made by convert by going back to 1/3 core.""" + """Undo the changes made by convert by going back to 1/3 core. + + .. impl:: Restore a one-third-core geometry to a full-core geometry. + :id: I_ARMI_THIRD_TO_FULL_CORE1 + :implements: R_ARMI_THIRD_TO_FULL_CORE + """ r = r or self._sourceReactor # remove the assemblies that were added when the conversion happened. diff --git a/armi/reactor/converters/tests/test_geometryConverters.py b/armi/reactor/converters/tests/test_geometryConverters.py index a3021ee15..f704262b7 100644 --- a/armi/reactor/converters/tests/test_geometryConverters.py +++ b/armi/reactor/converters/tests/test_geometryConverters.py @@ -332,7 +332,12 @@ def tearDown(self): del self.r def test_growToFullCoreFromThirdCore(self): - """Test that a hex core can be converted from a third core to a full core geometry.""" + """Test that a hex core can be converted from a third core to a full core geometry. + + .. test:: Convert a third-core to a full-core geometry and then restore it. + :id: T_ARMI_THIRD_TO_FULL_CORE0 + :tests: R_ARMI_THIRD_TO_FULL_CORE + """ # Check the initialization of the third core model self.assertFalse(self.r.core.isFullCore) self.assertEqual( diff --git a/armi/reactor/tests/test_reactors.py b/armi/reactor/tests/test_reactors.py index 673791a9a..53fb0ef77 100644 --- a/armi/reactor/tests/test_reactors.py +++ b/armi/reactor/tests/test_reactors.py @@ -743,6 +743,12 @@ def test_getAssemblyWithName(self): self.assertEqual(a1, a2) def test_restoreReactor(self): + """Restore a reactor after growing it from third to full core. + + .. test:: Convert a third-core to a full-core geometry and then restore it. + :id: T_ARMI_THIRD_TO_FULL_CORE1 + :tests: R_ARMI_THIRD_TO_FULL_CORE + """ aListLength = len(self.r.core.getAssemblies()) converter = self.r.core.growToFullCore(self.o.cs) converter.restorePreviousGeometry(self.r)