openmc.deplete.MicroXS

class openmc.deplete.MicroXS(data: ndarray, nuclides: list[str], reactions: list[str])[source]

Microscopic cross section data for use in transport-independent depletion.

Added in version 0.13.1.

Changed in version 0.14.0: Class was heavily refactored and no longer subclasses pandas.DataFrame.

Parameters:
  • data (numpy.ndarray of floats) – 3D array containing microscopic cross section values for each nuclide, reaction, and energy group. Cross section values are assumed to be in [b], and indexed by [nuclide, reaction, energy group]

  • nuclides (list of str) – List of nuclide symbols for that have data for at least one reaction.

  • reactions (list of str) – List of reactions. All reactions must match those in openmc.deplete.chain.REACTIONS

classmethod from_csv(csv_file, **kwargs)[source]

Load data from a comma-separated values (csv) file.

Parameters:
  • csv_file (str) – Relative path to csv-file containing microscopic cross section data. Cross section values are assumed to be in [b]

  • **kwargs (dict) – Keyword arguments to pass to pandas.read_csv().

Return type:

MicroXS

classmethod from_hdf5(group_or_filename: Group | str | PathLike) Self[source]

Load data from an HDF5 file

Parameters:

group_or_filename (h5py.Group or str or PathLike) – HDF5 group or path to HDF5 file. If given as an h5py.Group, the data is read from that group. If given as a string, it is assumed to be the filename for the HDF5 file.

Return type:

MicroXS

classmethod from_multigroup_flux(energies: Sequence[float] | str, multigroup_flux: Sequence[float], chain_file: str | PathLike | None = None, temperature: float = 293.6, nuclides: Sequence[str] | None = None, reactions: Sequence[str] | None = None, **init_kwargs: dict) MicroXS[source]

Generated microscopic cross sections from a known flux.

The size of the MicroXS matrix depends on the chain file and cross sections available. MicroXS entry will be 0 if the nuclide cross section is not found.

It is recommended to make repeated calls to this method within a context manager using the openmc.lib.TemporarySession class to avoid re-initializing OpenMC and loading cross sections each time.

Added in version 0.15.0.

Parameters:
  • energies (iterable of float or str) – Energy group boundaries in [eV] or the name of the group structure

  • multigroup_flux (iterable of float) – Energy-dependent multigroup flux values

  • chain_file (PathLike or Chain, optional) – Path to the depletion chain XML file or an instance of openmc.deplete.Chain. Defaults to openmc.config['chain_file'].

  • temperature (int, optional) – Temperature for cross section evaluation in [K].

  • nuclides (list of str, optional) – Nuclides to get cross sections for. If not specified, all burnable nuclides from the depletion chain file are used.

  • reactions (list of str, optional) – Reactions to get cross sections for. If not specified, all neutron reactions listed in the depletion chain file are used.

  • **init_kwargs (dict) – Keyword arguments passed to openmc.lib.init()

Return type:

MicroXS

to_csv(*args, **kwargs)[source]

Write data to a comma-separated values (csv) file

Parameters:
to_hdf5(group_or_filename: Group | str | PathLike, **kwargs)[source]

Export microscopic cross section data to HDF5 format

Parameters:
  • group_or_filename (h5py.Group or path-like) – HDF5 group or filename to write to

  • kwargs (dict, optional) – Keyword arguments to pass to h5py.Group.create_dataset(). Defaults to {‘compression’: ‘lzf’}.