MCNP to OpenMC tool

Some of you may be aware that I have an MCNP to OpenMC conversion tool that I’ve worked on over the years. I spent a little bit of time this week packaging it up into a separate repository and have put it out in the open here:

It’s definitely not perfect and has some flaws, but it still may be useful for some purposes. If you do use it, make sure you read the disclaimer/known limitations on the README :smile:

For those interested in this topic, I’ll also draw attention to another open-source tool written by @makeclean that does CSG model conversion (goes beyond just MCNP → OpenMC but has a different set of limitations):

9 Likes

Hi Paul,

just used your tool to convert my MCNP materials to OpenMC.
Worked great. Really didn’t want to rename all those nuclides by hand (or self-script).

You (or anyone else) wouldn’t happen to know of any SDEF MCNP → OpenMC converters/scripts out there in the wild? (regardless of their maturity)

Regards,
Perry

Hi Perry – Glad to hear the MCNP conversion tool worked well for you! Unfortunately I’m not aware of any tools out there for converting SDEF source definition cards.

Paul,

Do you know of any tools to convert OpenMC to MCNP? I really like the geometry and materials definition tools that you guys have in OpenMC but need to get things like mean generation time and a few other things out of MCNP.

I’m not aware of such a tool. It’s not too much of a stretch to imagine the following:

model = openmc.Model()
model.geometry = ...
model.settings = ...

model.export_to_mcnp(filename)

But, given limited resources and time (and money), adding such a functionality has never made it to the top of my list. Maybe someone can convince the good folks at LANL to fund such a feature :slight_smile:

I’ll ping Jerawan and the other MCNP folks I know at LANL about it!

Thanks

Just noting that I came across a paper describing another package (not yet open source, but soon to be?) that is capable of doing MCNP to OpenMC conversion:

Hello @paulromano!
MCNPy was released a couple months ago. Have you used its model conversion functionality?
And is there any progress with source (SDEF) conversion from MCNP?

Hi @egor1abs! I started playing around with it when it was first released into the open but haven’t had time to experiment with it since then. If you do try it out, one thing to be aware of is that if you are converting an MCNP model it expects the very first line in the file to start with #.

No progress that I’m aware of in converting SDEF for any of the projects out there unfortunately. Sure would be nice!