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

  • Thread starter Thread starter Anisur Rahman
  • Start date Start date
Anisur Rahman
Messages
14
Reaction score
1
TL;DR Summary
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 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.
 
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

Hello, I'm currently trying to compare theoretical results with an MCNP simulation. I'm using two discrete sets of data, intensity (probability) and linear attenuation coefficient, both functions of energy, to produce an attenuated energy spectrum after x-rays have passed through a thin layer of lead. I've been running through the calculations and I'm getting a higher average attenuated energy (~74 keV) than initial average energy (~33 keV). My guess is I'm doing something wrong somewhere...

Similar threads

Back
Top