Model Translation between MCNP and OpenMC

mcnpy.translate_mcnp_openmc.decompose_mcnp(deck)[source]

Decompose cell complements and macrobodies.

Parameters

deck (mcnpy.Deck) – Deck being decomposed.

mcnpy.translate_mcnp_openmc.decompose_mcnp_transformation(transform, angle='COSINES')[source]

Decompose MCNP Transformation into displacement and rotation.

Parameters
  • transform (mcnpy.Transform) – Transform being translated.

  • angle (str) – Angle unit for transform.

Returns

  • vector (list) – Displacement vector.

  • rot_matrix (numpy.array) – Rotation matrix.

mcnpy.translate_mcnp_openmc.make_mcnp_cell(mcnp_deck, openmc_cell)[source]

Translate OpenMC Cell to MCNP Cell.

Parameters
  • mcnp_deck (mcnpy.Deck) – MCNP Deck being translated to.

  • openmc_cell (openmc.Cell) – OpenMC Cell being translated.

Returns

material – Translated MCNP Material.

Return type

mcnpy.Material

mcnpy.translate_mcnp_openmc.make_mcnp_lattice(openmc_lat, mcnp_universes)[source]

Translate OpenMC Lattice to MCNP Lattice.

Parameters

openmc_lat (openmc.RectLattice) – OpenMC lattice being translated.

Returns

  • mcnp_lat (mcnpy.Lattice) – MCNP Lattice translated to.

  • element (mcnpy.Surface) – Surface bounding MCNP lattice element.

  • lat_disp (list) – Lattice displacement.

  • lat_u (list) – Universes in lattice.

  • transformation (mcnpy.Transformation or None) – Transfprmation to reposition lattice.

mcnpy.translate_mcnp_openmc.make_mcnp_material(material: Material)[source]

Translate OpenMC Material to MCNP Material.

Parameters

material (openmc.Material) – OpenMC Material to be translated.

Returns

material – Translated MCNP Material.

Return type

mcnpy.Material

mcnpy.translate_mcnp_openmc.make_openmc_cell(mcnp_cell, openmc_trans, openmc_surfs, openmc_mats, openmc_universes)[source]

Translate MCNP Cell to OpenMC Cell.

Parameters
  • mcnp_cell (mcnpy.Cell) – MCNP Cell being translated.

  • openmc_trans (dict) – Dict of OpenMC transformations.

  • openmc_surfs (dict) – Dict of OpenMC surfaces.

  • openmc_mats (dict) – Dict of OpenMC materials.

  • openmc_universes (dict) – Dict of OpenMC universes.

Returns

  • openmc_cell (openmc.Cell) – Translated OpenMC Cell.

  • u_list (list or None) – List of universes created during lattice conversion.

  • dim (list) – Dimensions for assigning lattice parameters later.

mcnpy.translate_mcnp_openmc.make_openmc_material(material)[source]

Translate MCNP Material to OpenMC Material.

Parameters

material (mcnpy.Material) – MCNP Material to be translated.

Returns

material – Translated OpenMC Material.

Return type

openmc.Material

mcnpy.translate_mcnp_openmc.mcnp_to_openmc(mcnp_deck: Deck)[source]

Translate MCNP Deck to OpenMC Model.

Parameters

mcnp_deck (mcnpy.Deck) – MCNP Deck to be translated.

Returns

  • geom (openmc.Geometry) – OpenMC model geometry.

  • mats (openmc.Materials) – OpenMC model materials.

mcnpy.translate_mcnp_openmc.openmc_mat_density_units(unit)[source]

Unit conversion between MCNP and OpenMC.

Parameters

unit (str) – MCNP density unit.

Returns

openmc_unit – OpenMC density unit.

Return type

str

mcnpy.translate_mcnp_openmc.openmc_to_mcnp(openmc_geometry: Geometry, openmc_materials: Materials, openmc_settings=None)[source]

Translate OpenMC Model to MCNP Deck.

Parameters
  • openmc_geometry (openmc.Geometry) – OpenMC Geometry.

  • openmc_materials (openmc.Materials) – OpenMC Materials.

  • openmc_settings (openmc.Settings or None) – OpenMC Settings.

Returns

mcnp_deck – Translated MCNP Deck.

Return type

mcnpy.Deck

mcnpy.translate_mcnp_openmc.plane_distance(p1, p2)[source]

Distance between parallel planes.

mcnpy.translate_mcnp_openmc.translate_file(file_name: str, materials=None, settings=None)[source]

Parse file and translate MCNP to OpenMC.

Parameters

file_name (str) – Name of file to translate.

Returns

  • geom (openmc.Geometry) – OpenMC model geometry.

  • mats (openmc.Materials) – OpenMC model materials.