Skip to content

Commit 3e2f1f5

Browse files
authored
Enable fission heating tallies in the random ray solver (#3714)
1 parent 73a98b2 commit 3e2f1f5

13 files changed

Lines changed: 315 additions & 6 deletions

File tree

docs/source/usersguide/random_ray.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ Supported scores:
513513
- total
514514
- fission
515515
- nu-fission
516+
- kappa-fission
516517
- events
517518

518519
Supported Estimators:

include/openmc/random_ray/flat_source_domain.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ class FlatSourceDomain {
107107
vector<double> nu_sigma_f_;
108108
vector<double> sigma_f_;
109109
vector<double> chi_;
110+
vector<double> kappa_fission_;
110111

111112
// 3D arrays stored in 1D representing values for all materials x energy
112113
// groups x energy groups

openmc/model/model.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1729,12 +1729,14 @@ def _auto_generate_mgxs_lib(
17291729
if correction == 'P0':
17301730
mgxs_lib.mgxs_types = [
17311731
'nu-transport', 'absorption', 'nu-fission', 'fission',
1732-
'consistent nu-scatter matrix', 'multiplicity matrix', 'chi'
1732+
'consistent nu-scatter matrix', 'multiplicity matrix', 'chi',
1733+
'kappa-fission'
17331734
]
17341735
elif correction is None:
17351736
mgxs_lib.mgxs_types = [
17361737
'total', 'absorption', 'nu-fission', 'fission',
1737-
'consistent nu-scatter matrix', 'multiplicity matrix', 'chi'
1738+
'consistent nu-scatter matrix', 'multiplicity matrix', 'chi',
1739+
'kappa-fission'
17381740
]
17391741

17401742
# Specify a "material" domain type for the cross section tally filters

src/random_ray/flat_source_domain.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,10 +665,15 @@ void FlatSourceDomain::random_ray_tally()
665665
score = 1.0;
666666
break;
667667

668+
case SCORE_KAPPA_FISSION:
669+
score = flux * volume * kappa_fission_[material * negroups_ + g] *
670+
density_mult;
671+
break;
672+
668673
default:
669674
fatal_error("Invalid score specified in tallies.xml. Only flux, "
670-
"total, fission, nu-fission, and events are supported in "
671-
"random ray mode.");
675+
"total, fission, nu-fission, kappa-fission, and events "
676+
"are supported in random ray mode.");
672677
break;
673678
}
674679
// Apply score to the appropriate tally bin
@@ -1165,6 +1170,10 @@ void FlatSourceDomain::flatten_xs()
11651170
}
11661171
chi_.push_back(chi);
11671172

1173+
double kappa_fission =
1174+
m.get_xs(MgxsType::KAPPA_FISSION, g_out, NULL, NULL, NULL, t, a);
1175+
kappa_fission_.push_back(kappa_fission);
1176+
11681177
for (int g_in = 0; g_in < negroups_; g_in++) {
11691178
double sigma_s =
11701179
m.get_xs(MgxsType::NU_SCATTER, g_in, &g_out, NULL, NULL, t, a);
@@ -1180,6 +1189,7 @@ void FlatSourceDomain::flatten_xs()
11801189
nu_sigma_f_.push_back(0);
11811190
sigma_f_.push_back(0);
11821191
chi_.push_back(0);
1192+
kappa_fission_.push_back(0);
11831193
for (int g_in = 0; g_in < negroups_; g_in++) {
11841194
sigma_s_.push_back(0);
11851195
}

src/random_ray/random_ray_simulation.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,12 @@ void validate_random_ray_inputs()
8383
case SCORE_FISSION:
8484
case SCORE_NU_FISSION:
8585
case SCORE_EVENTS:
86+
case SCORE_KAPPA_FISSION:
8687
break;
8788
default:
8889
fatal_error(
89-
"Invalid score specified. Only flux, total, fission, nu-fission, and "
90-
"event scores are supported in random ray mode.");
90+
"Invalid score specified. Only flux, total, fission, nu-fission, "
91+
"kappa-fission, and event scores are supported in random ray mode.");
9192
}
9293
}
9394

tests/regression_tests/random_ray_auto_convert_kappa_fission/__init__.py

Whitespace-only changes.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?xml version='1.0' encoding='utf-8'?>
2+
<model>
3+
<materials>
4+
<cross_sections>mgxs.h5</cross_sections>
5+
<material id="1" name="UO2__2_4__" depletable="true">
6+
<density value="1.0" units="macro"/>
7+
<macroscopic name="UO2__2_4__"/>
8+
</material>
9+
<material id="2" name="Zircaloy">
10+
<density value="1.0" units="macro"/>
11+
<macroscopic name="Zircaloy"/>
12+
</material>
13+
<material id="3" name="Hot_borated_water">
14+
<density value="1.0" units="macro"/>
15+
<macroscopic name="Hot_borated_water"/>
16+
</material>
17+
</materials>
18+
<geometry>
19+
<cell id="1" name="Fuel" material="1" region="-1" universe="0"/>
20+
<cell id="2" name="Cladding" material="2" region="1 -2" universe="0"/>
21+
<cell id="3" name="Water" material="3" region="2 3 -4 5 -6" universe="0"/>
22+
<surface id="1" name="Fuel OR" type="z-cylinder" coeffs="0 0 0.39218"/>
23+
<surface id="2" name="Clad OR" type="z-cylinder" coeffs="0 0 0.4572"/>
24+
<surface id="3" name="left" type="x-plane" boundary="reflective" coeffs="-0.63"/>
25+
<surface id="4" name="right" type="x-plane" boundary="reflective" coeffs="0.63"/>
26+
<surface id="5" name="bottom" type="y-plane" boundary="reflective" coeffs="-0.63"/>
27+
<surface id="6" name="top" type="y-plane" boundary="reflective" coeffs="0.63"/>
28+
</geometry>
29+
<settings>
30+
<run_mode>eigenvalue</run_mode>
31+
<particles>100</particles>
32+
<batches>10</batches>
33+
<inactive>5</inactive>
34+
<source type="independent" strength="1.0" particle="neutron">
35+
<space type="box">
36+
<parameters>-0.63 -0.63 -1 0.63 0.63 1</parameters>
37+
</space>
38+
<constraints>
39+
<fissionable>true</fissionable>
40+
</constraints>
41+
</source>
42+
<energy_mode>multi-group</energy_mode>
43+
<random_ray>
44+
<source type="independent" strength="1.0" particle="neutron">
45+
<space type="box">
46+
<parameters>-0.63 -0.63 -1.0 0.63 0.63 1.0</parameters>
47+
</space>
48+
</source>
49+
<distance_inactive>30.0</distance_inactive>
50+
<distance_active>150.0</distance_active>
51+
<source_region_meshes>
52+
<mesh id="1">
53+
<domain id="0" type="universe"/>
54+
</mesh>
55+
</source_region_meshes>
56+
<source_shape>linear</source_shape>
57+
</random_ray>
58+
<mesh id="1">
59+
<dimension>2 2</dimension>
60+
<lower_left>-0.63 -0.63</lower_left>
61+
<upper_right>0.63 0.63</upper_right>
62+
</mesh>
63+
</settings>
64+
<tallies>
65+
<filter id="61" type="material">
66+
<bins>1</bins>
67+
</filter>
68+
<tally id="193" name="KF Tally">
69+
<filters>61</filters>
70+
<scores>kappa-fission</scores>
71+
</tally>
72+
</tallies>
73+
</model>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
k-combined:
2+
7.479770E-01 1.624548E-02
3+
tally 1:
4+
2.965503E+08
5+
1.762157E+16
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?xml version='1.0' encoding='utf-8'?>
2+
<model>
3+
<materials>
4+
<cross_sections>mgxs.h5</cross_sections>
5+
<material id="1" name="UO2__2_4__" depletable="true">
6+
<density value="1.0" units="macro"/>
7+
<macroscopic name="UO2__2_4__"/>
8+
</material>
9+
<material id="2" name="Zircaloy">
10+
<density value="1.0" units="macro"/>
11+
<macroscopic name="Zircaloy"/>
12+
</material>
13+
<material id="3" name="Hot_borated_water">
14+
<density value="1.0" units="macro"/>
15+
<macroscopic name="Hot_borated_water"/>
16+
</material>
17+
</materials>
18+
<geometry>
19+
<cell id="1" name="Fuel" material="1" region="-1" universe="0"/>
20+
<cell id="2" name="Cladding" material="2" region="1 -2" universe="0"/>
21+
<cell id="3" name="Water" material="3" region="2 3 -4 5 -6" universe="0"/>
22+
<surface id="1" name="Fuel OR" type="z-cylinder" coeffs="0 0 0.39218"/>
23+
<surface id="2" name="Clad OR" type="z-cylinder" coeffs="0 0 0.4572"/>
24+
<surface id="3" name="left" type="x-plane" boundary="reflective" coeffs="-0.63"/>
25+
<surface id="4" name="right" type="x-plane" boundary="reflective" coeffs="0.63"/>
26+
<surface id="5" name="bottom" type="y-plane" boundary="reflective" coeffs="-0.63"/>
27+
<surface id="6" name="top" type="y-plane" boundary="reflective" coeffs="0.63"/>
28+
</geometry>
29+
<settings>
30+
<run_mode>eigenvalue</run_mode>
31+
<particles>100</particles>
32+
<batches>10</batches>
33+
<inactive>5</inactive>
34+
<source type="independent" strength="1.0" particle="neutron">
35+
<space type="box">
36+
<parameters>-0.63 -0.63 -1 0.63 0.63 1</parameters>
37+
</space>
38+
<constraints>
39+
<fissionable>true</fissionable>
40+
</constraints>
41+
</source>
42+
<energy_mode>multi-group</energy_mode>
43+
<random_ray>
44+
<source type="independent" strength="1.0" particle="neutron">
45+
<space type="box">
46+
<parameters>-0.63 -0.63 -1.0 0.63 0.63 1.0</parameters>
47+
</space>
48+
</source>
49+
<distance_inactive>30.0</distance_inactive>
50+
<distance_active>150.0</distance_active>
51+
<source_region_meshes>
52+
<mesh id="1">
53+
<domain id="0" type="universe"/>
54+
</mesh>
55+
</source_region_meshes>
56+
<source_shape>linear</source_shape>
57+
</random_ray>
58+
<mesh id="1">
59+
<dimension>2 2</dimension>
60+
<lower_left>-0.63 -0.63</lower_left>
61+
<upper_right>0.63 0.63</upper_right>
62+
</mesh>
63+
</settings>
64+
<tallies>
65+
<filter id="97" type="material">
66+
<bins>1</bins>
67+
</filter>
68+
<tally id="203" name="KF Tally">
69+
<filters>97</filters>
70+
<scores>kappa-fission</scores>
71+
</tally>
72+
</tallies>
73+
</model>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
k-combined:
2+
7.372542E-01 6.967831E-03
3+
tally 1:
4+
2.909255E+08
5+
1.693395E+16

0 commit comments

Comments
 (0)