Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions openmc/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2520,7 +2520,7 @@ def _generate_material_wise_mgxs(
def convert_to_multigroup(
self,
method: str = "material_wise",
groups: str = "CASMO-2",
groups: str | Sequence[float] | openmc.mgxs.EnergyGroups = "CASMO-2",
nparticles: int = 2000,
overwrite_mgxs_library: bool = False,
mgxs_path: PathLike = "mgxs.h5",
Expand All @@ -2538,9 +2538,13 @@ def convert_to_multigroup(
----------
method : {"material_wise", "stochastic_slab", "infinite_medium"}, optional
Method to generate the MGXS.
groups : openmc.mgxs.EnergyGroups or str, optional
Energy group structure for the MGXS or the name of the group
structure (based on keys from openmc.mgxs.GROUP_STRUCTURES).
groups : openmc.mgxs.EnergyGroups, str, or sequence of float, optional
Energy group structure for the MGXS. Can be an
:class:`openmc.mgxs.EnergyGroups` object, a string name of a
predefined group structure from :data:`openmc.mgxs.GROUP_STRUCTURES`
(e.g., ``"CASMO-2"``), or a sequence of floats specifying energy
bin boundaries in eV (e.g., ``[0.0, 1e6]`` for a single group).
Defaults to ``"CASMO-2"``.
nparticles : int, optional
Number of particles to simulate per batch when generating MGXS.
overwrite_mgxs_library : bool, optional
Expand Down Expand Up @@ -2577,7 +2581,7 @@ def convert_to_multigroup(
Valid entries for temperature_settings are the same as the valid
entries in openmc.Settings.temperature_settings.
"""
if isinstance(groups, str):
if not isinstance(groups, openmc.mgxs.EnergyGroups):
groups = openmc.mgxs.EnergyGroups(groups)

# Do all work (including MGXS generation) in a temporary directory
Expand Down
Loading