FLUKA comparison with PHITS

Hi Volodymyr

Thank you for your help. I’m modelling a lightly more complex problem now with more complex source and geometry. I’m also getting discrepancy between PHITS and FLUKA and I dont suppose you have any suggestions as to what could be causing the difference?

screenshot13

snre_point_output.out (33.0 KB)
snre_spallation.inp (37.5 KB)
snre_gcr_spherical_source_21_tab.lis (87.8 KB)
snre_gcr_spherical_source_21_sum.lis (149.9 KB)
snre_gcr_spherical_source.flair (20.9 KB)

Best wishes,

Emma

Hi Emma,

First of all, let’s try to optimize your source definition.
In your case, I would suggest you to utilize source_newgen.f routine. Usage is described here:

Examples are from: 2023-fluka-beginner-course

There you can define shape, directions and file-based energy spectra.
I am attaching a modified example from this course.
histogram.txt (239 Bytes)
source_newgen.f (19.2 KB)
source_routine.flair (2.9 KB)
In addition, I included a uniform spherical shell generator into source_library.inc, so you need to replace it in /path/to/fluka/include
source_library.inc (42.5 KB)


image

Let me know if it works for you and then I will continue with further comparison.

Best wishes,
Volodymyr

Hi Volodymyr

I ran the model, and these are the plots I got


which look similar to yours.

Best wishes,

Emma

Hi Emma,

Then you can similarly define this source in your Fluka model.

I have obtained similar results with your geometry input and my sample histogram of protons.

Sample distribution 1-100 GeV protons:
image

Comparison of FLUKA (without PWXS/LOW-MAT cards, they activated by default) and PHITS (default physics in both codes otherwise).
image

One would need to investigate small differences in 1-100 MeV energy region with the PHITS team to understand the cause.

Best wishes,
Volodymyr

Hi Volodymyr

When I have previously used the source_newgen.f I have been able to define a spectrum file using:

momentum_energy = sample_spectrum_momentum_energy( "gcr_spectrum.txt", "MeV" )

since the source I’m using is a spectrum. When I use this in the file you provided, I get an error. Is this no longer an option in the source_newgen.f file?

Thanks,

Emma

Hi Emma,

Could you please share your input file, source_newgen.f and the file with spectra?

Cheers,
Volodymyr

Hi Volodymyr

I managed to compile the executable by adding

double precision sample_spectrum_momentum_energy

to the function declarations in the source_newgen.f file. When I run without any spawns it seems to be working fine, but when I try to run with spawns I’m getting errors. The simulation still carries on but I get ‘Finished with ERRORS’ appearing in the Run tab. I’m not sure if this is an issue, I’m still waiting for the run the finish.

snre_gcr_spherical_source.flair (12.4 KB)
gcr_spectrum.txt (1.9 KB)
spherical_source.f (19.4 KB)

Best wishes,

Emma

Hi Emma,

The source sampling centre has to be shifted in z, otherwise, your particles will start in the undefined geometry causing errors

call sample_spherical_distribution( rmin, rmax, 0D0, 0D0, 65D0, 
     &coordinate_x, coordinate_y, coordinate_z)

Cheers,
Volodymyr

Thank you. I’m still getting discrepancies for the neutron flux. I’m using default options for PHITS as well.

gcr_spectrum.txt (1.6 KB)
spherical_source.f (19.4 KB)
snre_gcr_spherical_source_21_tab.lis (17.9 KB)
snre_gcr_spherical_source_21_sum.lis (31.0 KB)
snre_gcr_spherical_source.flair (16.7 KB)

snre_spallation.inp (37.5 KB)
snre_spallation_output.out (8.3 KB)

Are you able to share the files you used to create the neutron flux plot above?

Thanks,

Emma

Hi Emma,

Sure, here are my files.
FLUKA:
Decay_hist.txt (1.2 KB)
source_newgen_sphere.f (19.1 KB)
sphere_source_forum.flair (13.9 KB)
sphere_source_forum.inp (15.1 KB)
neutrons_21_tab.lis (35.3 KB)

PHITS:
sphere_source.inp (10.4 KB)
sphere_source_neutrons_lethargy.out (14.8 KB)

Cheers,
Volodymyr

Hi Volodymyr,

Thanks for sending the files. I ran your files and got good agreement between FLUKA and PHITS.

The issue I’m having with my models, seems to be with the source. I have the following source flux spectrum (protons):

Energy (MeV) Int proton flux (m^-2 sr^-1 s^-1)
1 76.504
1.1 76.504
1.2 76.504
1.4 76.504
1.6 76.504
1.8 76.504
2 76.504
2.2 76.504
2.5 76.504
2.8 76.504
3.2 76.504
3.5 76.504
4 76.504
4.5 76.504
5 76.504
5.5 76.504
6.3 76.504
7.1 76.504
8 76.504
9 76.504
10 76.504
11 76.504
12 76.504
14 76.504
16 76.504
18 76.504
20 76.504
22 76.504
25 76.504
28 76.504
32 76.504
35 76.504
40 76.504
45 76.504
50 76.504
55 76.504
63 76.504
71 76.504
80 76.504
90 76.504
100 76.504
110 76.504
120 76.504
140 76.504
160 76.504
180 76.504
200 76.504
220 76.504
250 76.504
280 76.504
320 76.504
350 76.504
400 76.504
450 76.504
500 76.504
550 76.504
630 76.504
710 76.504
800 76.504
900 76.504
1000 76.504
1100 76.504
1200 76.504
1400 76.504
1600 76.504
1800 76.504
2000 76.504
2200 76.504
2500 76.504
2800 76.504
3200 76.504
3500 76.504
4000 76.504
4500 76.504
5000 76.504
5500 76.504
6300 76.504
7100 76.504
8000 75.583
9000 72.455
10000 67.942
11000 63.022
12000 58.139
14000 49.4
16000 42.048
18000 35.977
20000 31.044
30000 15.509
40000 8.882
50000 5.477
60000 3.4973
70000 2.239
80000 1.384
90000 0.775
100000 0.3243

I have implemented this in FLUKA using the ‘sample_spectrum_momentum_energy’ function with energy and weight.

sphere_source_forum.flair (15.6 KB)
source_newgen_sphere.f (19.2 KB)
Decay_hist.txt (1.7 KB)

and similarly in PHITS

sphere_source.inp (9.9 KB)

but I’m getting a discrepancy where the results from FLUKA are significantly higher

I even tried inputting the spectrum as a histogram and running with your models but I’m getting similar discrepancies.

source_newgen_sphere.f (19.1 KB)
Decay_hist.txt (2.3 KB)
sphere_source_forum.flair (15.7 KB)
sphere_source.inp (9.6 KB)

I feel like I’m misinterpreting how to use the source flux spectrum correctly.

Best wishes,

Emma

Hi Volodymyr

UPDATE: I came across the ‘sample_discrete_momentum_energy’ in FLUKA and when I use this along with ‘etype=8’ in PHITS, which is also a discrete spectrum, I get very good agreement.

I was wondering if you could explain how continuous and discrete spectrums are used in FLUKA, as I’m not sure I understand correctly and this may explain the cause of the previous issues I was having.
My other concern is why there is a discrepancy when using the histogram. I just changed the histogram energies and bin heights in your FLUKA and PHITS model but I was getting quite big discrepancies (see previous reply).

Best wishes,

Emma

Hi Emma,

I glad that you found the source of the discrepancy!

The difference between discrete and histogram is that for the second one you will sample
particles with energies within bin width and not discrete lines. It’s more realistic for sources with continuous spectra.

In my example, I have used histogram definition for both FLUKA and PHITS.
Please always check that source types, scoring and especially normalization are consistent between both codes. Your Phits histogram definition was shifted by one bin to the right in comparison with Fluka.

Here is an example how it should be defined in Phits:

Here is comparison for your spectra with histogram definition for small statistics .


As you see, it is also in relative agreement with discrete definition.

Best wishes,
Volodymyr

Thank you so much for your help with this!

Best wishes,

Emma

1 Like