Skip to content

Commit

Permalink
Merge pull request #17 from openmsr/fix_search_for_keff_return_function
Browse files Browse the repository at this point in the history
Separate x and root in return search_for_keff function
  • Loading branch information
church89 authored Oct 30, 2023
2 parents 186a267 + 2304bfd commit 2591bb9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions openmc/deplete/batchwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -1547,24 +1547,24 @@ def search_for_keff(self, x, step_index):

# restart level and perform dilution
self.bw_geom._set_cell_attrib(self.restart_level)
x = self.bw_mat.search_for_keff(x, step_index)
x, root = self.bw_mat.search_for_keff(x, step_index)
#update dulution interval
#if step_index == self.dilute_interval:
# self.dilute_interval += self.step_interval


else:
x = self.bw_geom.search_for_keff(x, step_index)
x, root = self.bw_geom.search_for_keff(x, step_index)
# in this case if upper limit gets hit, stop directly
if self.bw_geom._get_cell_attrib() >= self.bw_geom.bracket_limit[1]:
if root >= self.bw_geom.bracket_limit[1]:
from pathlib import Path
print(f'Reached maximum of {self.bw_geom.bracket_limit[1]} cm'
' exit..')
Path('sim.done').touch()

for rank in range(comm.size):
comm.Abort()
return x
return x, root

class BatchwiseSchemeRefuel():
"""
Expand Down Expand Up @@ -1609,13 +1609,13 @@ def __init__(self, bw_list, restart_level):
raise ValueError(f'{bw_list} is not a list')

self.bw_list = bw_list

if not isinstance(restart_level, (float, int)):
raise ValueError(f'{restart_level} is of type {type(restart_level)},'
' while it should be int or float')
else:
self.restart_level = restart_level

def set_density_function(self, mats, density_func, oxidation_states):
for bw in self.bw_list:
bw.set_density_function(mats, density_func, oxidation_states)
Expand Down Expand Up @@ -1645,10 +1645,10 @@ def search_for_keff(self, x, step_index):
Updated total atoms concentrations
"""
#Start by doing a geometrical search§
x,root = self.bw_geom.search_for_keff(x, step_index)
x, root = self.bw_geom.search_for_keff(x, step_index)
#check if upper geometrical limit gets hit
if root >= self.bw_geom.bracket_limit[1]:
# Reset geometry and refuel
# Reset geometry and refuel
self.bw_geom._set_cell_attrib(self.restart_level)
x,root = self.bw_mat.search_for_keff(x, step_index)

Expand Down

0 comments on commit 2591bb9

Please sign in to comment.