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

Support for vessel and cuboid surface types #1

Closed
sohhae opened this issue Sep 16, 2024 · 5 comments
Closed

Support for vessel and cuboid surface types #1

sohhae opened this issue Sep 16, 2024 · 5 comments

Comments

@sohhae
Copy link

sohhae commented Sep 16, 2024

Hello OpenMC team,

I’ve been working with a Serpent input file, and I’ve come across some surface types that currently aren’t supported by the openmc_serpent_adapter tool. Specifically, I need to use the cuboid and vessel surfaces. These are common surface types in Serpent, and I was wondering if there’s any interest or ongoing effort to include these in the adapter tool?

For reference, here’s the Serpent documentation that defines surface types.

The Serpent input file I'm working with also includes the trans function a lot. I'm wondering if there is any ongoing effort to include this as well?

I’d be happy to contribute to these efforts but would appreciate some guidance on where and how to get started.

Thanks!
Soha

@paulromano
Copy link
Collaborator

Hey @sohhae! Adding support for cuboid would be very simple since it is equivalent to the openmc.model.RectangularParallelepiped class in OpenMC. If you look at the parse_surf_cards function, you would just need to add another case on the big if/elif/else block.

Support for vessel would be a little more complicated since we don't have a matching composite surface in OpenMC. You would first need to add a new class in openmc/model/surface_composition.py in the main OpenMC repo to match the vessel surface in Serpent. You can take a look at the existing classes in that file to get a sense of what's involved.

As for trans, it depends on which kind of transformation you need. Some are already supported while others are not. You can take a look at the parse_trans_cards function in serpent_conversion.py.

@nsedayilmaz
Copy link
Collaborator

Hi @sohhae! We updated openmc_serpent_adapter and added support for cuboid and vessel. The adapter should now work correctly with those surfaces. If you have any other issues with them, please don't hesitate to let me know.

Regarding the trans cards, could you tell me which kind of transformation you need so that I can prioritize them?

@sohhae
Copy link
Author

sohhae commented Oct 10, 2024

Thanks @nsedayilmaz and @paulromano! Really appreciate your support! I believe the cuboid and vessel implementation is working well, though I'm having issues with the ZConeOneSided.

File "/Users/sa39262-admin/Documents/modeling/openmc_venv/lib/python3.12/site-packages/openmc_serpent_adapter/serpent_conversion.py", line 387, in parse_surf_cards
   openmc_surfaces[name] = openmc.model.ZConeOneSided(x0, y0, Z0, R, up)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/Users/sa39262-admin/Documents/modeling/openmc_venv/lib/python3.12/site-packages/openmc/model/surface_composite.py", line 887, in __init__
   check_greater_than('cone R^2', r2, 0.0)
 File "/Users/sa39262-admin/Documents/modeling/openmc_venv/lib/python3.12/site-packages/openmc/checkvalue.py", line 269, in check_greater_than
   raise ValueError(msg)
ValueError: Unable to set "cone R^2" to "-0.3185059055118106" since it is less than or equal to "0.0"

Regarding the trans cards, I need "U" and "S" implemented.

Thanks again!

@paulromano paulromano changed the title Support for vessel, cuboid, and trans Surface Types Support for vessel and cuboid surface types Nov 19, 2024
@paulromano
Copy link
Collaborator

Support for cuboid and vessel surfaces has now been added. I also fixed the issue with cones by using the new ConicalFrustum class in OpenMC. Note that you'll need the develop branch of OpenMC for these fixes to work until we get a new release of OpenMC out, hopefully soon.

@paulromano
Copy link
Collaborator

Closing this issue; I created a separate issue for universe transformations (#2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants