Skip to content
Open
1 change: 1 addition & 0 deletions docs/source/usersguide/random_ray.rst
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ Supported scores:
- total
- fission
- nu-fission
- kappa-fission
- events

Supported Estimators:
Expand Down
1 change: 1 addition & 0 deletions include/openmc/random_ray/flat_source_domain.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class FlatSourceDomain {
vector<double> nu_sigma_f_;
vector<double> sigma_f_;
vector<double> chi_;
vector<double> kappa_fission_;

// 3D arrays stored in 1D representing values for all materials x energy
// groups x energy groups
Expand Down
24 changes: 15 additions & 9 deletions openmc/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1179,8 +1179,8 @@ def plot(

# Convert ID map to RGB image
img = id_map_to_rgb(
id_map=id_map,
color_by=color_by,
id_map=id_map,
color_by=color_by,
colors=colors,
overlap_color=overlap_color
)
Expand Down Expand Up @@ -1217,7 +1217,7 @@ def plot(
extent=(x_min, x_max, y_min, y_max),
**contour_kwargs
)

# If only showing outline, set the axis limits and aspect explicitly
if outline == 'only':
axes.set_xlim(x_min, x_max)
Expand Down Expand Up @@ -1862,12 +1862,14 @@ def _generate_infinite_medium_mgxs(
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 "cell" domain type for the cross section tally filters
Expand Down Expand Up @@ -2068,10 +2070,12 @@ def _generate_stochastic_slab_mgxs(
# Specify needed cross sections for random ray
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 "cell" domain type for the cross section tally filters
mgxs_lib.domain_type = "material"
Expand Down Expand Up @@ -2160,12 +2164,14 @@ def _generate_material_wise_mgxs(
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 "cell" domain type for the cross section tally filters
Expand Down
14 changes: 12 additions & 2 deletions src/random_ray/flat_source_domain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,10 +665,15 @@ void FlatSourceDomain::random_ray_tally()
score = 1.0;
break;

case SCORE_KAPPA_FISSION:
score = flux * volume * kappa_fission_[material * negroups_ + g] *
density_mult;
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
Expand Down Expand Up @@ -1165,6 +1170,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);
Expand All @@ -1180,6 +1189,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);
}
Expand Down
5 changes: 3 additions & 2 deletions src/random_ray/random_ray_simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,12 @@ void validate_random_ray_inputs()
case SCORE_FISSION:
case SCORE_NU_FISSION:
case SCORE_EVENTS:
case SCORE_KAPPA_FISSION:
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.");
}
}

Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version='1.0' encoding='utf-8'?>
<model>
<materials>
<cross_sections>mgxs.h5</cross_sections>
<material id="1" name="UO2__2_4__" depletable="true">
<density value="1.0" units="macro"/>
<macroscopic name="UO2__2_4__"/>
</material>
<material id="2" name="Zircaloy">
<density value="1.0" units="macro"/>
<macroscopic name="Zircaloy"/>
</material>
<material id="3" name="Hot_borated_water">
<density value="1.0" units="macro"/>
<macroscopic name="Hot_borated_water"/>
</material>
</materials>
<geometry>
<cell id="1" name="Fuel" material="1" region="-1" universe="0"/>
<cell id="2" name="Cladding" material="2" region="1 -2" universe="0"/>
<cell id="3" name="Water" material="3" region="2 3 -4 5 -6" universe="0"/>
<surface id="1" name="Fuel OR" type="z-cylinder" coeffs="0 0 0.39218"/>
<surface id="2" name="Clad OR" type="z-cylinder" coeffs="0 0 0.4572"/>
<surface id="3" name="left" type="x-plane" boundary="reflective" coeffs="-0.63"/>
<surface id="4" name="right" type="x-plane" boundary="reflective" coeffs="0.63"/>
<surface id="5" name="bottom" type="y-plane" boundary="reflective" coeffs="-0.63"/>
<surface id="6" name="top" type="y-plane" boundary="reflective" coeffs="0.63"/>
</geometry>
<settings>
<run_mode>eigenvalue</run_mode>
<particles>100</particles>
<batches>10</batches>
<inactive>5</inactive>
<source type="independent" strength="1.0" particle="neutron">
<space type="box">
<parameters>-0.63 -0.63 -1 0.63 0.63 1</parameters>
</space>
<constraints>
<fissionable>true</fissionable>
</constraints>
</source>
<energy_mode>multi-group</energy_mode>
<random_ray>
<source type="independent" strength="1.0" particle="neutron">
<space type="box">
<parameters>-0.63 -0.63 -1.0 0.63 0.63 1.0</parameters>
</space>
</source>
<distance_inactive>30.0</distance_inactive>
<distance_active>150.0</distance_active>
<source_region_meshes>
<mesh id="1">
<domain id="0" type="universe"/>
</mesh>
</source_region_meshes>
<source_shape>linear</source_shape>
</random_ray>
<mesh id="1">
<dimension>2 2</dimension>
<lower_left>-0.63 -0.63</lower_left>
<upper_right>0.63 0.63</upper_right>
</mesh>
</settings>
<tallies>
<filter id="61" type="material">
<bins>1</bins>
</filter>
<tally id="193" name="KF Tally">
<filters>61</filters>
<scores>kappa-fission</scores>
</tally>
</tallies>
</model>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
k-combined:
7.479770E-01 1.624548E-02
tally 1:
2.965503E+08
1.762157E+16
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version='1.0' encoding='utf-8'?>
<model>
<materials>
<cross_sections>mgxs.h5</cross_sections>
<material id="1" name="UO2__2_4__" depletable="true">
<density value="1.0" units="macro"/>
<macroscopic name="UO2__2_4__"/>
</material>
<material id="2" name="Zircaloy">
<density value="1.0" units="macro"/>
<macroscopic name="Zircaloy"/>
</material>
<material id="3" name="Hot_borated_water">
<density value="1.0" units="macro"/>
<macroscopic name="Hot_borated_water"/>
</material>
</materials>
<geometry>
<cell id="1" name="Fuel" material="1" region="-1" universe="0"/>
<cell id="2" name="Cladding" material="2" region="1 -2" universe="0"/>
<cell id="3" name="Water" material="3" region="2 3 -4 5 -6" universe="0"/>
<surface id="1" name="Fuel OR" type="z-cylinder" coeffs="0 0 0.39218"/>
<surface id="2" name="Clad OR" type="z-cylinder" coeffs="0 0 0.4572"/>
<surface id="3" name="left" type="x-plane" boundary="reflective" coeffs="-0.63"/>
<surface id="4" name="right" type="x-plane" boundary="reflective" coeffs="0.63"/>
<surface id="5" name="bottom" type="y-plane" boundary="reflective" coeffs="-0.63"/>
<surface id="6" name="top" type="y-plane" boundary="reflective" coeffs="0.63"/>
</geometry>
<settings>
<run_mode>eigenvalue</run_mode>
<particles>100</particles>
<batches>10</batches>
<inactive>5</inactive>
<source type="independent" strength="1.0" particle="neutron">
<space type="box">
<parameters>-0.63 -0.63 -1 0.63 0.63 1</parameters>
</space>
<constraints>
<fissionable>true</fissionable>
</constraints>
</source>
<energy_mode>multi-group</energy_mode>
<random_ray>
<source type="independent" strength="1.0" particle="neutron">
<space type="box">
<parameters>-0.63 -0.63 -1.0 0.63 0.63 1.0</parameters>
</space>
</source>
<distance_inactive>30.0</distance_inactive>
<distance_active>150.0</distance_active>
<source_region_meshes>
<mesh id="1">
<domain id="0" type="universe"/>
</mesh>
</source_region_meshes>
<source_shape>linear</source_shape>
</random_ray>
<mesh id="1">
<dimension>2 2</dimension>
<lower_left>-0.63 -0.63</lower_left>
<upper_right>0.63 0.63</upper_right>
</mesh>
</settings>
<tallies>
<filter id="97" type="material">
<bins>1</bins>
</filter>
<tally id="203" name="KF Tally">
<filters>97</filters>
<scores>kappa-fission</scores>
</tally>
</tallies>
</model>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
k-combined:
7.372542E-01 6.967831E-03
tally 1:
2.909255E+08
1.693395E+16
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version='1.0' encoding='utf-8'?>
<model>
<materials>
<cross_sections>mgxs.h5</cross_sections>
<material id="1" name="UO2__2_4__" depletable="true">
<density value="1.0" units="macro"/>
<macroscopic name="UO2__2_4__"/>
</material>
<material id="2" name="Zircaloy">
<density value="1.0" units="macro"/>
<macroscopic name="Zircaloy"/>
</material>
<material id="3" name="Hot_borated_water">
<density value="1.0" units="macro"/>
<macroscopic name="Hot_borated_water"/>
</material>
</materials>
<geometry>
<cell id="1" name="Fuel" material="1" region="-1" universe="0"/>
<cell id="2" name="Cladding" material="2" region="1 -2" universe="0"/>
<cell id="3" name="Water" material="3" region="2 3 -4 5 -6" universe="0"/>
<surface id="1" name="Fuel OR" type="z-cylinder" coeffs="0 0 0.39218"/>
<surface id="2" name="Clad OR" type="z-cylinder" coeffs="0 0 0.4572"/>
<surface id="3" name="left" type="x-plane" boundary="reflective" coeffs="-0.63"/>
<surface id="4" name="right" type="x-plane" boundary="reflective" coeffs="0.63"/>
<surface id="5" name="bottom" type="y-plane" boundary="reflective" coeffs="-0.63"/>
<surface id="6" name="top" type="y-plane" boundary="reflective" coeffs="0.63"/>
</geometry>
<settings>
<run_mode>eigenvalue</run_mode>
<particles>100</particles>
<batches>10</batches>
<inactive>5</inactive>
<source type="independent" strength="1.0" particle="neutron">
<space type="box">
<parameters>-0.63 -0.63 -1 0.63 0.63 1</parameters>
</space>
<constraints>
<fissionable>true</fissionable>
</constraints>
</source>
<energy_mode>multi-group</energy_mode>
<random_ray>
<source type="independent" strength="1.0" particle="neutron">
<space type="box">
<parameters>-0.63 -0.63 -1.0 0.63 0.63 1.0</parameters>
</space>
</source>
<distance_inactive>30.0</distance_inactive>
<distance_active>150.0</distance_active>
<source_region_meshes>
<mesh id="1">
<domain id="0" type="universe"/>
</mesh>
</source_region_meshes>
<source_shape>linear</source_shape>
</random_ray>
<mesh id="1">
<dimension>2 2</dimension>
<lower_left>-0.63 -0.63</lower_left>
<upper_right>0.63 0.63</upper_right>
</mesh>
</settings>
<tallies>
<filter id="97" type="material">
<bins>1</bins>
</filter>
<tally id="203" name="KF Tally">
<filters>97</filters>
<scores>kappa-fission</scores>
</tally>
</tallies>
</model>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
k-combined:
6.413334E-01 2.083132E-02
tally 1:
2.541463E+08
1.297259E+16
Loading
Loading