Ronlinmd@gmail.com

To all

Please accept my apologies if this topic isn’t within the guidelines of OPENMC.
I haven’t been able to find a forum for the MCNPy application.

I was trying to use the MCNPy tools to convert an MCNP6 input file into OPENMC.
The function that I was trying to use is:
mcnpy.translate_mcnp_openmc.mcnp_to_openmc

I am using MCNP 6.3 on a Windows platform.
I am running the latest version of Ubuntu on a WSL2 environment.
I have OPENMC and MCNPY installed into the same Conda environment.
I just installed OPENMC, so I should have the latest version.
I am loosely using an example from the MCNPy site to try to convert an existing MCNP6 input file named room.mcnp.
I am using ANACONDA-NAVIGATOR to enter and test the input.

Below is the input and response of A-N.

Thank you for your time and consideration.

Ron LaVera

import mcnpy
Metamodel Gateway Server Already Running
I slept for: 0.0 seconds!
mcnp_file_paty = “ipynb/mcnpy-examples/room.mcnp”

Translate to OpenMC.

openmc_model = mcnpy.translate_mcnp_openmc.mcnp_to_openmc(“room.OMC”)

OpenMC XML files are automatically serialized.

AttributeError Traceback (most recent call last)
Cell In[3], line 2
1 # Translate to OpenMC.
----> 2 openmc_model = mcnpy.translate_mcnp_openmc.mcnp_to_openmc(“room.OMC”)
3 # OpenMC XML files are automatically serialized.

File ~/anaconda3/envs/openmc-env/lib/python3.12/site-packages/mcnpy/translate_mcnp_openmc.py:336, in mcnp_to_openmc(mcnp_deck)
320 “”“Translate MCNP Deck to OpenMC Model.
321
322 Parameters
(…)
332 OpenMC model materials.
333 “””
335 # MCNP deck decomposition and processing.
→ 336 mcnp_deck = mp.Deck.read(mcnp_deck._deck, renumber=True)
337 print(‘Decomposing Geometry…’)
338 decompose_mcnp(mcnp_deck)

AttributeError: ‘str’ object has no attribute ‘_deck’