mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
Ensure that two surfaces with different boundary type are not considered redundant (#2942)
This commit is contained in:
parent
569c087597
commit
256150f567
2 changed files with 14 additions and 1 deletions
|
|
@ -701,7 +701,7 @@ class Geometry:
|
|||
coeffs = tuple(round(surf._coefficients[k],
|
||||
self.surface_precision)
|
||||
for k in surf._coeff_keys)
|
||||
key = (surf._type,) + coeffs
|
||||
key = (surf._type, surf._boundary_type) + coeffs
|
||||
redundancies[key].append(surf)
|
||||
|
||||
redundant_surfaces = {replace.id: keep
|
||||
|
|
|
|||
|
|
@ -390,3 +390,16 @@ def test_get_all_nuclides():
|
|||
c2 = openmc.Cell(fill=m2, region=+s)
|
||||
geom = openmc.Geometry([c1, c2])
|
||||
assert geom.get_all_nuclides() == ['Be9', 'Fe56']
|
||||
|
||||
|
||||
def test_redundant_surfaces():
|
||||
# Make sure boundary condition is accounted for
|
||||
s1 = openmc.Sphere(r=5.0)
|
||||
s2 = openmc.Sphere(r=5.0, boundary_type="vacuum")
|
||||
c1 = openmc.Cell(region=-s1)
|
||||
c2 = openmc.Cell(region=+s1)
|
||||
u_lower = openmc.Universe(cells=[c1, c2])
|
||||
c3 = openmc.Cell(fill=u_lower, region=-s2)
|
||||
geom = openmc.Geometry([c3])
|
||||
redundant_surfs = geom.remove_redundant_surfaces()
|
||||
assert len(redundant_surfs) == 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue