openmc icon indicating copy to clipboard operation
openmc copied to clipboard

composite surface for wedge

Open shimwell opened this issue 1 year ago • 3 comments

Description

Quite often we make wedge shaped CSG surfaces for models

typically two plane surfaces and a sphere, or 4 planes and a cylinder.

This is useful for a DAGMC bounding box for sector models.

We typically have mixed surface types (reflective and vacuum)

The existing .bounded_region does not quite have the flexibility to provide a bounding wedge region

Additional terms like angle1, angle2 would be probably be needed

Currently we have this code

vac_surf = openmc.Sphere(r=10000, surface_id=9999, boundary_type="vacuum")

# adds reflective surface for the sector model at 0 degrees
reflective_1 = openmc.Plane(
    a=math.sin(0),
    b=-math.cos(0),
    c=0.0,
    d=0.0,
    surface_id=9991,
    boundary_type="reflective",
)

# adds reflective surface for the sector model at 90 degrees
reflective_2 = openmc.Plane(
    a=math.sin(math.radians(90)),
    b=-math.cos(math.radians(90)),
    c=0.0,
    d=0.0,
    surface_id=9990,
    boundary_type="reflective",
)

region = -vac_surf & -reflective_1 & +reflective_2
containing_cell = openmc.Cell(cell_id=9999, region=region, fill=dag_univ)

Perhaps it would be useful to have this wedge shape available in openmc as a CompositeSurface?

Alternatives

Continue using the code as is and users make a wedge shape Modify the .bounded_region so it allows wedges as well as boxes and sphere Add another bounding_wedge method which would be similar to bounding_region but just designed for wedges

Compatibility

additional composite surface does not interfere with API for other parts of the code

shimwell avatar Dec 04 '24 17:12 shimwell

Hello, could I try implementing this one? I wonder if it could be a good issue for newcomers.

rzehumat avatar Mar 02 '25 19:03 rzehumat

I should have linked this PR which adds a similar wedge feature

https://github.com/openmc-dev/openmc/pull/3236

I'm not sure if it is sufficiently useful to get merged in, but feedback on the PR is welcome

shimwell avatar Mar 02 '25 20:03 shimwell

Thanks for the reply. Sorry, I forgot to check the PR section 🤦‍♂

rzehumat avatar Mar 04 '25 20:03 rzehumat