diff --git a/examples/python/pincell_depletion/run_depletion.py b/examples/python/pincell_depletion/run_depletion.py index 8c12211bc..a17bf5fd9 100644 --- a/examples/python/pincell_depletion/run_depletion.py +++ b/examples/python/pincell_depletion/run_depletion.py @@ -49,7 +49,7 @@ borated_water.add_element('O', 2.4e-2) borated_water.add_s_alpha_beta('c_H_in_H2O') ############################################################################### -# Exporting to OpenMC geometry.xml file +# Create geometry ############################################################################### # Instantiate ZCylinder surfaces @@ -94,7 +94,7 @@ root.add_cells([fuel, gap, clad, water]) geometry = openmc.Geometry(root) ############################################################################### -# Exporting to OpenMC materials.xml file +# Volumes of depletable materials ############################################################################### # Compute cell areas @@ -105,7 +105,7 @@ area[fuel] = np.pi * fuel_or.coefficients['R'] ** 2 uo2.volume = area[fuel] ############################################################################### -# Exporting to OpenMC settings.xml file +# Transport calculation settings ############################################################################### # Instantiate a Settings object, set all runtime parameters, and export to XML diff --git a/openmc/deplete/results_list.py b/openmc/deplete/results_list.py index 58e4b66dc..a12b16ab4 100644 --- a/openmc/deplete/results_list.py +++ b/openmc/deplete/results_list.py @@ -103,3 +103,18 @@ class ResultsList(list): eigenvalue[i] = result.k[0] return time, eigenvalue + + def transfer_volumes(self, geometry): + """Transfers volumes from depletion results to geometry + + Parameters + ---------- + geometry : OpenMC geometry to be used in a depletion restart + calculation + + """ + cells = geometry.get_all_material_cells() + for c in cells: + material = next(iter(cells[c].get_all_materials().values())) + if material.depletable == True: + material.volume = self[0].volume[str(material.id)] diff --git a/openmc/material.py b/openmc/material.py index cfa3eba3c..dac2fe14a 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -467,7 +467,7 @@ class Material(IDManagerMixin): raise ValueError(msg) # Generally speaking, the density for a macroscopic object will - # be 1.0. Therefore, lets set density to 1.0 so that the user + # be 1.0. Therefore, lets set density to 1.0 so that the user # doesnt need to set it unless its needed. # Of course, if the user has already set a value of density, # then we will not override it. diff --git a/src/summary.F90 b/src/summary.F90 index bd6ef7158..de3d20a17 100644 --- a/src/summary.F90 +++ b/src/summary.F90 @@ -440,6 +440,7 @@ contains if (m % depletable) then call write_attribute(material_group, "depletable", 1) + call write_attribute(material_group, "volume", m % volume) else call write_attribute(material_group, "depletable", 0) end if @@ -500,7 +501,7 @@ contains call write_dataset(material_group, "nuclides", nuc_names) ! Deallocate temporary array deallocate(nuc_names) - ! Write atom densities + ! Write nuclide atom densities call write_dataset(material_group, "nuclide_densities", nuc_densities) deallocate(nuc_densities) end if