Skip to content

Commit

Permalink
Fixing MultipleComponentMerger with DerivedShape solvent (#1788)
Browse files Browse the repository at this point in the history
  • Loading branch information
AidanMcDonald committed Jul 25, 2024
1 parent 60e8b07 commit 6bdd8f7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion armi/reactor/converters/blockConverters.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@ def convert(self):
soluteName, self.solventName, minID=self.specifiedMinID
)
solvent = self._sourceBlock.getComponentByName(self.solventName)
BlockConverter._verifyExpansion(self, self.soluteNames, solvent)
if solvent.__class__ is not components.DerivedShape:
BlockConverter._verifyExpansion(self, self.soluteNames, solvent)
return self._sourceBlock


Expand Down
16 changes: 16 additions & 0 deletions armi/reactor/converters/tests/test_blockConverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,22 @@ def _test_dissolve(self, block, soluteName, solventName):
self.assertNotIn(soluteName, convertedBlock.getComponentNames())
self._checkAreaAndComposition(block, convertedBlock)

def test_dissolveMultiple(self):
"""Test dissolving multiple components into another."""
self._test_dissolve_multi(loadTestBlock(), ["wire", "clad"], "coolant")
self._test_dissolve_multi(
loadTestBlock(), ["inner liner", "outer liner"], "clad"
)

def _test_dissolve_multi(self, block, soluteNames, solventName):
converter = blockConverters.MultipleComponentMerger(
block, soluteNames, solventName
)
convertedBlock = converter.convert()
for soluteName in soluteNames:
self.assertNotIn(soluteName, convertedBlock.getComponentNames())
self._checkAreaAndComposition(block, convertedBlock)

def test_build_NthRing(self):
"""Test building of one ring."""
RING = 6
Expand Down

0 comments on commit 6bdd8f7

Please sign in to comment.