Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 5 additions & 20 deletions openmc/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -963,29 +963,14 @@ def execute_run(self, **kwargs):
new_mats = matlist[tidx]
rundir = self.ptransport_path / f'timestep_{tidx}'

# Collect all source energy distributions from model
dist_map = {}
for mat in new_mats:
pdist = mat.decay_photon_energy
if pdist is not None:
dist_map[mat.id] = pdist

# Collect all spatial distributions of the sources from the model
box_map = {}
# Create Source for every depleted region
src_list = []
for cell in self.geometry.get_all_cells().values():
if cell.fill is None:
continue
lower_left, upper_right = cell.region.bounding_box
box = openmc.stats.Box(lower_left, upper_right)
box_map[cell.fill.id] = box

# Create Source for every depleted region
src_list = []
for idx in dist_map.keys():
src = openmc.Source(energy=dist_map[idx], space=box_map[idx])
src.strength = dist_map[idx].integral()
src.particle = 'photon'
src_list.append(src)
src = openmc.Source.from_cell_with_material(cell)
if src is not None: # materials may have no photon emission
src_list.append(src)

self.settings.source = src_list
self.export_to_xml(rundir)
Expand Down