From 3bfa4e9f0e99056c8e8a97d73c2e9ff904c8bdc4 Mon Sep 17 00:00:00 2001 From: nuclearkevin <66632997+nuclearkevin@users.noreply.github.com> Date: Thu, 8 Jan 2026 12:50:10 -0600 Subject: [PATCH 1/9] Add kappa-fission to the list of required random ray MGXS. --- openmc/model/model.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openmc/model/model.py b/openmc/model/model.py index ca78f282f6a..90b43f9f74f 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -1729,12 +1729,14 @@ def _auto_generate_mgxs_lib( if correction == 'P0': mgxs_lib.mgxs_types = [ 'nu-transport', 'absorption', 'nu-fission', 'fission', - 'consistent nu-scatter matrix', 'multiplicity matrix', 'chi' + 'consistent nu-scatter matrix', 'multiplicity matrix', 'chi', + 'kappa-fission' ] elif correction is None: mgxs_lib.mgxs_types = [ 'total', 'absorption', 'nu-fission', 'fission', - 'consistent nu-scatter matrix', 'multiplicity matrix', 'chi' + 'consistent nu-scatter matrix', 'multiplicity matrix', 'chi', + 'kappa-fission' ] # Specify a "material" domain type for the cross section tally filters From a7614c745b362ff38d980f19f9cbed5d538cfa70 Mon Sep 17 00:00:00 2001 From: nuclearkevin <66632997+nuclearkevin@users.noreply.github.com> Date: Thu, 8 Jan 2026 13:14:06 -0600 Subject: [PATCH 2/9] Support kappa-fission tallying in the random ray solver. --- include/openmc/random_ray/flat_source_domain.h | 1 + src/random_ray/flat_source_domain.cpp | 13 +++++++++++-- src/random_ray/random_ray_simulation.cpp | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/openmc/random_ray/flat_source_domain.h b/include/openmc/random_ray/flat_source_domain.h index 4df4e5d8d32..0d4086966dd 100644 --- a/include/openmc/random_ray/flat_source_domain.h +++ b/include/openmc/random_ray/flat_source_domain.h @@ -107,6 +107,7 @@ class FlatSourceDomain { vector nu_sigma_f_; vector sigma_f_; vector chi_; + vector kappa_fission_; // 3D arrays stored in 1D representing values for all materials x energy // groups x energy groups diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index 2f5007fc927..f4fcd79974b 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -665,10 +665,14 @@ void FlatSourceDomain::random_ray_tally() score = 1.0; break; + case SCORE_KAPPA_FISSION: + score = flux * volume * kappa_fission_[material * negroups_ + g]; + break; + default: fatal_error("Invalid score specified in tallies.xml. Only flux, " - "total, fission, nu-fission, and events are supported in " - "random ray mode."); + "total, fission, nu-fission, kappa-fission, and events " + "are supported in random ray mode."); break; } // Apply score to the appropriate tally bin @@ -1165,6 +1169,10 @@ void FlatSourceDomain::flatten_xs() } chi_.push_back(chi); + double kappa_fission = + m.get_xs(MgxsType::KAPPA_FISSION, g_out, NULL, NULL, NULL, t, a); + kappa_fission_.push_back(kappa_fission); + for (int g_in = 0; g_in < negroups_; g_in++) { double sigma_s = m.get_xs(MgxsType::NU_SCATTER, g_in, &g_out, NULL, NULL, t, a); @@ -1180,6 +1188,7 @@ void FlatSourceDomain::flatten_xs() nu_sigma_f_.push_back(0); sigma_f_.push_back(0); chi_.push_back(0); + kappa_fission_.push_back(0); for (int g_in = 0; g_in < negroups_; g_in++) { sigma_s_.push_back(0); } diff --git a/src/random_ray/random_ray_simulation.cpp b/src/random_ray/random_ray_simulation.cpp index 2b54ae2eb79..f0baa9ee4dc 100644 --- a/src/random_ray/random_ray_simulation.cpp +++ b/src/random_ray/random_ray_simulation.cpp @@ -83,6 +83,7 @@ void validate_random_ray_inputs() case SCORE_FISSION: case SCORE_NU_FISSION: case SCORE_EVENTS: + case SCORE_KAPPA_FISSION: break; default: fatal_error( From c30929e48c84dc7d86f807e1851e64825d8d1c36 Mon Sep 17 00:00:00 2001 From: nuclearkevin <66632997+nuclearkevin@users.noreply.github.com> Date: Thu, 8 Jan 2026 15:40:57 -0600 Subject: [PATCH 3/9] Add a test for scoring kappa-fission for the random ray solver. --- .../__init__.py | 0 .../infinite_medium/inputs_true.dat | 73 +++++++++++++++++++ .../infinite_medium/results_true.dat | 5 ++ .../material_wise/inputs_true.dat | 73 +++++++++++++++++++ .../material_wise/results_true.dat | 5 ++ .../stochastic_slab/inputs_true.dat | 73 +++++++++++++++++++ .../stochastic_slab/results_true.dat | 5 ++ .../test.py | 60 +++++++++++++++ 8 files changed, 294 insertions(+) create mode 100644 tests/regression_tests/random_ray_auto_convert_kappa_fission/__init__.py create mode 100644 tests/regression_tests/random_ray_auto_convert_kappa_fission/infinite_medium/inputs_true.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kappa_fission/infinite_medium/results_true.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kappa_fission/material_wise/inputs_true.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kappa_fission/material_wise/results_true.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kappa_fission/stochastic_slab/inputs_true.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kappa_fission/stochastic_slab/results_true.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kappa_fission/test.py diff --git a/tests/regression_tests/random_ray_auto_convert_kappa_fission/__init__.py b/tests/regression_tests/random_ray_auto_convert_kappa_fission/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/regression_tests/random_ray_auto_convert_kappa_fission/infinite_medium/inputs_true.dat b/tests/regression_tests/random_ray_auto_convert_kappa_fission/infinite_medium/inputs_true.dat new file mode 100644 index 00000000000..9f3a827f687 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kappa_fission/infinite_medium/inputs_true.dat @@ -0,0 +1,73 @@ + + + + mgxs.h5 + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + + + -0.63 -0.63 -1 0.63 0.63 1 + + + true + + + multi-group + + + + -0.63 -0.63 -1.0 0.63 0.63 1.0 + + + 30.0 + 150.0 + + + + + + linear + + + 2 2 + -0.63 -0.63 + 0.63 0.63 + + + + + 1 + + + 61 + kappa-fission + + + diff --git a/tests/regression_tests/random_ray_auto_convert_kappa_fission/infinite_medium/results_true.dat b/tests/regression_tests/random_ray_auto_convert_kappa_fission/infinite_medium/results_true.dat new file mode 100644 index 00000000000..27b32d787bc --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kappa_fission/infinite_medium/results_true.dat @@ -0,0 +1,5 @@ +k-combined: +7.479770E-01 1.624548E-02 +tally 1: +2.965503E+08 +1.762157E+16 diff --git a/tests/regression_tests/random_ray_auto_convert_kappa_fission/material_wise/inputs_true.dat b/tests/regression_tests/random_ray_auto_convert_kappa_fission/material_wise/inputs_true.dat new file mode 100644 index 00000000000..edf68f7e25b --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kappa_fission/material_wise/inputs_true.dat @@ -0,0 +1,73 @@ + + + + mgxs.h5 + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + + + -0.63 -0.63 -1 0.63 0.63 1 + + + true + + + multi-group + + + + -0.63 -0.63 -1.0 0.63 0.63 1.0 + + + 30.0 + 150.0 + + + + + + linear + + + 2 2 + -0.63 -0.63 + 0.63 0.63 + + + + + 1 + + + 97 + kappa-fission + + + diff --git a/tests/regression_tests/random_ray_auto_convert_kappa_fission/material_wise/results_true.dat b/tests/regression_tests/random_ray_auto_convert_kappa_fission/material_wise/results_true.dat new file mode 100644 index 00000000000..5a379db7e33 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kappa_fission/material_wise/results_true.dat @@ -0,0 +1,5 @@ +k-combined: +7.372542E-01 6.967831E-03 +tally 1: +2.909255E+08 +1.693395E+16 diff --git a/tests/regression_tests/random_ray_auto_convert_kappa_fission/stochastic_slab/inputs_true.dat b/tests/regression_tests/random_ray_auto_convert_kappa_fission/stochastic_slab/inputs_true.dat new file mode 100644 index 00000000000..edf68f7e25b --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kappa_fission/stochastic_slab/inputs_true.dat @@ -0,0 +1,73 @@ + + + + mgxs.h5 + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + + + -0.63 -0.63 -1 0.63 0.63 1 + + + true + + + multi-group + + + + -0.63 -0.63 -1.0 0.63 0.63 1.0 + + + 30.0 + 150.0 + + + + + + linear + + + 2 2 + -0.63 -0.63 + 0.63 0.63 + + + + + 1 + + + 97 + kappa-fission + + + diff --git a/tests/regression_tests/random_ray_auto_convert_kappa_fission/stochastic_slab/results_true.dat b/tests/regression_tests/random_ray_auto_convert_kappa_fission/stochastic_slab/results_true.dat new file mode 100644 index 00000000000..a60e5aa3c6f --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kappa_fission/stochastic_slab/results_true.dat @@ -0,0 +1,5 @@ +k-combined: +6.413334E-01 2.083132E-02 +tally 1: +2.541463E+08 +1.297259E+16 diff --git a/tests/regression_tests/random_ray_auto_convert_kappa_fission/test.py b/tests/regression_tests/random_ray_auto_convert_kappa_fission/test.py new file mode 100644 index 00000000000..6decf165a7f --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kappa_fission/test.py @@ -0,0 +1,60 @@ +import os + +import openmc +from openmc.examples import pwr_pin_cell +from openmc import RegularMesh +from openmc.utility_funcs import change_directory +import pytest + +from tests.testing_harness import TolerantPyAPITestHarness + + +class MGXSTestHarness(TolerantPyAPITestHarness): + def _cleanup(self): + super()._cleanup() + f = 'mgxs.h5' + if os.path.exists(f): + os.remove(f) + + +@pytest.mark.parametrize("method", ["material_wise", "stochastic_slab", "infinite_medium"]) +def test_random_ray_auto_convert(method): + with change_directory(method): + openmc.reset_auto_ids() + + # Start with a normal continuous energy model + model = pwr_pin_cell() + + # Convert to a multi-group model + model.convert_to_multigroup( + method=method, groups='CASMO-2', nparticles=100, + overwrite_mgxs_library=False, mgxs_path="mgxs.h5" + ) + + # Convert to a random ray model + model.convert_to_random_ray() + + # Set the number of particles + model.settings.particles = 100 + + # Overlay a basic 2x2 mesh + n = 2 + mesh = RegularMesh() + mesh.dimension = (n, n) + bbox = model.geometry.bounding_box + mesh.lower_left = (bbox.lower_left[0], bbox.lower_left[1]) + mesh.upper_right = (bbox.upper_right[0], bbox.upper_right[1]) + model.settings.random_ray['source_region_meshes'] = [ + (mesh, [model.geometry.root_universe])] + + # Set the source shape to linear + model.settings.random_ray['source_shape'] = 'linear' + + # Set a material tally + t = openmc.Tally(name = 'KF Tally') + t.filters = [openmc.MaterialFilter(bins=1)] + t.scores = ['kappa-fission'] + model.tallies.append(t) + + harness = MGXSTestHarness('statepoint.10.h5', model) + harness.main() From fdd9354a46ad7290dafc20bcc8fc86ae192c0eff Mon Sep 17 00:00:00 2001 From: nuclearkevin <66632997+nuclearkevin@users.noreply.github.com> Date: Thu, 8 Jan 2026 15:52:07 -0600 Subject: [PATCH 4/9] Make the generation of fission heating cross sections optional. --- openmc/model/model.py | 24 ++++++++++++++++--- .../test.py | 3 ++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/openmc/model/model.py b/openmc/model/model.py index 90b43f9f74f..1693a3a7a5d 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -1859,6 +1859,7 @@ def _generate_infinite_medium_mgxs( correction: str | None, directory: PathLike, source_energy: openmc.stats.Univariate | None = None, + gen_kappa_fission: bool = False, ): """Generate a MGXS library by running multiple OpenMC simulations, each representing an infinite medium simulation of a single isolated @@ -1897,6 +1898,9 @@ def _generate_infinite_medium_mgxs( source_energy : openmc.stats.Univariate, optional Energy distribution to use when generating MGXS data, replacing any existing sources in the model. + gen_kappa_fission : bool, optional + Whether fission heating cross sections (kappa-fission) should be + generated. """ mgxs_sets = [] for material in self.materials: @@ -2024,6 +2028,7 @@ def _generate_stochastic_slab_mgxs( correction: str | None, directory: PathLike, source_energy: openmc.stats.Univariate | None = None, + gen_kappa_fission: bool = False, ) -> None: """Generate MGXS assuming a stochastic "sandwich" of materials in a layered slab geometry. While geometry-specific spatial shielding effects are not @@ -2065,6 +2070,9 @@ def _generate_stochastic_slab_mgxs( no sources are defined on the model and the run mode is 'eigenvalue', then a default Watt spectrum source (strength = 0.99) is added. + gen_kappa_fission : bool, optional + Whether fission heating cross sections (kappa-fission) should be + generated. """ model = openmc.Model() model.materials = self.materials @@ -2108,6 +2116,7 @@ def _generate_material_wise_mgxs( mgxs_path: PathLike, correction: str | None, directory: PathLike, + gen_kappa_fission: bool = False, ) -> None: """Generate a material-wise MGXS library for the model by running the original continuous energy OpenMC simulation of the full material @@ -2132,6 +2141,9 @@ def _generate_material_wise_mgxs( "P0". directory : PathLike Directory to run the simulation in, so as to contain XML files. + gen_kappa_fission : bool, optional + Whether fission heating cross sections (kappa-fission) should be + generated. """ model = copy.deepcopy(self) model.tallies = openmc.Tallies() @@ -2162,6 +2174,7 @@ def convert_to_multigroup( mgxs_path: PathLike = "mgxs.h5", correction: str | None = None, source_energy: openmc.stats.Univariate | None = None, + gen_kappa_fission: bool = False, ): """Convert all materials from continuous energy to multigroup. @@ -2202,6 +2215,9 @@ def convert_to_multigroup( 'eigenvalue', then a default Watt spectrum source (strength = 0.99) is added. Note that this argument is only used when using the "stochastic_slab" or "infinite_medium" MGXS generation methods. + gen_kappa_fission : bool, optional + Whether fission heating cross sections (kappa-fission) should be + generated. """ if isinstance(groups, str): groups = openmc.mgxs.EnergyGroups(groups) @@ -2231,13 +2247,15 @@ def convert_to_multigroup( if not Path(mgxs_path).is_file() or overwrite_mgxs_library: if method == "infinite_medium": self._generate_infinite_medium_mgxs( - groups, nparticles, mgxs_path, correction, tmpdir, source_energy) + groups, nparticles, mgxs_path, correction, tmpdir, source_energy, + gen_kappa_fission) elif method == "material_wise": self._generate_material_wise_mgxs( - groups, nparticles, mgxs_path, correction, tmpdir) + groups, nparticles, mgxs_path, correction, tmpdir, gen_kappa_fission) elif method == "stochastic_slab": self._generate_stochastic_slab_mgxs( - groups, nparticles, mgxs_path, correction, tmpdir, source_energy) + groups, nparticles, mgxs_path, correction, tmpdir, source_energy, + gen_kappa_fission) else: raise ValueError( f'MGXS generation method "{method}" not recognized') diff --git a/tests/regression_tests/random_ray_auto_convert_kappa_fission/test.py b/tests/regression_tests/random_ray_auto_convert_kappa_fission/test.py index 6decf165a7f..d88d1a0b320 100644 --- a/tests/regression_tests/random_ray_auto_convert_kappa_fission/test.py +++ b/tests/regression_tests/random_ray_auto_convert_kappa_fission/test.py @@ -28,7 +28,8 @@ def test_random_ray_auto_convert(method): # Convert to a multi-group model model.convert_to_multigroup( method=method, groups='CASMO-2', nparticles=100, - overwrite_mgxs_library=False, mgxs_path="mgxs.h5" + overwrite_mgxs_library=False, mgxs_path="mgxs.h5", + gen_kappa_fission=True ) # Convert to a random ray model From 0bfa13821b57f72718cfa3e6bdc27a0a7b6c3914 Mon Sep 17 00:00:00 2001 From: nuclearkevin <66632997+nuclearkevin@users.noreply.github.com> Date: Thu, 8 Jan 2026 16:01:32 -0600 Subject: [PATCH 5/9] Minor documentation changes. --- docs/source/usersguide/random_ray.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/source/usersguide/random_ray.rst b/docs/source/usersguide/random_ray.rst index 382381a9eea..3891fb040c7 100644 --- a/docs/source/usersguide/random_ray.rst +++ b/docs/source/usersguide/random_ray.rst @@ -513,6 +513,7 @@ Supported scores: - total - fission - nu-fission + - kappa-fission - events Supported Estimators: @@ -645,7 +646,8 @@ model to use these multigroup cross sections. An example is given below:: overwrite_mgxs_library=False, mgxs_path="mgxs.h5", correction=None, - source_energy=None + source_energy=None, + gen_kappa_fission=True ) The most important parameter to set is the ``method`` parameter, which can be From aedd54c6eddf3d7b3252b553aa120e328c078b54 Mon Sep 17 00:00:00 2001 From: nuclearkevin <66632997+nuclearkevin@users.noreply.github.com> Date: Thu, 8 Jan 2026 17:29:25 -0600 Subject: [PATCH 6/9] Error message. --- src/random_ray/random_ray_simulation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/random_ray/random_ray_simulation.cpp b/src/random_ray/random_ray_simulation.cpp index f0baa9ee4dc..7bab3a9b1b6 100644 --- a/src/random_ray/random_ray_simulation.cpp +++ b/src/random_ray/random_ray_simulation.cpp @@ -87,8 +87,8 @@ void validate_random_ray_inputs() break; default: fatal_error( - "Invalid score specified. Only flux, total, fission, nu-fission, and " - "event scores are supported in random ray mode."); + "Invalid score specified. Only flux, total, fission, nu-fission, " + "kappa-fission, and event scores are supported in random ray mode."); } } From 2c5b67802f174b519020725f5d5c5afb77f9628f Mon Sep 17 00:00:00 2001 From: nuclearkevin <66632997+nuclearkevin@users.noreply.github.com> Date: Fri, 9 Jan 2026 14:25:41 -0600 Subject: [PATCH 7/9] Trigger tests From 089f67e167088f7718d87131bfb69cb480547940 Mon Sep 17 00:00:00 2001 From: nuclearkevin <66632997+nuclearkevin@users.noreply.github.com> Date: Tue, 13 Jan 2026 10:33:51 -0600 Subject: [PATCH 8/9] Make kappa-fission mandatory again. --- docs/source/usersguide/random_ray.rst | 3 +-- openmc/model/model.py | 24 +++---------------- .../test.py | 3 +-- 3 files changed, 5 insertions(+), 25 deletions(-) diff --git a/docs/source/usersguide/random_ray.rst b/docs/source/usersguide/random_ray.rst index 3891fb040c7..64ef7de6d54 100644 --- a/docs/source/usersguide/random_ray.rst +++ b/docs/source/usersguide/random_ray.rst @@ -646,8 +646,7 @@ model to use these multigroup cross sections. An example is given below:: overwrite_mgxs_library=False, mgxs_path="mgxs.h5", correction=None, - source_energy=None, - gen_kappa_fission=True + source_energy=None ) The most important parameter to set is the ``method`` parameter, which can be diff --git a/openmc/model/model.py b/openmc/model/model.py index 1693a3a7a5d..90b43f9f74f 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -1859,7 +1859,6 @@ def _generate_infinite_medium_mgxs( correction: str | None, directory: PathLike, source_energy: openmc.stats.Univariate | None = None, - gen_kappa_fission: bool = False, ): """Generate a MGXS library by running multiple OpenMC simulations, each representing an infinite medium simulation of a single isolated @@ -1898,9 +1897,6 @@ def _generate_infinite_medium_mgxs( source_energy : openmc.stats.Univariate, optional Energy distribution to use when generating MGXS data, replacing any existing sources in the model. - gen_kappa_fission : bool, optional - Whether fission heating cross sections (kappa-fission) should be - generated. """ mgxs_sets = [] for material in self.materials: @@ -2028,7 +2024,6 @@ def _generate_stochastic_slab_mgxs( correction: str | None, directory: PathLike, source_energy: openmc.stats.Univariate | None = None, - gen_kappa_fission: bool = False, ) -> None: """Generate MGXS assuming a stochastic "sandwich" of materials in a layered slab geometry. While geometry-specific spatial shielding effects are not @@ -2070,9 +2065,6 @@ def _generate_stochastic_slab_mgxs( no sources are defined on the model and the run mode is 'eigenvalue', then a default Watt spectrum source (strength = 0.99) is added. - gen_kappa_fission : bool, optional - Whether fission heating cross sections (kappa-fission) should be - generated. """ model = openmc.Model() model.materials = self.materials @@ -2116,7 +2108,6 @@ def _generate_material_wise_mgxs( mgxs_path: PathLike, correction: str | None, directory: PathLike, - gen_kappa_fission: bool = False, ) -> None: """Generate a material-wise MGXS library for the model by running the original continuous energy OpenMC simulation of the full material @@ -2141,9 +2132,6 @@ def _generate_material_wise_mgxs( "P0". directory : PathLike Directory to run the simulation in, so as to contain XML files. - gen_kappa_fission : bool, optional - Whether fission heating cross sections (kappa-fission) should be - generated. """ model = copy.deepcopy(self) model.tallies = openmc.Tallies() @@ -2174,7 +2162,6 @@ def convert_to_multigroup( mgxs_path: PathLike = "mgxs.h5", correction: str | None = None, source_energy: openmc.stats.Univariate | None = None, - gen_kappa_fission: bool = False, ): """Convert all materials from continuous energy to multigroup. @@ -2215,9 +2202,6 @@ def convert_to_multigroup( 'eigenvalue', then a default Watt spectrum source (strength = 0.99) is added. Note that this argument is only used when using the "stochastic_slab" or "infinite_medium" MGXS generation methods. - gen_kappa_fission : bool, optional - Whether fission heating cross sections (kappa-fission) should be - generated. """ if isinstance(groups, str): groups = openmc.mgxs.EnergyGroups(groups) @@ -2247,15 +2231,13 @@ def convert_to_multigroup( if not Path(mgxs_path).is_file() or overwrite_mgxs_library: if method == "infinite_medium": self._generate_infinite_medium_mgxs( - groups, nparticles, mgxs_path, correction, tmpdir, source_energy, - gen_kappa_fission) + groups, nparticles, mgxs_path, correction, tmpdir, source_energy) elif method == "material_wise": self._generate_material_wise_mgxs( - groups, nparticles, mgxs_path, correction, tmpdir, gen_kappa_fission) + groups, nparticles, mgxs_path, correction, tmpdir) elif method == "stochastic_slab": self._generate_stochastic_slab_mgxs( - groups, nparticles, mgxs_path, correction, tmpdir, source_energy, - gen_kappa_fission) + groups, nparticles, mgxs_path, correction, tmpdir, source_energy) else: raise ValueError( f'MGXS generation method "{method}" not recognized') diff --git a/tests/regression_tests/random_ray_auto_convert_kappa_fission/test.py b/tests/regression_tests/random_ray_auto_convert_kappa_fission/test.py index d88d1a0b320..6decf165a7f 100644 --- a/tests/regression_tests/random_ray_auto_convert_kappa_fission/test.py +++ b/tests/regression_tests/random_ray_auto_convert_kappa_fission/test.py @@ -28,8 +28,7 @@ def test_random_ray_auto_convert(method): # Convert to a multi-group model model.convert_to_multigroup( method=method, groups='CASMO-2', nparticles=100, - overwrite_mgxs_library=False, mgxs_path="mgxs.h5", - gen_kappa_fission=True + overwrite_mgxs_library=False, mgxs_path="mgxs.h5" ) # Convert to a random ray model From 973c6fed5bf67b18d0f6ea4052ecc309c83704a1 Mon Sep 17 00:00:00 2001 From: nuclearkevin <66632997+nuclearkevin@users.noreply.github.com> Date: Wed, 14 Jan 2026 12:49:48 -0600 Subject: [PATCH 9/9] Add the multiplication by density to kappa-fission. --- src/random_ray/flat_source_domain.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index f4fcd79974b..c2effaa5d4a 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -666,7 +666,8 @@ void FlatSourceDomain::random_ray_tally() break; case SCORE_KAPPA_FISSION: - score = flux * volume * kappa_fission_[material * negroups_ + g]; + score = flux * volume * kappa_fission_[material * negroups_ + g] * + density_mult; break; default: