openmc.deplete.get_microxs_and_flux
- openmc.deplete.get_microxs_and_flux(model: Model, domains: Sequence[Material] | Sequence[Cell] | Sequence[Universe] | MeshBase | Filter | Sequence[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, reaction_rate_opts: dict | None = 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
IndependentOperatorclass.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, or list of openmc.Filter) – Domains in which to tally reaction rates, or a spatial tally filter. A list of filters can be provided to create one set of tallies per filter (e.g., one
MeshMaterialFilterper mesh) that are all evaluated in a single transport solve. Results are concatenated across all filters in order.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) – The “direct” method tallies reaction rates directly (per energy group). The “flux” method tallies a multigroup flux spectrum and then collapses reaction rates after a transport solve. When reaction_rate_opts is provided with reaction_rate_mode=’flux’, the specified nuclide/reaction pairs are tallied directly and those values override the flux-collapsed values.
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()reaction_rate_opts (dict, optional) – When reaction_rate_mode=”flux”, allows selecting a subset of nuclide/reaction pairs to be computed via direct reaction-rate tallies (per energy group). Supported keys: “nuclides”, “reactions”.
- 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
See also