From bdec9759236b02bc1a35641922494ae7377955c7 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 9 Jan 2022 13:11:27 -0600 Subject: [PATCH] Fix material density in ResultsList.export_to_materials --- examples/pincell_depletion/restart_depletion.py | 8 +++++--- examples/pincell_depletion/run_depletion.py | 4 ++-- openmc/deplete/results_list.py | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/pincell_depletion/restart_depletion.py b/examples/pincell_depletion/restart_depletion.py index 0bbab57a58..6a38b4bd98 100644 --- a/examples/pincell_depletion/restart_depletion.py +++ b/examples/pincell_depletion/restart_depletion.py @@ -39,9 +39,11 @@ settings.entropy_mesh = entropy_mesh # Initialize and run depletion calculation ############################################################################### +model = openmc.Model(geometry=geometry, settings=settings) + # Create depletion "operator" -chain_file = './chain_simple.xml' -op = openmc.deplete.Operator(geometry, settings, chain_file, previous_results) +chain_file = 'chain_simple.xml' +op = openmc.deplete.Operator(model, chain_file, previous_results) # Perform simulation using the predictor algorithm time_steps = [1.0, 1.0, 1.0, 1.0, 1.0] # days @@ -71,7 +73,7 @@ time, Xe_capture = results.get_reaction_rate('1', 'Xe135', '(n,gamma)') days = 24*60*60 plt.figure() -plt.plot(time/days, keff, label="K-effective") +plt.plot(time/days, keff[:, 0], label="K-effective") plt.xlabel("Time (days)") plt.ylabel("Keff") plt.show() diff --git a/examples/pincell_depletion/run_depletion.py b/examples/pincell_depletion/run_depletion.py index 72e71afe5a..1343e8b593 100644 --- a/examples/pincell_depletion/run_depletion.py +++ b/examples/pincell_depletion/run_depletion.py @@ -87,7 +87,7 @@ settings.entropy_mesh = entropy_mesh model = openmc.Model(geometry=geometry, settings=settings) # Create depletion "operator" -chain_file = './chain_simple.xml' +chain_file = 'chain_simple.xml' op = openmc.deplete.Operator(model, chain_file) # Perform simulation using the predictor algorithm @@ -118,7 +118,7 @@ time, Xe_capture = results.get_reaction_rate('1', 'Xe135', '(n,gamma)') days = 24*60*60 plt.figure() -plt.plot(time/days, keff, label="K-effective") +plt.plot(time/days, keff[:, 0], label="K-effective") plt.xlabel("Time (days)") plt.ylabel("Keff") plt.show() diff --git a/openmc/deplete/results_list.py b/openmc/deplete/results_list.py index 2dc486feb3..a9a0e52119 100644 --- a/openmc/deplete/results_list.py +++ b/openmc/deplete/results_list.py @@ -361,6 +361,7 @@ class ResultsList(list): mat_id = str(mat.id) if mat_id in result.mat_to_ind: mat.volume = result.volume[mat_id] + mat.set_density('sum') for nuc in result.nuc_to_ind: if nuc not in available_cross_sections: continue