Dear FLUKA experts,
It’s me again. ^^
I now have a mgdraw.f file linked to my myfluka.inp file. However after linking and running my simulation, it seems as if nothing is happening.
Now I am unsure if it is because I am using the mgdraw.f incorrectly, or if something is wrong with the general .inp file. (I have searched in this forum for similar problems and adjusted my code accordingly, yet now I can not find anything)
As a short explanation: I want to simulate a electron beam imping on a tungsten target and write all secondary particles from inelastic interactions (actually only electro-nuclear interactions) into a .dat file.
Currently my .out files show me that there are 0 inelastic and 0 elastic interactions and the output.dat file is not created. Now I do not now know where the error is, as everything compiles without error and runs as well.
I would be thankful for any help!
Kind regards
Laney myfluka.inp (942 Bytes) mgdraw_empty.f (10.3 KB)
There are several errors in your files.
In the input, you activate electro-nuclear (and photo-nuclear) reactions in a not existing material #374 (?), and as a result they are not activated at all (just select TUNGSTEN in the PHOTONUC card).
Your USERDUMP card does not activate the call to USDRAW, since the required WHAT(4) value is missing (that’s why the output.dat file is not created).
The USERWEIG card makes no sense.
In the user routine (where the USDRAW part is anyway not invoked as above), you copy certain variables into others and print the latter, which is useless, since you can directly print the first ones.
You close a mysterious unit 99.
Moreover, you print always (once USERDUMP is corrected), without any filter on electro-nuclear reactions, and without looking at any secondary particle. You should instead apply the conditions ICODE = 101 .AND. JTRACK = 3 (which identify an electro-nuclear reaction) and inspect the content of genstk.inc, namely NP (number of secondaries) and KPART(I) for I=1,NP (identity of secondaries).
Thank you very much for your reply. I have integrated all points from your reply but still no output file is created. Since I get no error message, I do not know where to check. The USERDUMP card I updated to call MGDRAW and USDRAW, at least so I hope.
I will include the updated files: mgdraw_empty.f (10.1 KB) myfluka.inp (867 Bytes)
Your updated files perfectly work (apart from the aesthetic inconsistency of opening/closing a dedicated unit 49 and then writing on the unit 21, which will not get the desired file name).
No output file is created due to insufficient statistics (electro-nuclear processes, which are not biased in your input file, have a rather small cross section).
With your own files, I get 5 printed events out of 100,000 primary electrons.
Hello Francesco,
I have now tried running the simulation with the corrected unit in the open, close and write statements. The complete FLUKA run finishes without error, however the output.dat file is not created. At least not in the folder, where my .inp file and the mgdraw_empty.f are located.
Am I doing something wrong in the execution of the script?
I do the following:
$FLUPRO/bin/fff mgdraw_empty.f
$FLUPRO/bin/lfluka mgdraw_empty.o
$FLUPRO/bin/rfluka myfluka.inp
Now I did try with my own executable:
$FLUPRO/bin/rfluka -e myfluka.exe myfluka.inp, but then it returned an error when running the simulation.
Kind regards,
Laney
As earlier mentioned, the problem was not the unit (that was just an aesthetic inconsistency), rather the insufficient statistics (you should run million events to get electro-nuclear reactions - unless you bias them - and so have the file created).
The command
$FLUPRO/bin/lfluka mgdraw_empty.o
creates an executable called by default fluka, and not myfluka.exe (to do so you need to add
-o myfluka.exe
in the lfluka command).
Which error? (Look at the *001.log/err files in the fluka_# temporary directory).
Also, you could avoid all this manual procedure and use Flair, which in its Compile tab allows you to conveniently compile your user routines and produce a custom executable, which is automatically used for the run.
Thank your for your reply, however I think I can not use Flair. The computer I am working on is very slow and has only limited data space. So I want to run the FLUKA simulation on our cluster. Hence working with only FLUKA and not flair.
Now I have tried to run 1 million events per cycle, but my program gave this error after the first cycle:
Error: “/home/s6laklip/physik/fluka4-4.1/bin/fluka” executable returned RC=2
I think this is because after the first cycle a myfluka001_MGDRAW file was created with 44GB…
However no output.dat file was created. Should I expect the output.dat file after all 5 cycles? Or am I still doing something wrong?
Also this one cycle took over 2h on my PC, which is why I want to use a cluster.
(You can install Flair on your cluster - or ask the cluster administrators to do so -, which does not really pose space issues).
If you created a 44 GB myfluka001_MGDRAW file, you definitely did something wrong. Specifically, this means that you did not run the custom executable including your mgdraw_empty.f routine, but the standard one containing the standard mgdraw, which produces a huge binary output.