Discussion on surfaceFilter tally output

Hi all:
I am having a difficulty measuring ‘current’ through a spherical geometry while using 2 different materials at 2 different regions. I have declared the geometry and defined the materials as following: (I am adding the code as text here)

import openmc
import numpy as np
import pandas as pd
import openmc.geometry
import openmc.stats
openmc.config[‘cross_sections’]=‘/Users/sayedahmed/Downloads/Cross_section/endfb-viii.0-hdf5/cross_sections.xml’

z=10 #first material distance so that removal CS times z is less than 5 and approximately 2
x=120 #detector distance

#Spheres
outer_sphere= openmc.Sphere(r=200, boundary_type=‘vacuum’)
detector_sphere= openmc.Sphere(r=z+x)
first_sphere= openmc.Sphere(r=z)

#regions
inside_outer= -outer_sphere & +detector_sphere #everything between outer_sphere and detector sphere
detector_region= -detector_sphere & +first_sphere #everything between detector sphere and first sphere
additional_material_region= -first_sphere #everything inside first sphere

#Cells
water_cell= openmc.Cell(name=‘Water’, fill=water, region=inside_outer)
detector_cell= openmc.Cell(name=‘Detector’, fill=water, region=detector_region)
first_cell= openmc.Cell(name=‘Shield’, fill=additional_material, region=additional_material_region)

#universe
universe= openmc.Universe(cells=[water_cell,detector_cell,first_cell])
geometry= openmc.Geometry(universe)
geometry.export_to_xml()
a=1.18e6

b=1.03419e-6

energy_dist= openmc.stats.Watt(a,b)

#Neutron source

source = openmc.IndependentSource()

source.space = openmc.stats.Point((0.0,0.0,0.0))

source.angle = openmc.stats.Isotropic()

source.energy = energy_dist

#Settings

settings= openmc.Settings()

settings.source= source

settings.batches=100

settings.inactive=10

settings.particles= 100000

settings.run_mode= ‘fixed source’

settings.export_to_xml()
#Tallies

tallies=openmc.Tallies()

surface_filter= openmc.SurfaceFilter(detector_sphere)

energy_filter= openmc.EnergyFilter([0.0, 0.625])

tally= openmc.Tally(name=‘Thermal fluence’)

tally.filters.append(surface_filter)

tally.filters.append(energy_filter)

tally.scores= [‘current’]

tallies.append(tally)

tallies.export_to_xml()

using this material, neutron source, geometry and tallies the output current I am getting is 0. However, if I change the material from Pt to Pb and double the radius of the first sphere then I get a value of output current. What must I do to be able to measure current for any material??

Any reply from anyone is highly appreciated!!
Regards
Sayed

What is your material definition ? It seems you filter only thermal and epithermal neutrons while you have a case with no moderation. So the statistics you will build will be poor.

Check your source (energy spectrum) definition and materials, make sure they make sense in the case you want to study.

Otherwise, you can try using weightwindows to improve statistics.

Thanks for your reply!
I want to see the moderation effect of water. So I have described the neutron source to emit fast neutrons(built in watt distribution function) and want to measure the current or flux at a distance of 120 cm to see the moderation effect of water and the effect of any other material between the source and the water.
And I am getting a tally output 0 for current.
What must I do to get a value of tally output using this model?

Also if I have to use weightwindow near the detector surface which requires creating a mesh.. Can you guide me how to do that properly while defining a mesh near a spherical surface?

What is your definition of water ? It is also slightly absorbant so your neutron might disappear before reaching your surface. Try lowering x to 5. or 10. to check if you have a current. if you do have current, it means your detector is too far and you will need to use WW

Here is helpful ressources to help you with WW openmc_weight_window_generator/examples/generate_iterative_weight_windows.ipynb at master · fusion-energy/openmc_weight_window_generator · GitHub

Thank you so much for your time!