Fix material density in ResultsList.export_to_materials

This commit is contained in:
Paul Romano 2022-01-09 13:11:27 -06:00
parent d12e390f1a
commit bdec975923
3 changed files with 8 additions and 5 deletions

View file

@ -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()

View file

@ -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()

View file

@ -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