diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e3b0987..a9851ba 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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:** diff --git a/openmcyclus/DepleteReactor.py b/openmcyclus/DepleteReactor.py index 1877de9..d9a96ac 100644 --- a/openmcyclus/DepleteReactor.py +++ b/openmcyclus/DepleteReactor.py @@ -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): ''' @@ -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() @@ -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)