Issue with lost particles from DAGMC geometry

I’m new to OpenMC, following @Shimwell 's tutorial, specifically a variant of this notebook.

I have created a SphericalShell geometry in paramak and exported it as DAGMC: spherical_shell_example.h5m. DAGMC checks on the geometry show that it has no leaky surfaces or volumes.

Material assignments work fine (inner sphere as a D-T plasma) and I am placing a source in the middle:

my_settings.source = openmc_plasma_source.FusionPointSource(fuel="DT", temperature=20000.0, coordinate=(0,0,0))

Unfortunately, OpenMC only simulates a single batch because 100% of particles are lost. I’m baffled - suggestions welcome, please!

Welcome to the community

Happy to take a look at this, are you able to post the full edited example.

All the best

Jon

Thanks - here goes…

import openmc
import openmc_plasma_source as ops  
import openmc_tally_unit_converter as otuc
import neutronics_material_maker as nmm

filedir = '/path/to/file/'
filename = 'spherical_shell_example.h5m'

bound_dag_univ = openmc.DAGMCUniverse(filename=filedir+filename).bounded_universe()
my_geometry = openmc.Geometry(root=bound_dag_univ)

mat1 = nmm.Material.from_library(name='DT_plasma').openmc_material
mat1.name = 'sphere-plasma'
mat2 = nmm.Material.from_library(name='tungsten').openmc_material
mat2.name = 'sphere-fw'
mat3 = nmm.Material.from_library(name='lithium-lead',temperature=900.0).openmc_material
mat3.name = 'sphere-blanket'
mat4 = nmm.Material.from_library(name='SS_316L_N_IG').openmc_material
mat4.name = 'sphere-shield'

materials = openmc.Materials([mat1, mat2, mat3, mat4])

tally1 = openmc.Tally()
material_filter = openmc.MaterialFilter(mat3)  # the blanket material
tally1 = openmc.Tally(name='blanket_heating')
tally1.filters = [material_filter]
tally1.scores = ['heating']

my_tallies = openmc.Tallies([tally1])

my_settings = openmc.Settings(batches = 1, particles = 100, run_mode = 'fixed source')

my_settings.source = ops.FusionPointSource(fuel="DT", temperature=20000.0, coordinate=(0,0,0))

my_model = openmc.Model(
    materials=materials, geometry=my_geometry, settings=my_settings, tallies=my_tallies
)

statepoint_file = my_model.run()

sp = openmc.StatePoint(statepoint_file)

heating_tally = sp.get_tally(name='blanket_heating')
heating_tally.get_values().sum()

tally = otuc.process_tally(
    heating_tally,
)
print(tally)

I changed the material filter to mat1 and got a score

I can’t get a score for materials 2, 3, or 4

My only thought is that the surfaces are not being created correctly and particles don’t leave material 1 for material 2.

I think the dagmc geometry might need meshing with smaller triangles the defaults could be reduced a bit ( min_mesh_size: float = 5,
max_mesh_size: float = 20)

Also it might be worth increasing the particle and batch count

This sort of geometry might be easier and quicker as a native openmc CSG geometry. It looks like nested spheres to me which openmc.Sphere can do very well.

I changed the mesh size to min 0.01 and larger batch sizes, but the problem still occurs: new geometry. Not just with this example geometry, but also others from paramak. Will try the native openmc geometry…

Sorry to hear the paramak is misbehaving, if you want to throw the paramak scripts on an issue on the paramak GitHub or here I can double check.

Do you need any help with the native geometry