Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change depletion time step sizes #22

Merged
merged 3 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
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
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
Loading