openmc_mcnp_adapter icon indicating copy to clipboard operation
openmc_mcnp_adapter copied to clipboard

Lattice Unverse Problems

Open yrrepy opened this issue 11 months ago • 1 comments

The following works in MCNP but is not accepted by the converter.

Versions: openmc_mcnp_adapter 0.1.0 (latest) Python3.11

7 0 201 -204 205 -210 211 -216 trcl=(2 3 0) lat=1 u=3 imp:n=1
       fill=-3:4 -2:3 0:0
       2 2 2 2 2 2 2 2
       2 1 1 1 1 1 1 2
       2 1 1 1 1 1 1 2
       2 1 1 1 1 1 1 2
       2 1 1 1 1 1 1 2
       2 2 2 2 2 2 2 2
701 0 #7 u=3 imp:n=1

Two problems occur:

Traceback (most recent call last): File "/theory/pyoung/.local/bin/mcnp_to_openmc", line 8, in sys.exit(mcnp_to_openmc()) ^^^^^^^^^^^^^^^^ File "/theory/pyoung/.local/lib/python3.11/site-packages/openmc_mcnp_adapter/openmc_conversion.py", line 719, in mcnp_to_openmc model = mcnp_to_model(args.mcnp_filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/theory/pyoung/.local/lib/python3.11/site-packages/openmc_mcnp_adapter/openmc_conversion.py", line 689, in mcnp_to_model openmc_universes = get_openmc_universes(cells, openmc_surfaces, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/theory/pyoung/.local/lib/python3.11/site-packages/openmc_mcnp_adapter/openmc_conversion.py", line 431, in get_openmc_universes universes[uid].add_cell(cell) ^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'RectLattice' object has no attribute 'add_cell'

Traceback (most recent call last): File "/theory/pyoung/.local/bin/mcnp_to_openmc", line 8, in sys.exit(mcnp_to_openmc()) ^^^^^^^^^^^^^^^^ File "/theory/pyoung/.local/lib/python3.11/site-packages/openmc_mcnp_adapter/openmc_conversion.py", line 719, in mcnp_to_openmc model = mcnp_to_model(args.mcnp_filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/theory/pyoung/.local/lib/python3.11/site-packages/openmc_mcnp_adapter/openmc_conversion.py", line 689, in mcnp_to_model openmc_universes = get_openmc_universes(cells, openmc_surfaces, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/theory/pyoung/.local/lib/python3.11/site-packages/openmc_mcnp_adapter/openmc_conversion.py", line 553, in get_openmc_universes univ_ids = np.asarray(univ_ids, dtype=int) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: '(2'

  1. The first can be solved by commenting out cell 701. But the converter should be able to accept it as it.
  2. The second, trcl=(2 3 0) has to be removed, and then the converter works. But the translation is lost.

yrrepy avatar Jan 31 '25 20:01 yrrepy

  1. Could you please update your example to be a full minimum working example, i.e., it could be opened as a valid input by MCNP. You can set your surfaces to be nonsensical to remove any sensitive information.

  2. It's unclear to me if this officially supports matrix fills like you have used here or not.

  3. I suspect that trcl is not supported at all.

MicahGale avatar Jan 31 '25 20:01 MicahGale