MCNP Code Error -- Need to find the cause of the error

  • Thread starter Thread starter Anisur Rahman
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around troubleshooting an MCNP code error related to a simulation involving a bare 252Cf source. Participants are examining the code structure, input parameters, and output discrepancies, focusing on technical aspects of the MCNP software and its requirements for input formatting and data representation.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant shares a detailed MCNP code for simulating a 252Cf source and requests assistance in identifying errors.
  • Another participant suggests removing a blank line between the si and sp cards and correcting a formatting issue in the sp data.
  • A participant mentions that they derived their si and sp data from the ISO_8529_1(2001) report and did not normalize the source probability, assuming MCNP would handle it.
  • Suggestions are made to adjust the input format, including ensuring lines do not exceed 80 characters and correcting the number of blank lines in the input file.
  • One participant indicates that the program requires the volume for a specific cell and suggests calculating it to avoid incorrect results.
  • Another participant expresses confusion regarding the output graphs and requests clarification on how to align the MCNP results with expected spectrometry results.
  • There is a recommendation to graph the SI/SP data to verify the input spectrum and ensure that energy bins are appropriately sized for comparison with expected results.

Areas of Agreement / Disagreement

Participants generally agree on the need for specific formatting and input corrections, but there is no consensus on the cause of the new error that appeared after initial corrections. The discussion remains unresolved regarding the alignment of MCNP output with expected spectrometry results.

Contextual Notes

Participants note limitations related to input formatting, the necessity of proper volume calculations, and the importance of energy bin consistency in the output graphs. There are unresolved questions about the source probability normalization and the interpretation of output graphs.

Anisur Rahman
Messages
15
Reaction score
1
TL;DR
Where am I making a mistake in this code? I just want to obtain the neutron spectrum of a Cf-252 source, but the code keeps showing an error. Unfortunately, I can’t figure out where the problem is. Could someone please help me identify the error?
c Code for bare 252Cf at 100 cm from source
c cell cards
10 1 -15.1 -101 $ Cf Source Cell
11 2 -8.0 -102 101 $ Stainless-Steel
12 3 -2.699 102 -103 $ Aluminium Pipe
13 4 -1 -104 #10 #11 #12 $ Detector Cell
14 4 -0.001205 -129 #10#11#12#13 $ Air
15 0 129 $ Outside World

c surface cards
101 rcc 0 0 0.98 0 0 -1.96 0.47
102 rcc 0 0 5.5 0 0 -11 2.25
103 rcc 0 0 5.6 0 0 -11.2 2.35
104 s -100 0 0 10
129 box -200 -200 -200 400 0 0 0 400 0 0 0 400

c data cards
mode n
m1 98252.70c -1.0
m2 26000 -0.695 24000 -0.190 28000 -0.095 25000 -0.020 $Stainless steel
m3 13027.60c -1 $ Aluminium
m4 6000 -0.000124 7000 -0.755268 8000 -0.231781 18000 -0.012827 $air
imp:n 1 4r 0
PHYS:n 10 0.1 0 1 -1
sdef par=n pos=0 0 0 erg=d1
si1 4.14E-07 1.00E-06 1.00E-05 5.00E-05 1.00E-04 2.00E-04 4.00E-04 7.00E-04 1.00E-03 3.00E-03 6.00E-03 1.00E-02 2.00E-02 4.00E-02 6.00E-02 8.00E-02 1.00E-01 1.50E-01 2.00E-01 2.50E-01 3.00E-01 3.50E-01 4.00E-01 4.50E-01 5.00E-01 5.50E-01 6.00E-01 7.00E-01 8.00E-01 9.00E-01 1.00 1.20 1.40 1.60 1.80 2.00 2.30 2.60 3.00 3.50 4.00 4.50 5.00 6.00 7.00 8.00 9.00 1.00E1 1.10E1 1.20E1 1.30E1 1.40E1 1.50E1

sp1 3.10E-1 1.11E-8 1.27E-7 2.76E-77.82E-7 2.21E-6 4.53E-6 5.68E-6 5.51E-5 1.28E-4 2.30E-4 7.74E-4 2.17E-3 2.80E-3 3.29E-3 3.68E-3 1.05E-2 1.21E-2 1.33E-2 1.42E-2 1.49E-2 1.55E-2 1.60E-2 1.63E-2 1.66E-2 1.68E-2 3.38E-2 3.39E-2 3.37E-2 3.33E-2 6.46E-2 6.12E-2 5.73E-2 5.31E-2 4.88E-2 6.55E-2 5.67E-2 6.33E-2 6.21E-2 4.68E-2 3.49E-2 2.58E-2 3.30E-2 1.74E-2 9.01E-3 4.61E-3 2.33E-3 1.17E-3 5.83E-4 2.88E-4 1.42E-4 6.94E-5
f4:n 13
e4 0 100i 15
nps 100000
 
Engineering news on Phys.org
I can't easily check your phys card, it changes a bit version to version. There is a blank line between the si and sp cards, delete that. There is also 2.76E-77.82E-7, which at minimum needs a space, say between the 7's but there may be other issues, where did the numbers in the distribution come from?
 
  • Like
Likes   Reactions: Anisur Rahman and berkeman
Hi Alex,
Thank you for your kind reply. I have taken the si sp data from ISO_8529_1(2001) Report. Here from the Source strength, i have taken the values as source probability. I didn't normalized the whole probability to one. I thought MCNP will do it itself. My MCNP Version is 5, I need to check the PHYS card. I am giving tha data table, from where i took the si sp values.
Screenshot_20250929_151509.webp
 
PF doesn't seem to like big images. I don't have that document but I have an idea what is in it. Histogram approximations of the source distributions. Try this,
Code:
si1 h 4.14E-07 1.00E-06 1.00E-05 5.00E-05 1.00E-04 2.00E-04 4.00E-04 7.00E-04 
     1.00E-03 3.00E-03 6.00E-03 1.00E-02 2.00E-02 4.00E-02 6.00E-02 8.00E-02 
     1.00E-01 1.50E-01 2.00E-01 2.50E-01 3.00E-01 3.50E-01 4.00E-01 4.50E-01 
     5.00E-01 5.50E-01 6.00E-01 7.00E-01 8.00E-01 9.00E-01 1.00 1.20 1.40 1.60
     1.80 2.00 2.30 2.60 3.00 3.50 4.00 4.50 5.00 6.00 7.00 8.00 9.00 1.00E1 
     1.10E1 1.20E1 1.30E1 1.40E1 1.50E1
sp1 d 0 3.10E-1 1.11E-8 1.27E-7 2.76E-7 7.82E-7 2.21E-6 4.53E-6 5.68E-6 5.51E-5 
     1.28E-4 2.30E-4 7.74E-4 2.17E-3 2.80E-3 3.29E-3 3.68E-3 1.05E-2 1.21E-2 
     1.33E-2 1.42E-2 1.49E-2 1.55E-2 1.60E-2 1.63E-2 1.66E-2 1.68E-2 3.38E-2 
     3.39E-2 3.37E-2 3.33E-2 6.46E-2 6.12E-2 5.73E-2 5.31E-2 4.88E-2 6.55E-2 
     5.67E-2 6.33E-2 6.21E-2 4.68E-2 3.49E-2 2.58E-2 3.30E-2 1.74E-2 9.01E-3 
     4.61E-3 2.33E-3 1.17E-3 5.83E-4 2.88E-4 1.42E-4 6.94E-5
Note that version 5 needs lines to be 80 chars or less, so I've split these.
 
  • Like
Likes   Reactions: berkeman
Hi Alex,

Thank you very much for your suggestions. I have modified the code according to your recommendations. The previous error has now been resolved, but a new error has appeared. I am attaching txt format of the code and a screenshot of the fatal error for your reference.

I am unsure where I might be going wrong. I would greatly appreciate your guidance in resolving this issue.

Thank you in advance for your help!

Best regards,
Anis
IMG_20250930_231323.webp
 

Attachments

You have a third blank line in the input file again. The file should have two, one between the cell cards and the surface cards and another between the surface cards and the data cards. That is it. Another blank line I think is interpreted as the end of the problem.

I've fixed a bit of strange formatting. Five spaces for a follow on line.

The program needs the volume for cell 13 and it's failed to calculate it for some reason. You will need to calculate it and then put it as the result in the vol= part of cell 13 specification. I set that to 1 so the code would run, if you don't fix it you will get answers but they will be wrong.

Good luck again!
 

Attachments

Hi Alex,
Hope you are well. The picture is the result of spectrometry from NNS for Cf-252. My target is to get the same result from my MCNP code. But, the result is not same. What should i do? Can you suggest me please?

IMG-20251015-WA0012.webp
 
Last edited by a moderator:
I can't quite understand what the two graphs are. Is one what it is supposed to be and the other what MCNP produces through your tally? They look somewhat similar. Some nice titles explaining what they are would help.

To get the tallied graph looking like the original you will need some basic things.

You should graph your SI/SP to see if you are inputting the spectrum that you expect. Remember that you are giving energy bins and the bins are not the same size. This affects the graph.

You will need enough particles to sample the entire range of energies enough to get a good graph. I'm not sure if this is a problem or not.

You will need to have similar energy bins to the original graph. You could try copying the energy bins from your SI/SP cards. That will mean you change your e4 card.
 

Similar threads

  • · Replies 58 ·
2
Replies
58
Views
5K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
4K
Replies
6
Views
7K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K