Skip to content

Commit

Permalink
Adding miscellaneous crumbs (#1505)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdlafleur authored Nov 29, 2023
1 parent 75e0246 commit cc59b00
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 2 deletions.
4 changes: 4 additions & 0 deletions armi/physics/neutronics/globalFlux/globalFluxInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
11 changes: 10 additions & 1 deletion armi/reactor/converters/geometryConverters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
7 changes: 6 additions & 1 deletion armi/reactor/converters/tests/test_geometryConverters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 6 additions & 0 deletions armi/reactor/tests/test_reactors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cc59b00

Please sign in to comment.