Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fluka parsing geometry figures and zones #162

Merged
merged 32 commits into from
Nov 3, 2023

Conversation

Bogdan2423
Copy link
Contributor

No description provided.

@Bogdan2423 Bogdan2423 linked an issue Oct 18, 2023 that may be closed by this pull request
3 tasks
@Bogdan2423 Bogdan2423 self-assigned this Oct 18, 2023
@Bogdan2423 Bogdan2423 linked an issue Oct 22, 2023 that may be closed by this pull request
3 tasks
@Bogdan2423
Copy link
Contributor Author

I think this is ready for review.
I tested it manually with colimator geometry:
obraz
The result looked like this:
25
Not sure how to evaluate this.
Here is the input file that was generated:
fl_sim.txt
I set aspects other than geometry (beam, scorers) manually, so there may be errors there

@Bogdan2423 Bogdan2423 marked this pull request as ready for review November 2, 2023 11:11
@Bogdan2423 Bogdan2423 requested a review from grzanka November 2, 2023 11:12
@grzanka grzanka added the Fluka Right now as the many-core CPUs are so popular we can switch to parallel compilation. label Nov 2, 2023
Copy link
Contributor

@grzanka grzanka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small comments

converter/common.py Outdated Show resolved Hide resolved
converter/fluka/input.py Outdated Show resolved Hide resolved
@grzanka
Copy link
Contributor

grzanka commented Nov 2, 2023

I think this is ready for review. I tested it manually with colimator geometry: obraz The result looked like this: 25 Not sure how to evaluate this. Here is the input file that was generated: fl_sim.txt I set aspects other than geometry (beam, scorers) manually, so there may be errors there

I really like your test with collimator. Something seems strange in that example. Some of the protons with initial energy of 70 MeV should stop in the collimator material.

Cross-check the BEAM card (https://flukafiles.web.cern.ch/manual/chapters/description_input/description_options/beam.html#beam)

image

We deal with kinetic energy in MeV, not with momentum. Therefore you should write somewhere there -0.07 if you want protons with 70 MeV kinetic energy.

As for energy spread you can put zero.

Bogdan2423 and others added 2 commits November 2, 2023 17:33
Co-authored-by: Leszek Grzanka <[email protected]>
Co-authored-by: Leszek Grzanka <[email protected]>
@Bogdan2423
Copy link
Contributor Author

I think this is ready for review. I tested it manually with colimator geometry: obraz The result looked like this: 25 Not sure how to evaluate this. Here is the input file that was generated: fl_sim.txt I set aspects other than geometry (beam, scorers) manually, so there may be errors there

I really like your test with collimator. Something seems strange in that example. Some of the protons with initial energy of 70 MeV should stop in the collimator material.

Cross-check the BEAM card (https://flukafiles.web.cern.ch/manual/chapters/description_input/description_options/beam.html#beam)

image

We deal with kinetic energy in MeV, not with momentum. Therefore you should write somewhere there -0.07 if you want protons with 70 MeV kinetic energy.

As for energy spread you can put zero.

Changed the BEAM definition to BEAM -0.07 0.0 0.0 3.0 0.0 -1.0 PROTON
Now the result looks like this:
25

@grzanka
Copy link
Contributor

grzanka commented Nov 2, 2023

Looking at your config I see several issues:

  • you place beam at Z = -1.5 cm, in a boundary region. Beam source should be in a region with normal material
  • you have world material filled with water. That is unnecessary. Take a look a documentation in https://yaptide.github.io/docs/geometry/#main-box . There I set the world volume to be made of air.

@Bogdan2423
Copy link
Contributor Author

Looking at your config I see several issues:

* you place beam at Z = -1.5 cm, in a `boundary` region. Beam source should be in a region with normal material

I was following documentation, here it is placed at -1,5cm, is it a mistake or am I misunderstanding something? Anyway I moved the beam to Z= -1.0 cm

* you have `world` material filled with water. That is unnecessary. Take a look a documentation in https://yaptide.github.io/docs/geometry/#main-box . There I set the world volume to be made of air.

I changed the material to air.
After these two changes this is the result:
25
Looks pretty much the same to me

@grzanka
Copy link
Contributor

grzanka commented Nov 2, 2023

Looking at your config I see several issues:

* you place beam at Z = -1.5 cm, in a `boundary` region. Beam source should be in a region with normal material

I was following documentation, here it is placed at -1,5cm, is it a mistake or am I misunderstanding something? Anyway I moved the beam to Z= -1.0 cm

I was more concerned about the fact in which volume the source was, rather than where exactly is located on Z axis.

* you have `world` material filled with water. That is unnecessary. Take a look a documentation in https://yaptide.github.io/docs/geometry/#main-box . There I set the world volume to be made of air.

I changed the material to air. After these two changes this is the result: 25 Looks pretty much the same to me

Then another problem I see

world 5 +figworld -fig0 -fig1 -fig2 -fig3

I should be enough to specify

world 5 +figworld -fig0

Subtracting fig1, fig2 and fig3 which are already contained in fig0 may lead to some strange side effects.

Can you reduce manually number of regions to the same as in SHIELD-HIT12A simulation ?

@Bogdan2423
Copy link
Contributor Author

Looking at your config I see several issues:

* you place beam at Z = -1.5 cm, in a `boundary` region. Beam source should be in a region with normal material

I was following documentation, here it is placed at -1,5cm, is it a mistake or am I misunderstanding something? Anyway I moved the beam to Z= -1.0 cm

I was more concerned about the fact in which volume the source was, rather than where exactly is located on Z axis.

* you have `world` material filled with water. That is unnecessary. Take a look a documentation in https://yaptide.github.io/docs/geometry/#main-box . There I set the world volume to be made of air.

I changed the material to air. After these two changes this is the result: 25 Looks pretty much the same to me

Then another problem I see

world 5 +figworld -fig0 -fig1 -fig2 -fig3

I should be enough to specify

world 5 +figworld -fig0

Subtracting fig1, fig2 and fig3 which are already contained in fig0 may lead to some strange side effects.

Can you reduce manually number of regions to the same as in SHIELD-HIT12A simulation ?

Result after removing the automatically generated "world" region:
25
Input file:
fl_sim.txt
I also tried removing the surrounding black hole region, but after that the simulation crashes with the following error file:
fl_sim001.txt

@grzanka
Copy link
Contributor

grzanka commented Nov 3, 2023

Looking at your config I see several issues:

* you place beam at Z = -1.5 cm, in a `boundary` region. Beam source should be in a region with normal material

I was following documentation, here it is placed at -1,5cm, is it a mistake or am I misunderstanding something? Anyway I moved the beam to Z= -1.0 cm

I was more concerned about the fact in which volume the source was, rather than where exactly is located on Z axis.

* you have `world` material filled with water. That is unnecessary. Take a look a documentation in https://yaptide.github.io/docs/geometry/#main-box . There I set the world volume to be made of air.

I changed the material to air. After these two changes this is the result: 25 Looks pretty much the same to me

Then another problem I see

world 5 +figworld -fig0 -fig1 -fig2 -fig3

I should be enough to specify

world 5 +figworld -fig0

Subtracting fig1, fig2 and fig3 which are already contained in fig0 may lead to some strange side effects.
Can you reduce manually number of regions to the same as in SHIELD-HIT12A simulation ?

Result after removing the automatically generated "world" region: 25 Input file: fl_sim.txt I also tried removing the surrounding black hole region, but after that the simulation crashes with the following error file: fl_sim001.txt

What about the beam source ? Are the proton emitted from a disc with radius 3cm as described here:
https://yaptide.github.io/docs/settings/ ?

@grzanka
Copy link
Contributor

grzanka commented Nov 3, 2023

I was looking at:

*...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
BEAM               07      0.0       0.0       3.0       0.0      -1.0PROTON
* beam source position
*...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
BEAMPOS          0.0       0.0      -1.0

there is something wrong with energy, it should be 0.07, not 07.

Also - check if BEAMPOS is correctly aligned (if using fixed format)

@grzanka
Copy link
Contributor

grzanka commented Nov 3, 2023

Can you add as well scoring along beam axis ?
I would expect a result like that:
image

You can use USRBIN with size -0.5 .. 0.5 x -0.5 ... 0.5 x 0 ...8 and divided into 800 bins along Z. Scored quantity should be DOSE

@Bogdan2423
Copy link
Contributor Author

I think the beam energy was incorrectly aligned. After changing it these are the results for fluence and dose:
25
26
Input file:
fl_sim.txt

@grzanka grzanka merged commit 387c010 into master Nov 3, 2023
9 checks passed
@grzanka grzanka deleted the 150-parsing-of-geometry-figures branch November 3, 2023 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fluka Right now as the many-core CPUs are so popular we can switch to parallel compilation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for regions Parsing of geometry figures
2 participants