onix – Utilities and functions

Reaction classes

These classes enable users to build their own custom nuclear libraries. Instantiations of these classes can be used as nuclear libraries for simulations.

onix.utils.decay_lib

Decay_lib objects allow users to build and store custom, small size decay libraries.

onix.utils.xs_lib

xs_lib objects allow users to build and store custom, small size one-group cross section libraries.

onix.utils.fy_lib

fy_lib objects allow users to build and store custom, small size fission yield libraries.

Functions

Convenient functions to be used directly by users and used in the source code.

onix.utils.decay_to_halflife

Converts a decay constant into a half life in specified units.

onix.utils.halflife_to_decay

Converts a half life into a decay constant.

onix.utils.halflife_to_second

Converts a half life from specified units into seconds.

onix.utils.is_int

Check whether an object is an integer.

onix.utils.is_zamid

Check whether a string is a nuclide’s z-a-m id.

onix.utils.is_name

Check whether a string is a nuclide’s name.

onix.utils.is_list_redundant

Check whether a list is redundant.

onix.utils.get_list_redundant_elt

Returns the redundant elements in a list.

onix.utils.zamid_list_to_name_list

Converts a list of nuclides’ z-a-m ids into a list of names.

onix.utils.name_list_to_zamid_list

Converts a list of nuclides’ names into a list of z-a-m ids.

onix.utils.get_zamid_z

Gets the atomic number (z) from a nuclide’s z-a-m id.

onix.utils.get_name_z

Gets the atomic number (z) from a nuclide’s name.

onix.utils.get_zamid_a

Gets the mass number (a) from a nuclide’s z-a-m id.

onix.utils.get_zamid_n

Gets the number of neutrons (n) from a nuclide’s z-a-m id.

onix.utils.get_zamid_s

Gets the state of a nuclide from a its z-a-m id.

onix.utils.zamid_to_name

Converts a nuclide’s z-a-m id into the nuclide’s name.

onix.utils.name_to_zamid

Converts a nuclide’s name into the nuclide’s z-a-m id.

onix.utils.get_hm

Gets the mass of heavy metal in a Passlist object.

onix.utils.get_nucl_atomic_mass

Gets the atomic mass of a nuclide (in grams).

onix.utils.convert_mass_to_atom

Converts the mass quantity (in grams) of a given nuclide type into number of atoms.

onix.utils.convert_atom_to_mass

Converts the quantity of a given nuclide from number of atoms into mass (in grams).

onix.utils.get_bu_sec_conv_factor

Computes the factor that converts seconds into burnup units (MWd/kg) from a given volume and a Initial Heavy Metal mass (IHM).

onix.utils.get_decay_nucl

Gets the list of nuclides from a decay dictionnary.

onix.utils.get_xs_nucl

Gets the list of nuclides from a cross section dictionnary.

onix.utils.get_fy_nucl

Gets the list of fission products from a fission yield dictionnary.

onix.utils.is_lista_in_listb

Check whether elements from a list (lista) are all contained in another list (listb).

onix.utils.get_fy_parent_nucl

Gets the list of fission parents from a fission yield dictionnary.

onix.utils.is_number

Check whether s is a float.

onix.utils.openmc_name_to_onix_name

Converts a nuclide’s name written with OpenMC format (‘U235_m1’) into ONIX format (‘U-235*’).

onix.utils.onix_name_to_openmc_name

Converts a nuclide’s name written with ONIX format (‘U-235*’) into OpenMC format (‘U235_m1’).

onix.utils.bu_namelist_to_mc_namelist

Converts a list of nuclides’ names written with ONIX format (‘U-235*’) into OpenMC format (‘U235_m1’).

onix.utils.mc_namelist_to_bu_namelist

Converts a list of nuclides’ names written with OpenMC format (‘U235_m1’) into ONIX format (‘U-235*’).

onix.utils.order_nuclide_per_z

Orders a list of nuclides’ z-a-m ids according to their atomic number (z).

onix.utils.order_nuclide_name_per_z

Orders a list of nuclides’ names (in OpenMC format) according to their atomic number (z).

onix.utils.order_nuclide_per_a

Orders a list of nuclides’ z-a-m ids according to their mass number (a).

onix.utils.get_openmc_xs_nucl_list

Returns the list of nuclides for which there are cross section data in a specified HDF5 cross section library directory (produced with OpenMC).

onix.utils.convert_spectrum_to_janis_weighting_format

Converts a neutron spectrum output file computed in an ONIX simulations to a format suitable to be used to fold cross sections in JANIS4.1.

onix.utils.get_zamid_natural_abundance

Gets the natural abundance of a nuclide (values from 0 to 1).

onix.utils.get_name_natural_abundance

Gets the natural abundance of a nuclide (values from 0 to 1).

onix.utils.find_zamid_precursor

Finds the precursor of a nuclide via a specified reaction (except fission reactions).

onix.utils.interpolation_between_two_points

Linearly interpolates between two points to find the ordinate to a given abscissa value (x).

Data processors

Various functions to extract, read and visualize output results.

onix.utils.plot_bucell_nuclide_network

Plots a network diagram of the destruction and production reaction rates of a specified nuclide at a given macrostep for a given BUCell.

onix.utils.plot_nuclide_dens_from_path

Plots the density evolution of a given nuclide (in \(atm barn^{-2}cm{-1}\)) in a given BUCell against time (in days).

onix.utils.plot_nuclide_group_dens_from_path

Plots the total density evolution of a group of nuclides (in \(atm barn^{-2}cm{-1}\)) in a given BUCell against time (in days).

onix.utils.plot_xs_time_evolution_from_path

Plots the one-group cross section evolution (in barn) of a given reaction for a given nuclide in a given BUCell against time (in days).

onix.utils.plot_xs_bu_evolution_from_path

Plots the one-group cross section evolution (in barn) of a given reaction for a given nuclide in a given BUCell against burnup (MWd/kg).

onix.utils.compare_xs_bu_evolution_from_path

Plots multiple cross sections from multiple simulation directories in a series of subplots with the same burnup y-axis.

onix.utils.plot_kinf_from_path

Plots the multiplication factor against time (in days).

onix.utils.plot_flux_from_path

Plots the neutron flux against time (in days).

onix.utils.plot_flux_spectrum_bu_evolution_from_path

Plots the neutron spectrum for different macrosteps for multiple BUCells.

onix.utils.plot_lethargy_spectrum_bu_evolution_from_path

Plots the neutron spectrum in lethargy units for different macrosteps for multiple BUCells.

onix.utils.plot_xs_dens_flux

Plots the evolution of a cross section, a nuclide density and the neutron flux in a specified BUCell in three subplots witht the same y-axis in days.

onix.utils.read_time_seq

Reads the time sequence from a simulation’s directory and returns a list of the time sequence.

onix.utils.get_step_time_length_seq

Creates a list with time length between each macrosteps.

onix.utils.read_bu_seq

Reads the burnup sequence from a simulation’s directory and returns a list of the burnup sequence.

onix.utils.read_kinf_seq

Reads the multiplication factor evolution from a simulation’s directory and returns a list of the multiplication factor evolution.

onix.utils.read_flux

Reads the macrostep-wise neutron flux evolution from a simulation’s directory and returns a list with the neutron flux evolution.

onix.utils.read_flux_subseq

Reads the microstep-wise neutron flux evolution from a simulation’s directory and returns a list with the neutron flux evolution.

onix.utils.get_fluence_seq

Returns a list with the macrostep-wise fluence evolution in a specificed BUCell

onix.utils.get_fluence_subseq

Returns a list with the microstep-wise fluence evolution in a specificed BUCell

onix.utils.read_flux_spectrum

Reads the neutron flux spectra for multiple macrosteps from a flux spectrum output file and returns it in a list.

onix.utils.read_energy_mid_points

Reads the mid-points of the energy groups against which the multi-group neutron flux is stored and returns it in a list.

onix.utils.read_energy_bin_length

Reads the energy interval of each energy bin group used to store the multi-group neutron flux and returns it in a list.

onix.utils.read_dens

Reads the density (in \(atm barn^{-2}cm^{-1}\)) of a specified nuclide from the provided density file.

onix.utils.get_total_density

Returns the total density of the material (in \(atm barn^{-2}cm^{-1}\)) in a BUCell at a given macrostep.

onix.utils.get_total_mass_density

Returns the total mass density of the material (in \(g cm^{-3}\)) in a BUCell at a given macrostep.

onix.utils.read_xs_seq

Reads the cross section evolution (in barn) for a specified reactions for a given nuclide in a given BUCell and returns it in a list.

onix.utils.get_time_averaged_xs

Computes time-averaged cross section (in barn) for a specified reactions for a given nuclide in a given BUCell.

onix.utils.get_time_averaged_flux

Computes the time-averaged neutron flux (in \(cm^{-2}s^{-1}\)) in a given BUCell.

onix.utils.get_tot_xs

Computes the total one-group cross section evolution (in barn) for a specified nuclide in a given BUCell.

onix.utils.read_xs_nucl

Returns the list of nuclides for which one-group cross sections have been calculated during a simulation in a given BUCell.

onix.utils.read_dens_nucl

Returns the list of nuclides for which densities have been calculated during a simulation in a given BUCell.

onix.utils.rank_nuclide_per_dens

Print a ranking of nuclides in a BUCell according to their densities for multiple macrosteps in a text file.

onix.utils.plot_matrix_bysign_from_compressed_matrix

Plots the transmuation matrix for a given BUCell at a given macrostep.

onix.utils.plot_nuclide_chart_color_per_nuclear_data

Plots a chart of the nuclide where nuclides are colored only if present in the decay, cross section or fission yield library.

onix.utils.plot_compare_two_nuclear_data_on_nuclide_chart

Plots a chart of the nuclide where nuclides are colored only if present in the decay, cross section or fission yield library.