Cylindrical geometry, More than 95% of external source sites sampled were rejected

Hi all,

I am a newbie to openmc. I am working on fusion application but for a first study, I would like to stick to a cylindrical geometry. While trying to do so, I repetitively got the error :

ERROR: More than 95% of external source sites sampled were rejected. Please                                                           check your external source definition.

From what I understand, it is probably due to a particle leakage resulting from a faulty definition of the geometry. Here is my script with a simplified geometry :

import openmc
import json

# MATERIALS
#iron
density_of_iron_in_g_per_cm3 = 7.75
iron = openmc.Material(name='Iron')
iron.set_density('g/cm3', density_of_iron_in_g_per_cm3)
iron.add_element('Fe', 1.0, percent_type='wo')
#lithium
lithium = openmc.Material(name='Lithium')
lithium.set_density('g/cm3',0.535)
lithium.add_element('Li',1.0)
#materials
my_material = [iron, lithium]
mats = openmc.Materials(my_material)

# GEOMETRY
# Create concentric cylindrical surfaces
inner_surf = openmc.ZCylinder(r=100 , name='inner_surf')
inter_surf = openmc.ZCylinder(r=150, name='inetr_surf')
outer_surf = openmc.ZCylinder(r=160, name='outer_surf', boundary_type='vacuum')
#Create horizontal planes
bottom_p =  openmc.ZPlane(z0=-200, name='Front plane' , boundary_type='reflective')
top_p =  openmc.ZPlane(z0=200, name='Back plane' , boundary_type='reflective')
#Create region
blanket_region = +inner_surf & -inter_surf & +bottom_p & -top_p 
vessel_region = +inter_surf & -outer_surf & +bottom_p & -top_p
# Create cells, mapping materials to regions
blanket_cell = openmc.Cell(fill = lithium, region = blanket_region)
vessel_cell = openmc.Cell(fill = iron, region = vessel_region)
# Create a geometry and export to XML
universe = openmc.Universe(cells=[blanket_cell,vessel_cell])
geom = openmc.Geometry(universe)                    
geom.export_to_xml()  

# SIMULATION SETTINGS
# Instantiate a Settings object
sett = openmc.Settings()
batches = 10
sett.batches = batches
sett.inactive = 0
sett.particles = 10000
sett.run_mode = 'fixed source'
# Create a DT point source
source = openmc.Source()
source.space = openmc.stats.Point((0, 0, 0))
source.angle = openmc.stats.Isotropic()
source.energy = openmc.stats.Discrete([14e6], [1])
sett.source = source

#TALLY DPA COMPUTATION
tallies = openmc.Tallies()
# added a cell tally for DPA to the iron vessel cell
cell_filter = openmc.CellFilter(vessel_cell)
reaction_tally = openmc.Tally(name='DPA')
reaction_tally.filters = [cell_filter]
reaction_tally.scores = ['444']  # note use of 444 in string format
reaction_tally.nuclides = ['Fe54', 'Fe56', 'Fe57', 'Fe58'] # this records the tally for each nuclide in the list
tallies.append(reaction_tally)

#RUN THE SIMULATION
model = openmc.model.Model(geom, mats, sett, tallies)

Any idea how to fix it ?

I ran the above script in the geometry debug mode and obtain this:

Minimum neutron data temperature: 294.0 K                                                                                                                                                                                                 
Maximum neutron data temperature: 294.0 K                                                                                                                                                                                                    
Reading tallies XML file...                                                                                                                                                                                                                  
Preparing distributed cell instances...                                                                                                                                                                                                      
Writing summary.h5 file...                                                                                                                                                                                                                   
WARNING: Cell overlap checking is ON.                                                                                                                                                                                                        
Maximum neutron transport energy: 20000000.0 eV for Fe58
Maximum neutron transport energy: 20000000.0 eV for Fe58                                                                                                                                                                                                                                                                                                                                                                                                                                  
===============>     FIXED SOURCE TRANSPORT SIMULATION     <===============                                                                                                                                                                                                                                                                                                                                                                                                               
Simulating batch 1                                                                                                                                                                                                                           
ERROR: More than 95% of external source sites sampled were rejected. Please                                                                                                                                                                         
check your external source definition.                                                                                                                                                                                               
Segmentation fault  

(If this helps)

A subsidary question :
Is the following will be the correct manner to define a uniform cylindrical DT source ?

# Create a cylindrical DT source
source = openmc.Source()
rad_src = openmc.stats.Uniform(a=0, b=100)
phi_src = openmc.stats.Uniform(a=0, b=2*3.14159265359)
z_src = openmc.stats.Uniform(a=-200, b=200)
origin_src = (0.0, 0.0, 0.0)
source.space = openmc.stats.CylindricalIndependent(r=rad_src, phi=phi_src, z=z_src,origin=origin_src)
source.angle = openmc.stats.Isotropic()
source.energy = openmc.stats.Discrete([14e6], [1])
sett.source = source
sett.run_modes = 'fixed source'

Thanks in advance for any clue.

1 Like

Hi all,

After many iterations, it seems that the problem was that I had not assigned a cell to the source area. So it was as if I had put the source in vacuum.
Could this be it?

Yes, that’s correct. If you have regions of your problem that are void but still have particles traveling through them, they need to be defined in a cell that appears in the geometry. Void cells are created by instantiating a Cell object and not assigning a fill, or equivalently assigning a fill of None.

2 Likes

Rather than start a new topic, I have a related question to this one - but it is much simpler.

I want to compute keff for a hollow cylinder. This is to prepare a criticality safety table.

I created a hollow cylinder like so:

Instantiate Surfaces

B1 = openmc.ZPlane(surface_id=1, z0= 0, name=‘B1’)
B2 = openmc.ZPlane(surface_id=2, z0= 14, name=‘B2’)
R1 = openmc.ZCylinder(surface_id=11, x0=0, y0=0, r=5.0, name=‘R1’)
R2 = openmc.ZCylinder(surface_id=12, x0=0, y0=0, r=7.0, name=‘R2’)

B1.boundary_type = ‘vacuum’
B2.boundary_type = ‘vacuum’
R1.boundary_type = ‘vacuum’
R2.boundary_type = ‘vacuum’

Instantiate Cells

cellF1 = openmc.Cell(cell_id=101, name=‘cellF1’)

Use surface half-spaces to define regions

cellF1.region = +B1 & -B2 & +R1 & -R2

settings_file.source = openmc.Source(space=openmc.stats.Point(xyz=(6,0,7)))

And it fails with the:
ERROR: More than 95% of external source sites sampled were rejected. Please
check your external source definition.

As a first cut (and creating sources in cylindrical geometry looks complicated) I wanted to test simply placing a source at a point in the cylinder material.

But I am thinking that maybe my geometry definition does not work. Do I need to fill space in the model and create an internal empty cell in the middle of the hollow cylinder?

@careysub Yes, you would need to create a void cell in the middle of the cylinder as:

empty_cell = openmc.Cell(region=-R1)

Also, you should not set the boundary condition on R1 to be vacuum. Otherwise, particles will not be able to travel between cellF1 and the empty cell. The default boundary condition (transmission) on R1 is what you want.

1 Like