Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update api usage decay photon #254

Merged
merged 2 commits into from
Nov 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import numpy as np
import openmc
import openmc.deplete
import pint
from pathlib import Path
import math
from matplotlib.colors import LogNorm
Expand All @@ -13,7 +12,7 @@
# the chain file was downloaded with
# pip install openmc_data
# download_endf_chain -r b8.0
openmc.config['chain_file'] = '/nuclear_data/chain-endf-b8.0.xml'
# openmc.config['chain_file'] = '/nuclear_data/chain-endf-b8.0.xml'
# openmc.config['cross_sections'] = 'cross_sections.xml'

# a few user settings
Expand Down Expand Up @@ -85,7 +84,7 @@

model_neutron = openmc.Model(my_geometry, my_materials, my_neutron_settings)

hour_in_seconds = pint.Quantity(1.0, "hour").to("s").magnitude
hour_in_seconds = 60*60

# This section defines the neutron pulse schedule.
# Warning, be sure to add sufficient timesteps and run the neutron simulation with enough
Expand Down Expand Up @@ -180,7 +179,7 @@
# gets the activated material using the material id
activated_mat = results[i_cool].get_material(str(material_id))
# gets the energy and probabilities for the
energy = activated_mat.decay_photon_energy
energy = activated_mat.get_decay_photon_energy()
strength = energy.integral()

if strength > 0.: # only makes sources for
Expand All @@ -199,7 +198,7 @@


# one should also fill the cells with the activated material
# the activated material contains ALL the iotopes produced during activation
# the activated material contains ALL the nuclides produced during activation
# sphere_cell_2.fill = results[i_cool].get_material("1")
# sphere_cell_3.fill = results[i_cool].get_material("2")
# my_geometry = openmc.Geometry([sphere_cell_1, sphere_cell_2, sphere_cell_3])
Expand All @@ -208,7 +207,7 @@
# so you could make use of openmc.deplete.Results.export_to_materials to export the modified activated material that
# just contains isotopes that appear in your cross_sections.xml

# however in this example we just use the original prisine material my_materials that were cloned earlier
# however in this example we just use the original pristine material my_materials that were cloned earlier
# my_geometry is also the same as the neutron simulation
pristine_mat_iron.id = 1
pristine_mat_aluminium.id =2
Expand Down