Heating from Neutron Interaction

Hi,

I’m looking to extract the neutron heating or the deposited neutron energy spatially within a component. Currently, I am trying to modify the ‘Using CAD-Based Geometries’ to extract the neutron heating through the heating-local tally score. When doing this I can extract the flux at each point in space and the heating score, but the heating-local tally is always zero. I am running this in a docker container taken from GitHub - fusion-energy/neutronics-workshop: A workshop covering a range of fusion relevant analysis and simulations with OpenMC, DAGMC, Paramak and other open source fusion neutronics tools and I will include the script below that I am running.

#From https://nbviewer.org/github/openmc-dev/openmc-notebooks/blob/main/cad-based-geometry.ipynb

import urllib.request
import openmc
# from matplotlib import pyplot as plt


        
openmc.data.IncidentNeutron.from_njoy

##################
# DEFINE MATERIALS
##################

water = openmc.Material(name="water")
water.add_nuclide('H1', 2.0, 'ao')
water.add_nuclide('O16', 1.0, 'ao')
water.set_density('g/cc', 1.0)
#water.add_s_alpha_beta('c_H_in_H2O') Have to remove due to issue in new docker container - see OmniFlow doc 03/01/23
water.id = 41

iron = openmc.Material(name="iron")
iron.add_nuclide("Fe54", 0.0564555822608)
iron.add_nuclide("Fe56", 0.919015287728)
iron.add_nuclide("Fe57", 0.0216036861685)
iron.add_nuclide("Fe58", 0.00292544384231)
iron.set_density("g/cm3", 7.874)
mats = openmc.Materials([iron, water])
mats.export_to_xml()

##################
# DEFINE GEOMETRY
##################

teapot_url = 'https://tinyurl.com/y4mcmc3u' # 29 MB

def download(url):
    """
    Helper function for retrieving dagmc models
    """
    u = urllib.request.urlopen(url)
    
    if u.status != 200:
        raise RuntimeError("Failed to download file.")
    
    # save file as dagmc.h5m
    with open("dagmc.h5m", 'wb') as f:
        f.write(u.read())

download(teapot_url)

dagmc_univ = openmc.DAGMCUniverse(filename="dagmc.h5m")
geometry = openmc.Geometry(root=dagmc_univ)
geometry.export_to_xml()

##################
# DEFINE SETTINGS
##################

settings = openmc.Settings()
settings.batches = 5
settings.particles = 50000
settings.run_mode = "fixed source"

src_locations = ((-4.0, 0.0, -2.0),
                 ( 4.0, 0.0, -2.0),
                 ( 4.0, 0.0, -6.0),
                 (-4.0, 0.0, -6.0),
                 (10.0, 0.0, -4.0),
                 (-8.0, 0.0, -4.0))

# we'll use the same energy for each source
src_e = openmc.stats.Discrete(x=[12.0,], p=[1.0,])

# create source for each location
sources = []
for loc in src_locations:
    src_pnt = openmc.stats.Point(xyz=loc)
    src = openmc.Source(space=src_pnt, energy=src_e)
    sources.append(src)

src_str = 1.0 / len(sources)
for source in sources:
    source.strength = src_str

settings.source = sources
settings.export_to_xml()



mesh = openmc.RegularMesh()
mesh.dimension = (120, 1, 40)
mesh.lower_left = (-20.0, 0.0, -10.0)
mesh.upper_right = (20.0, 1.0, 4.0)

mesh_filter = openmc.MeshFilter(mesh)

pot_filter = openmc.CellFilter([1])
pot_tally = openmc.Tally()
pot_tally.filters = [mesh_filter, pot_filter]
pot_tally.scores = ['flux', 'heating-local', 'heating']

water_filter = openmc.CellFilter([5])
water_tally = openmc.Tally()
water_tally.filters = [mesh_filter, water_filter]
water_tally.scores = ['flux', 'heating-local', 'heating']


tallies = openmc.Tallies([pot_tally, water_tally])
tallies.export_to_xml()

openmc.run(tracks=True) # Run in tracking mode for visualisation of tracks through CAD

Apologies if this is very basic to resolve, as I am still new to OpenMC.
Thanks,
Will

Hi, what library do you use for simulation?
I encountered the same problem using FENDL-3.2, I solved it using ENDF/B-VIII.0.
Davide

Always delighted to see the neutronics-workshop is being used.

I should check the nuclear data included to see if it includes the MT reaction number 901 which is used for the heating-local tally

Hi, I just downloaded the neutronics-workshop docker image and ran your example.

I got some values on the heating-local tally. I also plotted the heating-local cross section using the nuclear data (ENDF/B8.0) present in the docker image.

Perhaps check you have the latest version with

docker pull ghcr.io/fusion-energy/neutronics-workshop

@Shimwell, @DavidePettinari Thank you both! Looks like the version of the container I was using uses ENDFB-7.1. It now gives me some heating-local tally information!

Just as a side note, is there a version of the neutronics workshop container that isn’t launched in the jupyter notebook? I am looking to run OpenMC simulations automatically, and the container for the workshop has a lot of the tools I am looking to use but would want something more lightweight to run in.

Thanks,
Will

Hi Will

Yep the workshop is a base docker image with a jupyter lab image built on top. So we should be able to make use of the base image.

Try

docker pull ghcr.io/fusion-energy/neutronics-workshop:base

docker run -it ghcr.io/fusion-energy/neutronics-workshop:base

This will give you a terminal which is handy

If you want a few files moving across you could volume mount or use the a Vs code plugin like this

Thanks, I must have missed that!