Where could be my mistake?

Dear all

As I have mentioned in previous posts, I am creating a fuel element model with hexagonal geometry (see Figure 1) and which includes TRISO particles uniformly located in thin stripes. At this moment, when I simulate the full geometry, many warnings and an error message appear. So, I did some tests with a reduced geometry, below what I did:

1- Create a model with one-third of the full geometry (see Figure 2) and with all boundary conditions (py01, py42, p01, p08, pz1 & pz2) as reflective. With these conditions, the simulation runs!

2- Create a model with two-thirds of the full geometry (see Figure 3). This model includes periodic (p08 & p11) and reflective (py01, p16, py42, p12, pz01 & pz02) boundary conditions. In this case, the simulation also runs!

3- Finally, when I include Cell 3 in the model and define all the edges of the hexagon as periodic boundary conditions (see Figure 1), the simulation shows many warnings like the following:

WARNING: After particle 5001 crossed surface 416 it could not be located in any cell and it did not leak.

I want to highlight that surface 416 is the common factor in all warnings. This surface is plane p16 in Figure 3 and it divides Cell 2 from Cell 3. After the warnings, an error message is shown and the simulation stops:

ERROR: Maximum number of lost particles has been reached.

I read the Troubleshooting Section and it is mentioned that “…If proper boundary conditions have been applied and you still receive this error, it means that a surface/cell/lattice in your geometry has been specified incorrectly or is missing.” I have carefully reviewed my geometry and boundary conditions but I didn’t find any mistake.

I do not understand what could happen when I include Cell 3 if everything was working with two cells. I fill Cell 3 with the same universe I filled Cell 1 and Cell 2, the only difference is the rotation angle.

Please, if anyone could give me some tips, I appreciate it because right now I really don’t see where could be my mistake. I could also share the python script if someone wants to see it with more details.

Thanks in advance for the help,

Javier

Figure 2.jpg

Hi Javier – can you please share the Python script that you are using to produce this model? It is not possible to diagnose the problem without seeing your script.

Best,
Paul

Hi Paul,

I sent you the script.

Thanks,
Javier

Hi Javier,

There are two problems with your model. The first problem is that it looks you are manually assigning an ID to one of your universes that has already been assigned to a lattice (lattices and universes share IDs). This results in an infinite recursion in your model – one cell is contained in universe 3, and it is also filled with universe 3. I would recommend avoiding manually setting IDs as the Python API will do this for you automatically. For what it’s worth, you should see warnings when you do this (at least I did when I ran your script). You have a few cases of surfaces that are using the same ID too, but those are less problematic.

The other issue is in how you are defining your general planar surfaces. You are relying on a coefficient b=0.8660254 for some of these planar surfaces, which is almost, but not quite, equal to sqrt(3)/2. This causes problems for OpenMC because you are taking a universe and rotating it by 120 degrees to fill these different cells. The only way that OpenMC can figure out where a particle is when it moves from cell 2 to cell 3 is if there is exact alignment (it can recognize when a particle is coincident with a surface). However, if the plane is just slightly off, this won’t work. The solution is to do the following:

from math import sqrt

p = openmc.Plane(…, b=sqrt(3)/2, …)

This ensures that things will align exactly, and you shouldn’t end up with any particles getting mysteriously lost. This is one of the big benefits of having a Python API – you don’t have to rely on approximations when you can just call math functions directly.

Hope this helps.

Best,
Paul

Hi Paul,

I did what you recommended and the model is runnning.

Thank you very much for your help.
Javier

Hi Paul,

Let me ask you another question.
If I want to declare the duration of my simulation, what information should I get from the Timing Statistics: ‘Total time in simulation’ or ‘Total time elapsed’?

Thanks,
Javier

Hi Javier,

It’s not possible to directly declare the “simulation time” (i.e., to say you want your simulation to end after X mins), so the time elapsed will just depend on how many particles/batches you specified and how fast the machine you are running on is. However, you could achieve something like this using the Python bindings to our C API. The following code would run a simulation for a specified number of seconds (in this case 20):

import time
import openmc.lib

seconds = 20.0

openmc.lib.init()
openmc.lib.simulation_init()
t0 = time.time()
while time.time() - t0 < seconds:
openmc.lib.next_batch()
openmc.lib.simulation_finalize()
openmc.lib.finalize()

Best regards,
Paul

Okay Paul, thank you!

Regards,
Javier