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

Adding miscellaneous crumbs #1505

Merged
merged 4 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
bdlafleur marked this conversation as resolved.
Show resolved Hide resolved

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
Loading