Skip to content

Commit 4f903fb

Browse files
committed
Make kappa-fission mandatory again.
1 parent c511e45 commit 4f903fb

3 files changed

Lines changed: 17 additions & 43 deletions

File tree

docs/source/usersguide/random_ray.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,8 +646,7 @@ model to use these multigroup cross sections. An example is given below::
646646
overwrite_mgxs_library=False,
647647
mgxs_path="mgxs.h5",
648648
correction=None,
649-
source_energy=None,
650-
gen_kappa_fission=True
649+
source_energy=None
651650
)
652651

653652
The most important parameter to set is the ``method`` parameter, which can be

openmc/model/model.py

Lines changed: 15 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,7 +1778,6 @@ def _generate_infinite_medium_mgxs(
17781778
correction: str | None,
17791779
directory: PathLike,
17801780
source_energy: openmc.stats.Univariate | None = None,
1781-
gen_kappa_fission: bool = False,
17821781
):
17831782
"""Generate a MGXS library by running multiple OpenMC simulations, each
17841783
representing an infinite medium simulation of a single isolated
@@ -1817,9 +1816,6 @@ def _generate_infinite_medium_mgxs(
18171816
source_energy : openmc.stats.Univariate, optional
18181817
Energy distribution to use when generating MGXS data, replacing any
18191818
existing sources in the model.
1820-
gen_kappa_fission : bool, optional
1821-
Whether fission heating cross sections (kappa-fission) should be
1822-
generated.
18231819
"""
18241820
mgxs_sets = []
18251821
for material in self.materials:
@@ -1866,18 +1862,16 @@ def _generate_infinite_medium_mgxs(
18661862
if correction == 'P0':
18671863
mgxs_lib.mgxs_types = [
18681864
'nu-transport', 'absorption', 'nu-fission', 'fission',
1869-
'consistent nu-scatter matrix', 'multiplicity matrix', 'chi'
1865+
'consistent nu-scatter matrix', 'multiplicity matrix', 'chi',
1866+
'kappa-fission'
18701867
]
18711868
elif correction is None:
18721869
mgxs_lib.mgxs_types = [
18731870
'total', 'absorption', 'nu-fission', 'fission',
1874-
'consistent nu-scatter matrix', 'multiplicity matrix', 'chi'
1871+
'consistent nu-scatter matrix', 'multiplicity matrix', 'chi',
1872+
'kappa-fission'
18751873
]
18761874

1877-
# Generate kappa-fission cross sections if requested
1878-
if gen_kappa_fission:
1879-
mgxs_lib.mgxs_types.append('kappa-fission')
1880-
18811875
# Specify a "cell" domain type for the cross section tally filters
18821876
mgxs_lib.domain_type = "material"
18831877

@@ -1995,7 +1989,6 @@ def _generate_stochastic_slab_mgxs(
19951989
correction: str | None,
19961990
directory: PathLike,
19971991
source_energy: openmc.stats.Univariate | None = None,
1998-
gen_kappa_fission: bool = False,
19991992
) -> None:
20001993
"""Generate MGXS assuming a stochastic "sandwich" of materials in a layered
20011994
slab geometry. While geometry-specific spatial shielding effects are not
@@ -2037,9 +2030,6 @@ def _generate_stochastic_slab_mgxs(
20372030
no sources are defined on the model and the run mode is
20382031
'eigenvalue', then a default Watt spectrum source (strength = 0.99)
20392032
is added.
2040-
gen_kappa_fission : bool, optional
2041-
Whether fission heating cross sections (kappa-fission) should be
2042-
generated.
20432033
"""
20442034
model = openmc.Model()
20452035
model.materials = self.materials
@@ -2080,14 +2070,12 @@ def _generate_stochastic_slab_mgxs(
20802070
# Specify needed cross sections for random ray
20812071
if correction == 'P0':
20822072
mgxs_lib.mgxs_types = ['nu-transport', 'absorption', 'nu-fission', 'fission',
2083-
'consistent nu-scatter matrix', 'multiplicity matrix', 'chi']
2073+
'consistent nu-scatter matrix', 'multiplicity matrix', 'chi',
2074+
'kappa-fission']
20842075
elif correction is None:
20852076
mgxs_lib.mgxs_types = ['total', 'absorption', 'nu-fission', 'fission',
2086-
'consistent nu-scatter matrix', 'multiplicity matrix', 'chi']
2087-
2088-
# Generate kappa-fission cross sections if requested
2089-
if gen_kappa_fission:
2090-
mgxs_lib.mgxs_types.append('kappa-fission')
2077+
'consistent nu-scatter matrix', 'multiplicity matrix', 'chi',
2078+
'kappa-fission']
20912079

20922080
# Specify a "cell" domain type for the cross section tally filters
20932081
mgxs_lib.domain_type = "material"
@@ -2127,7 +2115,6 @@ def _generate_material_wise_mgxs(
21272115
mgxs_path: PathLike,
21282116
correction: str | None,
21292117
directory: PathLike,
2130-
gen_kappa_fission: bool = False,
21312118
) -> None:
21322119
"""Generate a material-wise MGXS library for the model by running the
21332120
original continuous energy OpenMC simulation of the full material
@@ -2152,9 +2139,6 @@ def _generate_material_wise_mgxs(
21522139
"P0".
21532140
directory : PathLike
21542141
Directory to run the simulation in, so as to contain XML files.
2155-
gen_kappa_fission : bool, optional
2156-
Whether fission heating cross sections (kappa-fission) should be
2157-
generated.
21582142
"""
21592143
model = copy.deepcopy(self)
21602144
model.tallies = openmc.Tallies()
@@ -2180,18 +2164,16 @@ def _generate_material_wise_mgxs(
21802164
if correction == 'P0':
21812165
mgxs_lib.mgxs_types = [
21822166
'nu-transport', 'absorption', 'nu-fission', 'fission',
2183-
'consistent nu-scatter matrix', 'multiplicity matrix', 'chi'
2167+
'consistent nu-scatter matrix', 'multiplicity matrix', 'chi',
2168+
'kappa-fission'
21842169
]
21852170
elif correction is None:
21862171
mgxs_lib.mgxs_types = [
21872172
'total', 'absorption', 'nu-fission', 'fission',
2188-
'consistent nu-scatter matrix', 'multiplicity matrix', 'chi'
2173+
'consistent nu-scatter matrix', 'multiplicity matrix', 'chi',
2174+
'kappa-fission'
21892175
]
21902176

2191-
# Generate kappa-fission cross sections if requested
2192-
if gen_kappa_fission:
2193-
mgxs_lib.mgxs_types.append('kappa-fission')
2194-
21952177
# Specify a "cell" domain type for the cross section tally filters
21962178
mgxs_lib.domain_type = "material"
21972179

@@ -2233,7 +2215,6 @@ def convert_to_multigroup(
22332215
mgxs_path: PathLike = "mgxs.h5",
22342216
correction: str | None = None,
22352217
source_energy: openmc.stats.Univariate | None = None,
2236-
gen_kappa_fission: bool = False,
22372218
):
22382219
"""Convert all materials from continuous energy to multigroup.
22392220
@@ -2274,9 +2255,6 @@ def convert_to_multigroup(
22742255
'eigenvalue', then a default Watt spectrum source (strength = 0.99)
22752256
is added. Note that this argument is only used when using the
22762257
"stochastic_slab" or "infinite_medium" MGXS generation methods.
2277-
gen_kappa_fission : bool, optional
2278-
Whether fission heating cross sections (kappa-fission) should be
2279-
generated.
22802258
"""
22812259
if isinstance(groups, str):
22822260
groups = openmc.mgxs.EnergyGroups(groups)
@@ -2306,15 +2284,13 @@ def convert_to_multigroup(
23062284
if not Path(mgxs_path).is_file() or overwrite_mgxs_library:
23072285
if method == "infinite_medium":
23082286
self._generate_infinite_medium_mgxs(
2309-
groups, nparticles, mgxs_path, correction, tmpdir, source_energy,
2310-
gen_kappa_fission)
2287+
groups, nparticles, mgxs_path, correction, tmpdir, source_energy)
23112288
elif method == "material_wise":
23122289
self._generate_material_wise_mgxs(
2313-
groups, nparticles, mgxs_path, correction, tmpdir, gen_kappa_fission)
2290+
groups, nparticles, mgxs_path, correction, tmpdir)
23142291
elif method == "stochastic_slab":
23152292
self._generate_stochastic_slab_mgxs(
2316-
groups, nparticles, mgxs_path, correction, tmpdir, source_energy,
2317-
gen_kappa_fission)
2293+
groups, nparticles, mgxs_path, correction, tmpdir, source_energy)
23182294
else:
23192295
raise ValueError(
23202296
f'MGXS generation method "{method}" not recognized')

tests/regression_tests/random_ray_auto_convert_kappa_fission/test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ def test_random_ray_auto_convert(method):
2828
# Convert to a multi-group model
2929
model.convert_to_multigroup(
3030
method=method, groups='CASMO-2', nparticles=100,
31-
overwrite_mgxs_library=False, mgxs_path="mgxs.h5",
32-
gen_kappa_fission=True
31+
overwrite_mgxs_library=False, mgxs_path="mgxs.h5"
3332
)
3433

3534
# Convert to a random ray model

0 commit comments

Comments
 (0)