MCNP6 simulation about shielding and mobile xray

AI Thread Summary
The discussion revolves around simulating an X-ray tube using MCNP6 software to analyze dose rates in a room. The user is struggling with the data card, particularly the sdef and tally sections, and is confused about converting voltage to energy for the simulation. Experts suggest using a point source for the simulation rather than a full X-ray tube and recommend specific configurations for the sdef and tally definitions. There are ongoing issues with the user's code, including fatal errors and incorrect cell definitions, which need to be resolved for accurate results. The focus is on ensuring proper definitions for cells and tallies to effectively simulate the radiation shielding and dose rates.
gitagituy
Messages
11
Reaction score
1
Homework Statement
help for simulation in data cards
Relevant Equations
mcnp6 simulation
Dear all,

I want to simulate an X-ray tube and check the dose rate in the room.

My problem is in the data card. I don't understand how to write sdef, tally, and others. I simulate 85kV with 25 mAs and the source position is at 0 0 0.

Regards,
anggi
 
Physics news on Phys.org
Welcome to PF.

What class is this for? What have you learned about MCNP software so far? What MCNP examples have you read through?

I suggest you look through our Nuclear Engineering forum to see how others are using MCNP, and then you can post your code here in this schoolwork thread to show us what you have learned.
 
For computation physics in my college. I have studied and understood the cell card and surface card sections. However, in the data card section, I do not understand when converting from volts to electron volts. I tried to read and study through the manual book and my senior's thesis, but in the data card section I still do not really understand.

I share my code through this forum or the suggested forum?
 
gitagituy said:
I share my code through this forum or the suggested forum?
Since this is for schoolwork, we should try to keep this thread here in the schoolwork forums. Yes, please attach your code (you may need to change the suffix to .txt) by using the "Attach files" link below the Edit window. I will page our resident MCNP expert @Alex A to ask for his advice.
 
Hi, 'expert' might be pushing things a bit, but very kind, thank you for that!

There are two ways to solve this kind of problem. One is to use the known output of the tube as the source of X-ray photons. The other is to simulate what is going on inside the tube, which uses a lot more computer time and is done by directing a stream of electrons at the target in the tube.

1 eV is the energy an electron gets from being accelerated with a potential of 1 V, so electrons being emitted by an electron gun with an acceleration potential of 85 kV, will have an energy of 85 keV. The 25 ma current is something you will use after the simulation is done since tally results are per source particle.

If you look at this thread you can see a cross section of a tube (there are some issues with the original input file as discussed in the thread). Electrons come in from the right and the X-rays from the target are filtered and formed into a cone shaped beam by the other structures.

This and this might also be helpful to read.

Post what you have and I can try to give more specific advice.
 
  • Informative
  • Like
Likes hutchphd and berkeman
here is my code
please check it
thank you
 

Attachments

There are two definitions for cell 66, which causes a fatal error. That can be fixed by renumbering.

The cell definitions are pretty good, but many have been defined by negating other cells. This makes it hard to be sure they are correct. Plotting the geometry (mcnp ip inp=filename) reveals a problem with surfaces 24,29 and 30 indicated by the dashed lines.

As a shortcut to understanding cell definitions, a positive surface tends to mean above or outside, and a negative value tends to mean below or inside. The detector spheres should have negative surfaces.

Code:
62  1 -0.001204   -2                                                imp:p=1 $detector
63  1 -0.001204   -3                                                imp:p=1 $detector
64  1 -0.001204   -4                                                imp:p=1 $detector
65  1 -0.001204   -5                                                imp:p=1 $detector
67  1 -0.001204   -6                                                imp:p=1 $detector
66  0 #51 #52 #53 #54 #55 #56 #57 #58 #59 #60 #61 #62 #63 #64 #65 #67 imp:p=0 $environment

The dashed lines go away when this is done. That may not fix everything but it's a bit better.

The sdef is incomplete and there is no x-ray tube in the model. What sort of source do you want?

So a good start, but work still to be done. If there is anything you don't understand, please ask.
 
my lecturer said that there is no need to make an x-ray tube but the source is a point that spreads. I am confused about defining the data card especially in the sdef and tally sections. are the sdef and tally like this code? please check it
 

Attachments

Try "58 6 -1.8 -21 22 -23 24 -27 26 #56 #57 #66 imp:p=1 $con"
You may have the same problem with your other tally cells and that might be why they give zero flux when run. Do you understand why #66 is needed?

You don't need an X-ray tube in the simulation, that is true. The photons emitted by an X-ray tube will not be 85 keV though, it will be complicated in real life.
4c386ba4eed9584fef6f9acbcf27766ed935a97f.png


A single energy may be acceptable for your work but you may need to ask your lecturer what value to use. An isotropic (emitting in all directions) source would also not be normal for an X-ray tube, but again it may be fine for your work.

If you use electrons directed at a target, you know their energy and multiplying the tally by 0.025 * 1 coulomb gives the flux. The simulation needs a lot of computer power though. A photon only source is much faster, but you can't calculate the answer from the current. You will need to know the radiation output of the tube at 25mA to calculate the flux predicted by the program.

If the units produced by the tallies are not useful you may need to change that but they look fine to me.

Edited, isotropic, not isotopic
 
Last edited:
  • #10
means in the cell, am I still wrong?
yes. i understand why #66 is needed

if using single energy what will it be like?
what is the right thing that i should use? because my lecturer said this is easy to do and still very basic to write a data card

actually the purpose of this program is to determine the dose rate before and after passing through the radiation shield, as well as the effectiveness of the material in blocking X-ray radiation. so focus more on the radiation shield.

can you help me in writing the data card? also help me understand how to write it. thank you very much
 
  • #11
With a few assumptions of filtering etc, SpekPy predicts a mean photon energy of 47keV and a flux of 3.2 e 9 [Photons cm^-2] at 1 m. I'm not quite sure what your lecturer wants These numbers may be fine and if they are not they can be changed.

Do you understand how to turn that flux into the activity of an isotropic source?

"sdef erg=0.047 pos=0 0 0"

What units of dose do you need the answer in?
 

Attachments

  • #12
First of all, I apologize, I don't really understand what you mean. I also don't understand how to convert the flux into isotropic source activity. Can I just use sdef erg=0.085 pos= 0 0 0? or how?
my lecturer said, I have to look at other people's theses that also convert kV to MeV. when he found the same case, he used si and sp, while I don't understand how to use it, can you explain? in his thesis he wrote
Code:
sdef dir 1 vec 0 0 -1 x d1 y d2 z -0.0965 sur 2 erg d5 rad d4 par e
sp1 -41 0.15 0
sp2 -41 0.15 0
si4 0.198
si5 L 6.3 6.5
sp5 50 50
phys:e 100 0 0 0 0 -1 1 1 1 0
phys:p 100 0 0 1 0
cut:e 10000 0.512 -0.1 -0.05
cut:p 10000 0.01 -0.2 -0.1
cut:n 10000 0.0 -1.0e-9 -5.0e-10
the equivalent dose I need
 
Last edited by a moderator:
  • #13
gitagituy said:
I have to look at other people's theses that also convert kV to MeV
This is very sensible.

gitagituy said:
par e
This is not an x-ray source, it is an electron source and the energy is too high for this to be an x-ray tube.

gitagituy said:
the equivalent dose I need
So what units, Sv, Gy, R?

gitagituy said:
Can I just use sdef erg=0.085 pos= 0 0 0 [par=p]?
For x-rays from a tube powered at 85kV this would be quite wrong. 0.047 is better but not good. A distribution would be good.
 
Last edited:
  • #14
the units is Sv
so how do i write the energy?
is the tally i use f8 or what?
do you have any recommendations on writing the material for me?
 
  • #15
gitagituy said:
the units is Sv
so how do i write the energy?
is the tally i use f8 or what?
do you have any recommendations on writing the material for me?
Please be aware that we expect students to show their work and best efforts. So far it looks to me like you are trying to cheat in your class by posting your questions here and showing no effort. Are you trying to cheat?
 
  • #16
No, I'm not trying to cheat.
I apologize for looking like I'm trying to cheat. I just want to try to understand this mcnp. That's why I made this question in this forum
I'm just still confused in writing the energy and tally used because my lecturer said that it can't be written directly erg=... but must be defined using si and sp. I don't understand how to write it. If possible, I just ask for an explanation on how to write it. While writing the question here, I also tried to fiddle with the coding that I had made and tried to include recommendations from the answers that had been given. but it still doesn't work
 
Last edited:
  • #17
How long do you have before this needs to be finished?
What version of mcnp are you using? If X/6.1/6.2 putting "DF4" under your F4 tally will convert it to dose using default options and the answer should be in Sv/h per source particle per second. The manuals are unreliable on this topic and it would be good to check the result to be sure.

You should search for an 85kV X-ray SI/SP set.

You should also fix the other detector cells.

If you have problems I can help more.
 
  • #18
I have to finish this before the end of April. I am using version 6.2.
I plan to analyze bremsstrahlung x-rays.
I tried to send the code that I have created. Is there still something wrong and lacking? because I tried it and it still gave a fatal error.
please help. thank you very much
 

Attachments

  • #19
Cells 52 to 55 are used as tally cells, but they are too complicated for the program to work out their volume.

Not sure why you want these as tally cells, but if you still do then calculate their volume and use vol= in the cell definition.

Btw the #66 fix is missing and you haven't fixed the other detector cells.
 
  • #20
Alex A said:
Btw the #66 fix is missing and you haven't fixed the other detector cells.

sorry, I didn't pay attention. is this the code?
6 sz 146.1 7.0
[Spam phrase redacted by the Mentors]
6 sz 106.1 3.0

Alex A said:
Cells 52 to 55 are used as tally cells, but they are too complicated for the program to work out their volume.

Not sure why you want these as tally cells, but if you still do then calculate their volume and use vol= in the cell definition.
I have changed it to
mode p
SDEF POS=0 0 0 ERG=d1 PAR=p
SI1 L 0.001 0.004 0.006 0.008 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.085
SP1 -2 0 0.085
F6:p 62 63 64 65 66
DF6

but it seems like it's still an error. but I don't understand where the error is?
is it my material?
or is the tally section still wrong?
 
Last edited by a moderator:
  • #21
Alex A said:
Try "58 6 -1.8 -21 22 -23 24 -27 26 #56 #57 #66 imp:p=1 $con"
You may have the same problem with your other tally cells and that might be why they give zero flux when run. Do you understand why #66 is needed?
All space must belong to a cell and must not belong to more than one cell. So if you make a cell for a detector that is in the middle of a room, the cell definition for the room must have that part removed.

When I change the tally line to "F6:p 62 63 64 65 66" in revisi7 that gives no fatal errors for me. What error do you get?

I am a little confused by the use of an F6 tally with a DF6 card. Did your lecturer tell you to use them both together?
 
  • #22
Alex A said:
All space must belong to a cell and must not belong to more than one cell. So if you make a cell for a detector that is in the middle of a room, the cell definition for the room must have that part removed.
What do you mean? I do not completely understand
Alex A said:
I am a little confused by the use of an F6 tally with a DF6 card. Did your lecturer tell you to use them both together?
I'm not sure if my professor specifically told me to use both together.
 
  • #23
Say you have a room, and that is a cube shape. You want to add a cell inside that room that is a sphere. You can define the surface of that sphere and say everything inside the sphere is the new cell. You must also remove that volume from the room cell. If you don't do that, the volume inside the sphere will belong to two cells. That is not allowed.

Every point in space must belong to exactly one cell.

If you are using an empty tally cell, I would use an F4 with a DF4.

If you are using a phantom an F6 might make sense but this is complicated.
 
Back
Top