mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Add copy of existing show_flux.py
This commit is contained in:
parent
62e194e0d6
commit
59594fea70
1 changed files with 14 additions and 0 deletions
14
examples/serialized_custom_source/show_flux.py
Normal file
14
examples/serialized_custom_source/show_flux.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import matplotlib.pyplot as plt
|
||||
import openmc
|
||||
|
||||
# Get the flux from the statepoint
|
||||
with openmc.StatePoint('statepoint.10.h5') as sp:
|
||||
flux = sp.tallies[1].mean
|
||||
flux.shape = (50, 50)
|
||||
|
||||
# Plot the flux
|
||||
fig, ax = plt.subplots()
|
||||
ax.imshow(flux, origin='lower', extent=(-5.0, 5.0, -5.0, 5.0))
|
||||
ax.set_xlabel('x [cm]')
|
||||
ax.set_ylabel('y [cm]')
|
||||
plt.show()
|
||||
Loading…
Add table
Add a link
Reference in a new issue