Help debugging MCNP code - particle lost and zero latice element found

In summary, the conversation discusses an issue with a particle lost error in an MCNP model and the need to properly define cells in the 3-D space. It is suggested to use the interactive plotter and the "ip" option to identify any geometry errors. The conversation also mentions using the "pz 0" command to get a cross section and suggests defining reflectors with simple surfaces instead of macrobodies to potentially resolve the issue with the void cell.
  • #1
AlexFi
19
5
TL;DR Summary
Help identify gap in geometry or something
I keep getting particle lost error even though there were no hole in the lattice.
Can someone identify any mistake in my code?
 

Attachments

  • OpusLEUmod6_quarter.txt
    1.8 KB · Views: 115
Last edited:
Engineering news on Phys.org
  • #2
The first thing to do is fire-up the plotting package that comes with MCNP. Look for those dotted lines around some cells. These indicate geometry errors.

In an MCNP model, every part of 3-D space must be filled with exactly one cell. There must be no gaps that are not part of a defined cell. And no point can be part of more than one cell.
 
  • Like
Likes Alex A
  • #3
To give a few more hints, search for "interactive plotter" in the manual and use the "ip" option on the command line.
 
  • Like
Likes Alex A and Grelbr42
  • #4
I ran mcnp5 ip inp=file
i means process the input file, p means plot the geometry in the interactive plotter.
I click on the "Click here or picture or menu" and type "pz 0" to get a cross section through the reactor. Nothing is coloured in, everywhere I click on the plot is cell 99. This strongly suggests an error in the definition of cell 99, the void cell. Without having much time to look into it :5:6 where 5 and 6 are macrobody surfaces "Top reflector" and "Bottom reflector" feels wrong. Defining those reflectors with simple surfaces rather than macrobodies might make defining the void cell easier.
 

FAQ: Help debugging MCNP code - particle lost and zero latice element found

What does the error "particle lost" mean in MCNP?

The "particle lost" error in MCNP indicates that the simulation has encountered a situation where it cannot determine the path or location of a particle. This usually happens when the particle exits the defined geometry or enters a region that isn't properly defined, causing the simulation to fail in tracking the particle's trajectory.

How can I resolve the "zero lattice element found" error in MCNP?

The "zero lattice element found" error occurs when a lattice cell references a lattice element that is not defined or set to zero. To resolve this, ensure that all lattice elements are properly defined and that none of them are set to zero. Double-check the input file for any missing or incorrect lattice definitions.

What are common causes of particles getting lost in MCNP simulations?

Common causes of particles getting lost in MCNP simulations include improper geometry definitions, overlapping cells, undefined regions, and numerical precision issues. Ensuring that all geometries are correctly defined and that there are no overlaps or gaps between cells can help mitigate this issue.

How can I debug my MCNP code when encountering particle lost errors?

To debug particle lost errors in MCNP, you can use the following steps: 1. Enable detailed output to trace the particle's path.2. Check the geometry definitions for any overlaps or gaps.3. Verify that all materials and cells are properly defined.4. Use the "print" card to output detailed information about the simulation.5. Simplify the problem to isolate the error by running smaller, simpler simulations.

Are there any tools or techniques to visualize MCNP geometry to help debug errors?

Yes, there are several tools and techniques available to visualize MCNP geometry, which can help in debugging errors. Some popular tools include:1. MCNP's built-in plotting capabilities using the PLOT card.2. External visualization software like VisIt or ParaView.3. Using the MCNP Visual Editor (MCNPX Visual Editor) for an interactive graphical representation.These tools can help identify geometric inconsistencies and overlaps that may be causing errors.

Similar threads

Replies
1
Views
870
Replies
4
Views
2K
Replies
3
Views
3K
Replies
4
Views
2K
Back
Top