onix.couple.Couple_openmc

class onix.couple.Couple_openmc(MC_input_path=None, xs_mode='no constant lib', MPI=None)[source]

This class is used to execute coupled-mode simulations

Through this class, the user can:

  • chose to parallelize the Monte Carlo simulations via the “set_MPI” method

  • set the nuclear data libraries to be used in the simulation

  • set the burnup/time sequence for the simulation

  • manually set the volume of each BUCells (note that by default, ONIX uses the OpenMC stochastic volume calculation to find the volume of each cell. However, this method might produce important errors on the volume and it is advised to set the volume manually)

  • select which of the Cells defined in the OpenMC input should be depleted (these cells will be known as BUCells)

  • select a list of nuclides in each BUCell which cross sections will be tallied. If the user does not specify any such list of nuclides, ONIX will by default tally the cross sections of all nuclides which data are found in the cross section library.

The Couple_openmc class also takes care of the coupling between ONIX and OpenMC. At the beginning of a simulation, it imports certain initial parameters from the OpenMC input to ONIX such as the name of the BUCells and the initial nuclide densities of each BUCell. During the simulation, it makes sure that information such as the flux tallies, neutron spectrum tallies, the reaction rates and the updated nuclide densities are correctly transfered between the burnup module and the neutron transport module.

The Couple_openmc class will also sample the isomeric branching ratios and (n,gamma) cross sections on the the same energy points to prepare for the calculations of one-group isomeric branching ratios.

IMPORTANT: the root cell in the OpenMC input should be named “root cell”

Parameters
  • MC_input_path (str) – Specifies where the OpenMC input files in .xml format are located. This parameter should not be specified as ONIX cannot yet work without Python API.

  • xs_mode (str) – Choice between ‘constant lib’ and ‘no constant lib’. Default to ‘no constant lib’. ‘constant lib’ indicates to ONIX that the user has provided a constant one-group cross section libraries to be used. ‘no constant lib’ indicates to ONIX that it should use one-group cross section computed by OpenMC.

  • MPI (str) – Choice between ‘on’ and ‘off’. Indicates whether OpenMC will be parrallelized or not.

property MC_XS_nucl_list

Returns the list of nuclides for which cross section data exist in the cross section library.

property MC_input_path

Returns the path to OpenMC input files.

property MPI

Returns wether MPI is activated or not (‘on’ if the user chose to parallelize OpenMC with MPI, ‘off’ if not)

property bounding_box

Returns the bounding box of the geometry.

burn()[source]

Launches the coupled simulation.

few_isomeric_on()[source]

Calling this function will force ONIX to only calculate isomeric branching ratios of Pm147 and Am241 By default ONIX calculates all isomeric branching ratios for which data can be found in the EAF-2010 multiplicities library

import_openmc(root_cell)[source]

This method import certain parameters from OpenMC to ONIX

This method launches the _pre_run script which runs a first Monte Carlo simulation in order for ONIX to get a handle on the various OpenMC objects (this feature is essential when the user decides to defines input parameters via a text input file rather than using the Python API. However, as of now, ONIX only supports Python API input)

The _pre_run script also requests OpenMC to calculate the volume of each OpenMC Cell with openmc.calculate_volume(). However, the volumes obtained via this method can have significant errors, especially for complex or large geometry. As of now, it is recommented that the user manually sets the volume of ech BUCell via the onix.couple.Couple_openmc.set_volume() command.

Finally, a very important functionality of import_openmc is to add minute quantities of certain nuclides in BUCells’ materials so that OpenMC can calculate their cross sections. This means that ONIX is going to modify the material.xml and add all nuclides requested by the user for cross section calculations. This feature is necessary because OpenMC cannot tally reaction rates of nuclides that are not present in the material.

Parameters

root_cell (openmc.Cell) – Root cell object defined in OpenMC geometry.

property initial_summary

Returns the original summary.h5 file created by OpenMC before ONIX applies change to OpenMC’s objects.

property materials

Returns the materials object created in the OpenMC material input.

no_decay()[source]

Activate a “no-decay” simulation. This means that the system will not model the decay of nuclides

property openmc_bin_path

Returns the path to OpenMC executable.

reac_rank_on()[source]

Calling this function will tell ONIX to produce reaction rates ranking and print them for each BUCells By default ONIX does not produce reaction rates ranking as it takes a lot of memory.

Important: In the current version of ONIX, this function needs to be called before couple.import_openmc() is called other wise the function will not work.

property root_cell

Returns the root cell object created in the OpenMC geometry.

select_bucells(bucell_list)[source]

Selects the cells from the OpenMC input that should be depleted.

The user can choose to specify the nuclides for which cross sections should be updated by OpenMC simulations. To do so, the user must enter a tuple where the first element is the OpenMC cell object and the second element is a list of the name of nuclides which cross sections should be updated.

If the user does not specify for which nuclides cross sections should be updated, only the OpenMC cell objects should be entered. ONIX will by default calculate the cross sections for all nuclides available in the cross section library.

Parameters

bucell_list (list of openmc.Cell or list of tuples) –

Defines the list of cells that should be depleted by ONIX.

For example, the user can set bucell_list = [(fuel_cell, [‘U-235’, ‘Pu-239’]), (cladding_cell, [‘Al-27’])]

property sequence

Returns the sequence assigned to the Couple_openmc() object.

set_MPI(execu, tasks)[source]

Sets the settings for the MPI parallelization

Parameters
  • execu (str) – The MPI execute command, for example ‘srun’ on cluster using slurm

  • tasks (str) – The number of tasks to parallelize

set_bounding_box(ll, ur)[source]

Sets the bounding box of the geometry.

Parameters
  • ll ([x,y,z]) – Extremity of the box located in the negative part of a 3-D plan

  • ur ([x,y,z]) – Extremity of the box located in the positive part of a 3-D plan

set_decay_from_object(bucell, object)[source]

Sets the decay library from an ONIX decay object defined by the user for a specific BUCell.

Parameters
  • bucell (onix.Cell) – The BUCell for which the decay data are to be used.

  • object (onix.utils.decay_lib) – A decay library object constructed by the user with onix.utils.decay_lib.

set_decay_lib(decay_lib_path)[source]

Sets the decay library to use for ONIX.

Parameters

decay_lib_path (str) – Path to a decay library. The library needs to be in ONIX format.

set_default_decay_lib()[source]

Sets the decay library to the default one (ENDF/B-VIII.0).

set_default_fy_lib()[source]

Sets the fission yield library to the default one (ENDF/B-VIII.0).

set_default_xs_lib()[source]

Sets the cross section library to the default one. The default cross section library in ONIX has been obtained by computing middle-burnup one-group cross section for a coupled simumation of a LWR fuel pin-cell. Therefore, this library is only adapted for LWR reactors.

set_fy_from_object(bucell, object)[source]

Sets the fission yield library to an ONIX fission yield object defined by the user for a specific BUCell.

Parameters
  • bucell (onix.Cell) – The BUCell for which the decay data are to be used.

  • object (onix.utils.fy_lib) – A fission yield library object constructed by the user with onix.utils.fy_lib.

set_sequence(sequence)[source]

Sets a sequence object to the Couple_openmc object.

Parameters

sequence (onix.Sequence) – ONIX sequence object defined by the user.

set_tolerance(tolerance)[source]

For treating intermediate temperatures,’tolerance’ indicates a range of temperature within which cross sections may be used.

set_user_fy_lib(user_fy_lib_path, complete=False)[source]

Sets the fission yield library to use for ONIX. Setting the complete parameter to True allows ONIX to complement the data of the provided library with additional data found in ENDF/B-VIII.0.

Parameters
  • user_fy_lib_path (str) – Path to a fission yield library. The library needs to be in ONIX format.

  • complete (bool) – Indicates to ONIX whether or not to complement the provided library with additional fission yields from ENDF:B-VIII.0 library.

set_vol(vol_dict)[source]

Sets the volume of each BUCell in \(cm^{3}\).

Parameters

vol_dict (dict) – Dictionnary where keys are the names of BUCell (as defined by the user) and entries are volume in \(cm^{3}\).

set_xs_lib(xs_lib_path)[source]

Sets the cross section library to use for ONIX.

Parameters

xs_lib_path (str) – Path to a cross section library. The library needs to be in ONIX format.

property settings

Returns the setting object defined in OpenMC simulation.

property system

Returns the system object of the simulation.

property updated_summary

Returns the updated summary.h5 file created by OpenMC before ONIX applies change to OpenMC’s objects.

property xs_mode

Returns the mode for cross sections library.