Skip to content

Commit aa4afc4

Browse files
GuyStenclaudepaulromano
authored
Annihilate positrons below the positron energy cutoff (#4157)
Co-authored-by: Claude <[email protected]> Co-authored-by: Paul Romano <[email protected]>
1 parent 31f56dc commit aa4afc4

3 files changed

Lines changed: 45 additions & 7 deletions

File tree

‎docs/source/io_formats/settings.rst‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ time.
201201
*Default*: 0.0
202202

203203
:energy_positron:
204-
The energy under which positrons will be killed.
204+
The energy under which positrons will be killed. A killed positron
205+
deposits its kinetic energy locally but still produces a pair of
206+
annihilation photons.
205207

206208
*Default*: 0.0
207209

‎src/physics.cpp‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,13 +471,17 @@ void process_charged_secondary(
471471
Particle& p, Direction u, double E, ParticleType type)
472472
{
473473
int idx = type.transport_index();
474-
if (idx == C_NONE || E < settings::energy_cutoff[idx])
474+
if (idx == C_NONE)
475475
return;
476476

477-
if (settings::electron_treatment == ElectronTreatment::TTB) {
477+
// Below the energy cutoff, the kinetic energy is deposited locally without
478+
// producing bremsstrahlung
479+
if (E >= settings::energy_cutoff[idx] &&
480+
settings::electron_treatment == ElectronTreatment::TTB) {
478481
thick_target_bremsstrahlung(p, type, u, E);
479482
}
480483

484+
// A positron annihilates regardless of its kinetic energy
481485
if (type == ParticleType::positron()) {
482486
Direction photon_u = isotropic_direction(p.current_seed());
483487
p.create_secondary(

‎tests/unit_tests/test_energy_cutoff.py‎

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
import openmc
55

66

7-
def inf_medium_model(cutoff_energy, source_energy):
7+
def inf_medium_model(cutoff_energy, source_energy, *,
8+
nuclide='Zr90', density=1.0):
89
"""Infinite medium problem with a monoenergetic photon source"""
910
model = openmc.Model()
1011

1112
m = openmc.Material()
12-
m.add_nuclide('Zr90', 1.0)
13-
m.set_density('g/cm3', 1.0)
13+
m.add_nuclide(nuclide, 1.0)
14+
m.set_density('g/cm3', density)
1415

1516
sph = openmc.Sphere(r=100.0, boundary_type='reflective')
1617
cell = openmc.Cell(fill=m, region=-sph)
@@ -19,7 +20,7 @@ def inf_medium_model(cutoff_energy, source_energy):
1920
model.settings.run_mode = 'fixed source'
2021
model.settings.source = openmc.IndependentSource(
2122
particle='photon',
22-
energy=openmc.stats.Discrete([source_energy], [1.0]),
23+
energy=openmc.stats.delta_function(source_energy),
2324
)
2425
model.settings.particles = 100
2526
model.settings.batches = 10
@@ -61,3 +62,34 @@ def test_energy_cutoff(run_in_tmpdir):
6162
# Despite killing particles below the cutoff, the total heating should be
6263
# equal to the source energy
6364
assert heating[0] == pytest.approx(source_energy)
65+
66+
67+
def test_positron_cutoff_annihilation(run_in_tmpdir):
68+
"""Positrons below the energy cutoff must still annihilate"""
69+
70+
def run(positron_cutoff):
71+
model = inf_medium_model(
72+
1.0e3, 10.0e6, nuclide='Pb208', density=11.35)
73+
model.settings.batches = 2
74+
# With local energy deposition, charged particles produce no
75+
# bremsstrahlung, so the positron cutoff should have no effect
76+
model.settings.electron_treatment = 'led'
77+
if positron_cutoff is not None:
78+
model.settings.cutoff['energy_positron'] = positron_cutoff
79+
80+
tally, heating = model.tallies
81+
tally.filters[0] = openmc.EnergyFilter(
82+
[0.0, 0.5e6, 0.52e6, 10.0e6])
83+
model.run(apply_tally_results=True)
84+
# The reflective medium absorbs all source energy, including the
85+
# annihilation rest energy, for either positron cutoff.
86+
assert heating.mean.item() == pytest.approx(10.0e6)
87+
return tally.mean.ravel()
88+
89+
# Every positron is below a cutoff above the source energy
90+
flux_ref = run(None)
91+
flux_cutoff = run(20.0e6)
92+
93+
# Annihilation photons contribute to the bin containing 511 keV
94+
assert flux_ref[1] > 0.0
95+
assert flux_cutoff == pytest.approx(flux_ref)

0 commit comments

Comments
 (0)