Skip to content

Commit

Permalink
Merge pull request #22 from abachma2/depletion
Browse files Browse the repository at this point in the history
Change depletion time step sizes
  • Loading branch information
nsryan2 authored Jul 18, 2024
2 parents 3723a28 + 3e85b18 commit 3d65ee4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Since last release:
parameters for using `DepleteReactor` (#18)
* Simplify CI build environment, using conda builds instead of
building from source (#21)
* Depletion time steps are based on `dt` parameter of Cyclus
input (which is in seconds) instead of assuming 30 day time steps (#22)


**Removed:**
Expand Down
22 changes: 12 additions & 10 deletions openmcyclus/DepleteReactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ def __init__(self, *args, **kwargs):
self.materials = openmc.Materials()
self.fresh_comps = np.array([])
self.spent_comps = np.array([])


def tick(self):
'''
Expand Down Expand Up @@ -290,8 +289,10 @@ def enter_notify(self):
super().enter_notify()
if len(self.fuel_prefs) == 0:
self.fuel_prefs = [1] * len(self.fuel_incommods)
self.materials = self.materials.from_xml(str(self.model_path + "materials.xml"))
self.micro_xs = od.MicroXS.from_csv(str(self.model_path + "micro_xs.csv"))
self.materials = self.materials.from_xml(
str(self.model_path + "materials.xml"))
self.micro_xs = od.MicroXS.from_csv(
str(self.model_path + "micro_xs.csv"))

self.record_position()

Expand Down Expand Up @@ -633,19 +634,20 @@ def transmute(self):
material_ids, materials = self.deplete.update_materials(
comp_list, self.materials)
ind_op = od.IndependentOperator(
materials,
[np.array([self.flux])]*len(materials),
[self.micro_xs]*len(materials),
str(self.model_path + self.chain_file))
materials,
[np.array([self.flux])] * len(materials),
[self.micro_xs] * len(materials),
str(self.model_path + self.chain_file))
ind_op.output_dir = self.model_path
integrator = od.PredictorIntegrator(ind_op,
np.ones(int(self.cycle_time)) * 30,
np.ones(int(self.cycle_time)
) * self.context.dt,
power=self.thermal_power * 1e6,
timestep_units='d')
timestep_units='s')
integrator.integrate()
spent_comps = self.deplete.get_spent_comps(
material_ids)
for assembly, spent_comp in zip(assemblies, spent_comps):
for assembly, spent_comp in zip(assemblies, spent_comps):
self.fresh_comps = np.append(self.fresh_comps, assembly.comp())
self.spent_comps = np.append(self.spent_comps, spent_comp)
assembly.transmute(spent_comp)
Expand Down

0 comments on commit 3d65ee4

Please sign in to comment.