MCNP6: error -- "bad trouble in imcn" is usually tangled with spacing error?

  • Thread starter HHJo
  • Start date
  • Tags
    Mcnp6
In summary, the error message "bad trouble in imcn" in MCNP6 is typically associated with spacing errors in the input file. This issue can arise from incorrect formatting or misalignment of data, leading to complications in the program's execution. Users are advised to carefully check their input for proper spacing to resolve this error.
  • #1
HHJo
4
3
Hello,

I'm new to MCNP deck-building, and I'm trying to acquire an X-ray energy spectrum using MCNP6, on Windows 10 environment. I'm running MCNP6 via MCNPX Visual Editor Version X_24E, and the deck is input using built-in "Input File" tab in MCNPX Visual Editor. My input deck is given below.

***** Start
MCNP 5MeV Spectrum
c ------------------------------
c Cell Cards
c ------------------------------
1 1 -19.25 1 -2 3 -4 5 -6
2 0 -7
3 0 -1 2 -3 4 -5 6 7 -8

c ------------------------------
c Surface Cards
c ------------------------------
c Tungsten target
1 PZ -2.5
2 PZ 2.5
3 PY -0.15
4 PY 0.15
5 PX -2.5
6 PX 2.5
c Detector
7 RCC 0 30 0 0 10 0 5
c World
8 SO 100

c ------------------------------
c Data Cards
c ------------------------------
MODE E P
IMP:E 1 1 1
IMP:P 1 1 1
SDEF POS=0 -18 0 VEC=0 1 0 DIR=1 ERG=5 PAR=E CEL=3
F8:P 2
E8 0 298I 5
M1 74000 1
NPS 100000000

***** End

And I'm getting MCNP FATAL ERROR, which reads as following,

***** Start
bad trouble in imcn in routine imcn
source particle no.
starting random number =
error getting memorybly a control character, in column 3
***** End

I've seen a post that says that "bad trouble in imcn" is usually tangled with spacing error, so I changed "tab spaces" to "space-bar spaces," but the problem is not resolved. I'm not familiar with MCNP, so any kind of advices will be grateful.HwanHui Jo
 
Engineering news on Phys.org
  • #2
Welcome to physicsforms HwanHui Jo,

The error message seems damaged. It resembles one where a control code ASCII char is in the input instead of text. It appears to have been wiped by physicsforums formatting and when I run your input deck I get a different error that results from cell 3 not being properly specified. Your box is everything above a minimum that is also below a maximum. If you reverse this to describe outside the box you get everything below a minimum that is also above a maximum. What you want is the union operator :

That allows you to specify everything below a minimum and, additionally, everything above a maximum.

You should also add a void cell, a cell with zero importance around your world cell. This is so neutrons are not tracked forever.
 
  • Informative
  • Like
Likes Astronuc and berkeman
  • #3
Alex A said:
Welcome to physicsforms HwanHui Jo,

The error message seems damaged. It resembles one where a control code ASCII char is in the input instead of text. It appears to have been wiped by physicsforums formatting and when I run your input deck I get a different error that results from cell 3 not being properly specified. Your box is everything above a minimum that is also below a maximum. If you reverse this to describe outside the box you get everything below a minimum that is also above a maximum. What you want is the union operator :

That allows you to specify everything below a minimum and, additionally, everything above a maximum.

You should also add a void cell, a cell with zero importance around your world cell. This is so neutrons are not tracked forever.
Thanks for your kind reply! I tried copy-pasting the deck on the physics forum, but still getting the same error message. Think my MCNP or vised24 build is broken somewhere. I'll make sure to try your solution after re-building it.
 
  • #4
Try renaming the input file and the output file to add .txt and attach them to a post. Try also running this version which for me gives the error "pos point source is not located in sdef cel 3.".

Edit,
We may also need to check for correct 0d 0a at the end of lines if you are in windows.
 

Attachments

  • spectrum.txt
    574 bytes · Views: 82
  • #6
Tom.G said:
See also:
https://www.physicsforums.com/posts/6929152

Iit states:
"Blank lines being the section breaks is probably the biggest gotcha."
Dear Tom.G,

Separating cards with no blank lines gave me runtime error. Sadly it was not a solution in my case.
 
  • Informative
Likes Tom.G
  • #7
Hello,

My problem has been fully resolved and I succeeded to acquire an X-ray energy spectrum in a water slab. To wrap up, I want to share my course of troubleshooting. My full MCNP deck for the X-ray energy spectrum is attached.

1. The first thing I did was replacing all "tab-spacings" with "space bar-spacings." Tab-spacing is a handy way of aligning each lines and elements in your input deck, but it may cause fatal error when running the MCNP.

2. The second thing I did was re-visiting my geometry (a.k.a. cell cards). Make sure to always envelop your world with void. From the point of a particle, the boundary of your world is not the end of the propagation. If nothing defined, it will propagate endlessly. Defining void surrounding your world will effectively "cut" the propagation of the particle. In my input deck, Cell #4 in the Cell Cards is the void enveloping my world. Use VisEd to check whether your cells were generated as intended, it helped me alot.

3. The last thing I did was checking the environmental variables. Upon checking them, I found that my "DATAPATH" in the "system variables" was damaged. Make sure to add your directory to "xsdir" in your "DATAPATH" environmental variable. Usually "xsdir" is in "YOUR_MCNP\MCNP_data."

This is the course I went through to resolve my problem with MCNP deck building. Things are elementary, yet so easy to overlook. Hope other newcomers get some help and insights like I did.HwanHui Jo
 

Attachments

  • spectrum.txt
    624 bytes · Views: 67
  • Informative
Likes Alex A and Tom.G

FAQ: MCNP6: error -- "bad trouble in imcn" is usually tangled with spacing error?

What does the error "bad trouble in imcn" in MCNP6 typically indicate?

The error "bad trouble in imcn" in MCNP6 generally indicates a serious issue with the geometry or input file. It often points to inconsistencies or mistakes in the problem setup, such as overlapping cells, incorrect cell definitions, or issues with the material assignments.

How can spacing errors cause the "bad trouble in imcn" error in MCNP6?

Spacing errors in MCNP6 input files, such as extra spaces, tabs, or misaligned columns, can lead to the "bad trouble in imcn" error. MCNP6 is very sensitive to the formatting of its input files, and even minor deviations can cause it to misinterpret the data, leading to this error.

What steps can I take to troubleshoot the "bad trouble in imcn" error in MCNP6?

To troubleshoot the "bad trouble in imcn" error, you should carefully review your input file for any formatting issues, such as extra spaces or misaligned columns. Additionally, check for overlapping cells, incorrect cell definitions, and ensure that all material assignments are correct. Using a text editor with syntax highlighting for MCNP6 can help identify these issues more easily.

Are there any tools or utilities that can help identify the cause of the "bad trouble in imcn" error in MCNP6?

Yes, there are several tools and utilities that can assist in identifying the cause of the "bad trouble in imcn" error. The MCNP6 code itself has built-in diagnostic tools that can provide more detailed error messages. Additionally, third-party tools like visual editors for MCNP input files or geometry visualization tools can help you spot errors in your setup more easily.

Can the "bad trouble in imcn" error be related to issues other than spacing or formatting?

Yes, while spacing and formatting errors are common causes, the "bad trouble in imcn" error can also be related to other issues such as incorrect geometry definitions, overlapping cells, improper use of surface cards, or logical errors in the input file. Thoroughly checking all aspects of your input file is essential to resolving this error.

Similar threads

Back
Top