Model Translation between MCNP and Serpent

mcnpy.translate_mcnp_serpent.apply_mcnp_cell_trans(mcnp_deck)[source]

Apply TRCL to individual surfaces in the cell’s region. If the cell is filled, we will also need a Serpent fill transformation.

Parameters

mcnp_deck (mcnpy.Deck) – MCNP deck being translated.

Returns

fill_trans – Dict mapping TR cards to cell IDs.

Return type

dict

mcnpy.translate_mcnp_serpent.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_serpent.make_mcnp_cell(mcnp_deck, serp_cell, id, outside_surfs)[source]

Translate Serpent Cell to MCNP Cell.

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

  • serp_cell (serpy.Cell) – Serpent Cell being translated.

  • id (int) – New MCNP Cell ID.

  • outside_surfs (dict) – Dict of Serpent Surfaces that have ‘outside’ fill.

Returns

  • mcnp_cell (mcnpy.Cell) – Translated MCNP Cell.

  • outside_surfs (dict) – Dict of Serpent Surfaces that have ‘outside’ fill.

mcnpy.translate_mcnp_serpent.make_mcnp_lattice(serp_lattice, mcnp_universes)[source]

Translate Serpent Lattice to MCNP Lattice.

Parameters
  • serp_lattice (serpy.Lattice) – Serpent Lattice being translated.

  • mcnp_universes (dict) – Dict of available MCNP Universes.

Returns

  • mcnp_lat (mcnpy.Lattice) – Translated MCNP Lattice.

  • element (mcnpy.Surface) – Surface boundary of the lattice element.

  • transformation (mcnpy.Transformation or None) – TR card to re-center lattice or None if not required.

mcnpy.translate_mcnp_serpent.make_mcnp_material(material, id)[source]

Translate Serpent Material to MCNP Material.

Parameters
  • material (serpy.Material) – Serpent Material to be translated.

  • id (int) – Material ID.

Returns

material – Translated MCNP Material.

Return type

mcnpy.Material

mcnpy.translate_mcnp_serpent.make_serpent_cell(serp_deck, mcnp_cell)[source]

Translate MCNP Cell to Serpent Cell.

Parameters
  • serp_deck (serpy.Deck) – Serpent Deck being translated to.

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

Returns

serp_cell – Translated Serpent Cell.

Return type

serpy.Cell

mcnpy.translate_mcnp_serpent.make_serpent_lattice(mcnp_cell, serp_universes)[source]
Parameters
  • mcnp_cell (mcnpy.Cell) – MCNP Cell with lattice fill.

  • serp_universes (dict) – Dict of Serpent Universes.

Returns

lat

Return type

serpy.Full3DLattice or serpy.LatticeType

mcnpy.translate_mcnp_serpent.make_serpent_material(material, name=None)[source]

Translate MCNP Material to Serpent Material.

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

  • name (str (Optional)) – Name for Serpent material.

Returns

material – Translated Serpent Material.

Return type

serpy.Material

mcnpy.translate_mcnp_serpent.make_serpent_region(region, surf_serp, serp_cell)[source]

Translate MCNP Region to Serpent Region.

Parameters
  • region (mcnpy.Region or mcnpy.Halfspace) – Region or halfspace being translated.

  • surf_serp (dict) – Dict of Serpent surfaces by ID.

  • serp_cell (dict) – Dict of Serpent cells by ID.

Returns

serp_region – Serpent Region.

Return type

serpy.Region

mcnpy.translate_mcnp_serpent.mcnp_to_serpent(mcnp_deck: Deck)[source]

Translate MCNP Deck to Serpent Deck.

Parameters

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

Returns

serp_deck – Translated Serpent Deck.

Return type

serpy.Deck

mcnpy.translate_mcnp_serpent.serpent_to_mcnp(serp_deck: Deck)[source]

Translate Serpent Deck to MCNP Deck.

Parameters

serp_deck (serpy.Deck) – Serpent Deck to be translated.

Returns

mcnp_deck – Translated MCNP Deck.

Return type

mcnpy.Deck

mcnpy.translate_mcnp_serpent.translate_file(file_name: str)[source]

Parse file and translate to MCNP or Serpent.

Parameters

file_name (str) – Name of file to translate.

Returns

trans_deck

Return type

mcnpy.Deck or serpy.Deck