mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Add jezebel example
This commit is contained in:
parent
eeb7925376
commit
e77ce2c0df
1 changed files with 33 additions and 0 deletions
33
examples/python/jezebel/jezebel.py
Normal file
33
examples/python/jezebel/jezebel.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import openmc
|
||||
|
||||
# Create plutonium metal material
|
||||
pu = openmc.Material()
|
||||
pu.set_density('sum')
|
||||
pu.add_nuclide('Pu239', 3.7047e-02)
|
||||
pu.add_nuclide('Pu240', 1.7512e-03)
|
||||
pu.add_nuclide('Pu241', 1.1674e-04)
|
||||
pu.add_element('Ga', 1.3752e-03)
|
||||
mats = openmc.Materials([pu])
|
||||
mats.export_to_xml()
|
||||
|
||||
# Create a single cell filled with the Pu metal
|
||||
sphere = openmc.Sphere(r=6.3849, boundary_type='vacuum')
|
||||
cell = openmc.Cell(fill=pu, region=-sphere)
|
||||
geom = openmc.Geometry([cell])
|
||||
geom.export_to_xml()
|
||||
|
||||
# Finally, define some run settings
|
||||
settings = openmc.Settings()
|
||||
settings.batches = 200
|
||||
settings.inactive = 10
|
||||
settings.particles = 10000
|
||||
settings.export_to_xml()
|
||||
|
||||
# Run the simulation
|
||||
openmc.run()
|
||||
|
||||
# Get the resulting k-effective value
|
||||
n = settings.batches
|
||||
with openmc.StatePoint(f'statepoint.{n}.h5') as sp:
|
||||
keff = sp.k_combined
|
||||
print(f'Final k-effective = {keff}')
|
||||
Loading…
Add table
Add a link
Reference in a new issue