openmc.deplete.get_microxs_and_flux

openmc.deplete.get_microxs_and_flux(model: Model, domains: Sequence[Material] | Sequence[Cell] | Sequence[Universe] | MeshBase | Filter, nuclides: Sequence[str] | None = None, reactions: Sequence[str] | None = None, energies: Sequence[float] | str | None = None, reaction_rate_mode: str = 'direct', chain_file: str | PathLike | Chain | None = None, path_statepoint: str | PathLike | None = None, path_input: str | PathLike | None = None, run_kwargs=None) tuple[list[ndarray], list[MicroXS]][source]

Generate microscopic cross sections and fluxes for multiple domains.

This function runs a neutron transport solve to obtain the flux and reaction rates in the specified domains and computes multigroup microscopic cross sections that can be used in depletion calculations with the IndependentOperator class.

Added in version 0.14.0.

Changed in version 0.15.3: Added reaction_rate_mode, path_statepoint, path_input arguments.

Parameters:
  • model (openmc.Model) – OpenMC model object. Must contain geometry, materials, and settings.

  • domains (list of openmc.Material or openmc.Cell or openmc.Universe, or openmc.MeshBase, or openmc.Filter) – Domains in which to tally reaction rates, or a spatial tally filter.

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

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

  • energies (iterable of float or str) – Energy group boundaries in [eV] or the name of the group structure. If left as None energies will default to [0.0, 100e6]

  • reaction_rate_mode ({"direct", "flux"}, optional) – Indicate how reaction rates should be calculated. The “direct” method tallies reaction rates directly. The “flux” method tallies a multigroup flux spectrum and then collapses multigroup reaction rates after a transport solve (with an option to tally some reaction rates directly).

  • chain_file (PathLike or Chain, optional) – Path to the depletion chain XML file or an instance of openmc.deplete.Chain. Used to determine cross sections for materials not present in the inital composition. Defaults to openmc.config['chain_file'].

  • path_statepoint (path-like, optional) – Path to write the statepoint file from the neutron transport solve to. By default, The statepoint file is written to a temporary directory and is not kept.

  • path_input (path-like, optional) – Path to write the model XML file from the neutron transport solve to. By default, the model XML file is written to a temporary directory and not kept.

  • run_kwargs (dict, optional) – Keyword arguments passed to openmc.Model.run()

Returns:

  • list of numpy.ndarray – Flux in each group in [n-cm/src] for each domain

  • list of MicroXS – Cross section data in [b] for each domain