Skip to content

Commit

Permalink
Allow merging a zero-area solute.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgjarrett committed Jun 7, 2024
1 parent f06e2bf commit 884e16b
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions armi/reactor/converters/blockConverters.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,15 @@
import copy
import math

import numpy
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.patches import Wedge
import numpy
from matplotlib.collections import PatchCollection
from matplotlib.patches import Wedge

from armi.reactor import blocks
from armi.reactor import grids
from armi.reactor import components
from armi.reactor.flags import Flags
from armi import runLog
from armi.reactor import blocks, components, grids
from armi.reactor.flags import Flags

SIN60 = math.sin(math.radians(60.0))

Expand Down Expand Up @@ -141,12 +139,15 @@ def _checkInputs(self, soluteName, solventName, solute, solvent):
"Components are not of compatible shape to be merged "
"solute: {}, solvent: {}".format(solute, solvent)
)
if solute.getArea() <= 0 or solvent.getArea() <= 0:
if solute.getArea() < 0:
raise ValueError(
"Cannot merge components if either have negative area. "
"{} area: {}, {} area : {}".format(
solute, solvent, solute.getArea(), solvent.getArea()
)
"Cannot merge solute with negative area into a solvent. "
"{} area: {}".format(solute, solute.getArea())
)
if solvent.getArea() <= 0:
raise ValueError(
"Cannot merge into a solvent with negative or 0 area. "
"{} area: {}".format(solvent, solvent.getArea())
)

def restablishLinks(self, solute, solvent, soluteLinks):
Expand Down

0 comments on commit 884e16b

Please sign in to comment.