Issue with source for fusion problem

Hi, when I run the attached code I get the following error:
ERROR: Number of entries on <lower_left> must be the same as the number of
entries on .
Traceback (most recent call last):
File “/home/mpuig/openmc/spherical_case/simulation.py”, line 129, in
openmc.run()
File “/home/mpuig/miniconda3/envs/openmc-env/lib/python3.11/site-packages/openmc/executor.py”, line 314, in run
_run(args, output, cwd)
File “/home/mpuig/miniconda3/envs/openmc-env/lib/python3.11/site-packages/openmc/executor.py”, line 125, in _run
raise RuntimeError(error_msg)
RuntimeError: Number of entries on <lower_left> must be the same as the number of entries on .

I’ve tried adding a dimension parameter to openmc.stats.Box() but it’s not a valid parameter. If someone could help me figure out where the issue is happening that would be great, thanks!
simulation.py (4.8 KB)

It looks like the problem is that RegularMesh.from_domain(...) is returning a mesh that is infinite in extent. You’ll need to manually create a RegularMesh and specify the bounds (lower_left and upper_right yourself).

1 Like

Hi Marti

Thanks for posting on here

I see that your region called nineth is defined as above + outer_sphere surface. This makes your geometry infinite.

So later when you make the mesh from the domain it receives an infinite geometry and can’t do that.

Perhaps you don’t want the outer cell in the geometry?

relevant lines of code are these …

outer_sphere = openmc.Sphere(0, 0, 0, r=2000, boundary_type='vacuum')
nineth = +outer_sphere
outer = openmc.Cell(region=nineth)
universe = openmc.Universe(cells=[layer_1, layer_2, layer_3, layer_4, layer_5, layer_6, layer_7, layer_8, outer])
mesh = openmc.RegularMesh().from_domain(geometry, dimension=[150,150,150]) 

Hi, thank you both @Shimwell @paulromano . Unfortunately I’ve tried this and it doesn’t seem to make a difference. I’ve removed the whole mesh-related part of the code and I still get the same error (RuntimeError: Number of entries on <lower_left> must be the same as the number of entries on .). I suspect it may be related to the source term as it’s the only other parameter in the problem that has a lower_left and an upper_right. Any ideas?

I confirmed that when I manually defined the mesh used in tbr_mesh_tally, the code runs fine. It should look something like:

mesh = openmc.RegularMesh()
mesh.lower_left = ...
mesh.upper_right = ...
mesh.dimension = (150, 150, 150)
mesh_filter = openmc.MeshFilter(mesh)