Skip to content

Commit 57dc71f

Browse files
Map Compton subshell data to atomic relaxation data (#3392)
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
1 parent 1e7d832 commit 57dc71f

File tree

5 files changed

+59
-41
lines changed

5 files changed

+59
-41
lines changed

include/openmc/photon.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class ElectronSubshell {
3333

3434
int index_subshell; //!< index in SUBSHELLS
3535
int threshold;
36-
double n_electrons;
3736
double binding_energy;
3837
vector<Transition> transitions;
3938
};
@@ -90,6 +89,11 @@ class PhotonInteraction {
9089
xt::xtensor<double, 1> binding_energy_;
9190
xt::xtensor<double, 1> electron_pdf_;
9291

92+
// Map subshells from Compton profile data obtained from Biggs et al,
93+
// "Hartree-Fock Compton profiles for the elements" to ENDF/B atomic
94+
// relaxation data
95+
xt::xtensor<int, 1> subshell_map_;
96+
9397
// Stopping power data
9498
double I_; // mean excitation energy
9599
xt::xtensor<int, 1> n_electrons_;

src/photon.cpp

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ PhotonInteraction::PhotonInteraction(hid_t group)
165165
if (attribute_exists(tgroup, "binding_energy")) {
166166
has_atomic_relaxation_ = true;
167167
read_attribute(tgroup, "binding_energy", shell.binding_energy);
168-
read_attribute(tgroup, "num_electrons", shell.n_electrons);
169168
}
170169

171170
// Read subshell cross section
@@ -233,6 +232,28 @@ PhotonInteraction::PhotonInteraction(hid_t group)
233232
}
234233
close_group(rgroup);
235234

235+
// Map Compton subshell data to atomic relaxation data by finding the
236+
// subshell with the equivalent binding energy
237+
if (has_atomic_relaxation_) {
238+
auto is_close = [](double a, double b) {
239+
return std::abs(a - b) / a < FP_REL_PRECISION;
240+
};
241+
subshell_map_ = xt::full_like(binding_energy_, -1);
242+
for (int i = 0; i < binding_energy_.size(); ++i) {
243+
double E_b = binding_energy_[i];
244+
if (i < n_shell && is_close(E_b, shells_[i].binding_energy)) {
245+
subshell_map_[i] = i;
246+
} else {
247+
for (int j = 0; j < n_shell; ++j) {
248+
if (is_close(E_b, shells_[j].binding_energy)) {
249+
subshell_map_[i] = j;
250+
break;
251+
}
252+
}
253+
}
254+
}
255+
}
256+
236257
// Create Compton profile CDF
237258
auto n_profile = data::compton_profile_pz.size();
238259
auto n_shell_compton = profile_pdf_.shape(0);
@@ -423,13 +444,6 @@ void PhotonInteraction::compton_scatter(double alpha, bool doppler,
423444
double E_out;
424445
this->compton_doppler(alpha, *mu, &E_out, i_shell, seed);
425446
*alpha_out = E_out / MASS_ELECTRON_EV;
426-
427-
// It's possible for the Compton profile data to have more shells than
428-
// there are in the ENDF data. Make sure the shell index doesn't end up
429-
// out of bounds.
430-
if (*i_shell >= shells_.size()) {
431-
*i_shell = -1;
432-
}
433447
} else {
434448
*i_shell = -1;
435449
}

src/physics.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,11 @@ void sample_photon_reaction(Particle& p)
340340
p.create_secondary(p.wgt(), u, E_electron, ParticleType::electron);
341341
}
342342

343-
// TODO: Compton subshell data does not match atomic relaxation data
344-
// Allow electrons to fill orbital and produce auger electrons
345-
// and fluorescent photons
346-
if (i_shell >= 0) {
347-
element.atomic_relaxation(i_shell, p);
343+
// Allow electrons to fill orbital and produce Auger electrons and
344+
// fluorescent photons. Since Compton subshell data does not match atomic
345+
// relaxation data, use the mapping between the data to find the subshell
346+
if (i_shell >= 0 && element.subshell_map_[i_shell] >= 0) {
347+
element.atomic_relaxation(element.subshell_map_[i_shell], p);
348348
}
349349

350350
phi += PI;

tests/regression_tests/photon_production/results_true.dat

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
tally 1:
22
8.610000E-01
33
7.413210E-01
4-
9.493000E-01
5-
9.011705E-01
4+
9.491000E-01
5+
9.007908E-01
66
0.000000E+00
77
0.000000E+00
88
0.000000E+00
@@ -16,12 +16,12 @@ tally 2:
1616
1.573004E+00
1717
4.296434E-04
1818
1.845934E-07
19-
2.337049E-01
20-
5.461796E-02
19+
2.350021E-01
20+
5.522600E-02
2121
0.000000E+00
2222
0.000000E+00
23-
2.337049E-01
24-
5.461796E-02
23+
2.350021E-01
24+
5.522600E-02
2525
0.000000E+00
2626
0.000000E+00
2727
0.000000E+00
@@ -53,16 +53,16 @@ tally 3:
5353
4.104374E+12
5454
4.296582E-04
5555
1.846062E-07
56-
2.286000E-01
57-
5.225796E-02
58-
7.054033E+03
59-
4.975938E+07
56+
2.297000E-01
57+
5.276209E-02
58+
7.055982E+03
59+
4.978688E+07
6060
0.000000E+00
6161
0.000000E+00
62-
2.286000E-01
63-
5.225796E-02
64-
7.054033E+03
65-
4.975938E+07
62+
2.297000E-01
63+
5.276209E-02
64+
7.055982E+03
65+
4.978688E+07
6666
0.000000E+00
6767
0.000000E+00
6868
0.000000E+00
@@ -73,8 +73,8 @@ tally 3:
7373
0.000000E+00
7474
0.000000E+00
7575
0.000000E+00
76-
1.764573E+05
77-
3.113718E+10
76+
1.774451E+05
77+
3.148675E+10
7878
0.000000E+00
7979
0.000000E+00
8080
0.000000E+00
@@ -102,16 +102,16 @@ tally 4:
102102
4.104374E+12
103103
0.000000E+00
104104
0.000000E+00
105-
2.286000E-01
106-
5.225796E-02
107-
7.054033E+03
108-
4.975938E+07
105+
2.297000E-01
106+
5.276209E-02
107+
7.055982E+03
108+
4.978688E+07
109109
0.000000E+00
110110
0.000000E+00
111-
2.286000E-01
112-
5.225796E-02
113-
7.054033E+03
114-
4.975938E+07
111+
2.297000E-01
112+
5.276209E-02
113+
7.055982E+03
114+
4.978688E+07
115115
0.000000E+00
116116
0.000000E+00
117117
0.000000E+00
@@ -122,8 +122,8 @@ tally 4:
122122
0.000000E+00
123123
0.000000E+00
124124
0.000000E+00
125-
1.764573E+05
126-
3.113718E+10
125+
1.774451E+05
126+
3.148675E+10
127127
0.000000E+00
128128
0.000000E+00
129129
0.000000E+00
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ebc761815175b25fc95a226174928c226a3ab5dbf3b2a2abf09e079a0b87dee1dee74aa9b9eaec35acd58b8c481d264be7e9b3f052905bcc14ccd76f36b01549
1+
952c20fefac374d3b9fd28627fda7d5ae262f8cd7c01a33f0381526204a2287c18e56259a599dc6fdc1b59a2d2866fdfeedea371154c8fa7a69dc5c445b08c2d

0 commit comments

Comments
 (0)