How Can I Simulate a Narrow Spectrum X-Ray Beam Using MCNP?

  • Thread starter Thread starter Anisur Rahman
  • Start date Start date
  • Tags Tags
    Spectrum X-ray
Click For Summary

Discussion Overview

The discussion revolves around simulating a narrow spectrum X-ray beam using the MCNP code. Participants are addressing issues related to input specifications, output results, and potential errors in the simulation setup.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant expresses difficulty in simulating the X-ray beam due to a lack of specifications from their supervisor.
  • Another participant shares that running the simulation at 1/100th the nps in MCNP5 produced a spectrum, suggesting that the electron voltage should be set at the RMS of the supply voltage to limit the spectrum.
  • A participant points out that the "sdef par=2" setting emits photons instead of electrons, recommending a change to "par=3".
  • Another participant notes that the output file appears incomplete and suggests that the simulation might not be running properly or is crashing.
  • One participant describes modifications made to the input file, including changes to the "sdef" and the creation of an electron beam on the tungsten target, and discusses the results of their transport calculations.
  • A participant mentions that the electron emitted does not collide with the tungsten target and seeks further assistance.
  • Another participant identifies a fatal error related to the number of entries not matching the number of cells, indicating a mismatch in the importance assignments in the input file.
  • One participant reports correcting the fatal error but still not recording any photons, sharing their updated input and output files.
  • A participant advises that the void cell should have zero importance for all particles to resolve the issue.

Areas of Agreement / Disagreement

Participants are engaged in a technical discussion with various suggestions and corrections being made. There is no consensus on the solution to the simulation issues, and multiple competing views and approaches are present.

Contextual Notes

Participants mention specific settings and configurations in the MCNP code, including the importance assignments and the geometry of the simulation, which may affect the results. There are unresolved issues regarding the simulation's output and potential errors in the input files.

Anisur Rahman
Messages
15
Reaction score
1
Screenshot 2023-11-01 232436.png
I don't know where is the problem. My supervisor couldn't provide me the actual specification of my X-ray tube. I was asked to simulate the X-ray narrow spectrum beam. I run that code, but it produces nothing. Can anyone help me?
 

Attachments

Engineering news on Phys.org
I ran that at 1/100th the nps in MCNP5 and it produces a spectrum for me. The electron voltage might be set at the RMS of the supply voltage of the tube. That would limit the spectrum a bit, it's not fully correct.

Also of note "e0 0.001 100i 0.328" is a linear interpolation and an electron at 47.9keV can't produce an X ray photon above 47.9keV so most of the spectrum must be blank under these conditions.

If you still think you are getting nothing add your output file to a post.
 
Here is my output.
 

Attachments

in your file "sdef par=2" emits photons not electrons. You must write par=3
 
  • Wow
Likes   Reactions: Alex A
Oh wow, good catch @PSRB191921!

@Anisur Rahman, the output file looks otherwise fine but incomplete. Like the program has been told not to run the problem, or it's crashing or it's being killed. 3e6 on one core of my old laptop took 15mins, 3e8 would have taken a full day, what do you see and do when you run it?
 
  • Like
Likes   Reactions: Anisur Rahman
I make some modifications (see my input and output).
first I modified sdef :
"sdef POS= 5 0 0 PAR=3 ext=0 ERG= 0.06 AXS= -1 0 0 vec -1 0 0 DIR= 1 RAD=d1"
I put "par=3" to emit electrons and not photons
I create an electrons beam on the W target (POS= 5 0 0 ext=0 AXS= -1 0 0 vec -1 0 0 DIR= 1 RAD=d1)
It gives :
source.gif

I transport electrons only in cell 100 and 107 (imp:e 1 0 0 0 0 0 1 0 0), because there is no point in transporting electrons outside of these areas except to increase the calculation time!

I put a F5 tally at 3 cm (in front of the aluminum filter) and F15 at 10 cm (behind the aluminum filter) note that F4 and F1 did not converge with few particles

it gives this results :
reults.gif


hope it's help
 

Attachments

  • Informative
Likes   Reactions: Alex A
Hi @Alex A and @PSRB191921. I am sorry, i uploaded the incomplete output file. In the mean time, i have changed the geometry. I have changed the par and tally too. But when the electron is emitted, it doesn't collide with the tungsten target. I am not sure why this is happening. Can you help me please? I am uploading the input and the output file here.
 

Attachments

You have a fatal error,
" fatal error. 9 entries not equal to number of cells = 10."
This seems to apply to,
Code:
imp:e   1 0 1r 1 0 4r          $ 100, 109
This is the same as,
Code:
imp:e   1 0 0 1 0 0 0 0 0          $ 100, 109
So you've assigned 9 importances when you need 10.
 
I have corrected this fatal error, but still no photon is being recorded. i am attaching the input and output file.
 

Attachments

  • #10
Your void cell is 107, this cell needs to have 0 importance for all (both in this case) particles.
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
3K
Replies
8
Views
3K
  • · Replies 4 ·
Replies
4
Views
754
  • · Replies 14 ·
Replies
14
Views
6K
Replies
1
Views
3K
  • · Replies 19 ·
Replies
19
Views
4K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K