How can I model both photons and neutrons with MCNP?

In summary: I'm not sure what the problem is, but it looks like you might need to set up some environment variables.In summary, MCNP reported errors when compiling the code.
  • #1
elua0105
2
0
Hello, I am a student who started studying MCNP. I'm not used to writing in English, so I'd appreciate it if you could understand even if there were grammatical errors in my thread.

I want to check the energy of gamma rays from neutrons reacting with matter. So, I wrote this in the content of the data card.

C data card
mode n p
imp:n 1 1 1 1 1 1 1 1 0
imp:p 1 1 1 1 1 1 1 1 0
F8:p 1
E8 0 98i 11
F5:p 0 0 1 0
Sdef pos 5 5 10 ERG=25 PAR=1
phys:p 100 1 1 -1 0
phys:n 100 0 0 0 0
M1 ~~~
M2 ~~~
...
nps 100000

I've used the code for shooting photons several times, but I'm not sure what the problem is because it's my first time shooting neutron.
Can you tell me where the problem is or if you have any information site to refer to?

Thank you
 
Engineering news on Phys.org
  • #2
Hi,

It's easier to help if you send either the full problem, or a minimal problem that still shows the error.

Also if MCNP is reporting an error, what is the error, or if it's reporting a result incorrectly, what is it reporting and what should it be reporting?
 
  • #3
Alex A said:
Hi,

It's easier to help if you send either the full problem, or a minimal problem that still shows the error.

Also if MCNP is reporting an error, what is the error, or if it's reporting a result incorrectly, what is it reporting and what should it be reporting?
Thanks for your reply.
When I used the code through the mcnpx, the mcnpx didn't work completely and seemed to have errors with some warning phrases. So I implemented it with a visual editor, and the following warning came up.

캡처.JPG
zs.JPG

I guess there was probably a problem setting up phys or imp:n because it's okay to shoot only photons except Neutron. But I don't know exactly where the problem is and how to fix it.

Thank you so much for taking the time to care my question.
 
  • #4
First I think you have a library problem.
For a neutron transport, materials must be write ZZAAA not ZZ000. For example 1001 not 1000 ; 8016 not 8000
 
  • Like
Likes Asmae SAADI and Alex A
  • #5
Some libraries use ZZ000 for natural abundance elements, but that is very patchy. There clearly is a library problem. Some surfaces are the same as other surfaces, so the problem needs attention.

To me the problem file seems to contain a lot of mistakes and probably needs to be fixed line by line.
 
  • Like
Likes PSRB191921
  • #6
Hi,
I'm trying to calculate the number of photons-neutrons produced when an electron beam hits a target, but when compiling the MCNPX code, I find these fatal errors, and actually I don't understand them and how I can solve them:
fatal error. missing gdr.dat file.
fatal error. missing CEM data file(s).
fatal error. more than one particle-type designator
 

Attachments

  • ext.PNG
    ext.PNG
    7.5 KB · Views: 121
  • Qn2.PNG
    Qn2.PNG
    4.9 KB · Views: 148
  • #7
First you cannot write f2:p,n but :
F2:n 23
F12:p 23

Second you have problem with the libraries
For W write
M1 74182 -.3 74183 -.1 74184 -.3 74186 -.3

For pb :
M3 80206 -.24 80207 -.22 80208 -.52

For kapton :
M2 6000 22 7014 2 8016 5
Mx2:p 6012 j j

For your source I think there is a mistake I would have written something like :
Sdef pos=0 0 0 erg=18 par=3 vec = 0 0 -1 dir=1 rad=d1
 
  • Like
  • Informative
Likes rpp and Alex A
  • #8
@Asmae SAADI ,
mcnpx cannot find your data files. Most probably your DATAPATH variable is not set, or not set correctly. Your xsdir file is presumably present, or you would get a different error. I have mine edited so the first line looks like
Code:
DATAPATH=/media/alex/path/to/MCNP_DATA/
(I am in linux)
 
Back
Top