Beams definition

Dear experts,
If I need to divide a cuboid source into different regions based on x, y, z, and use different spectrum files for each region, how should I set it up in the source-newgen.f file?

Dear Yingming Sang,
your task is not standard, and do not have direct solution. I may propose you two approaches to solve the task.

  1. A quite technical way of solving your problem, if you have a limited number of regions, and want to avoid programming.
    First, create one region you need. You can define one spatial source, using CART-VOL type in the BEAMPOS cart. Define geometry of the soure using variables initialized using “define” card.
    Than, normally add source card with relevant source-newgen.f routine with option of the selection of the energy spectrum. You can select option using SOURCE card variable.

Using this approach you can simulate each region you need, changing parameters of each run in the Run card.
Than you can merge results of variuous simulations in one using Data => Process falir tool.

  1. Second is more versatile. You create a spatial source with beampos card as described above. Than you override parameters of the source for each particle using the code: position of the source (BEAMPOS values,coordinate_x = … coordinate_y = … coordinate_z = …) and energy function (e.g. momentum_energy = sample_histogram_momentum_energy( [filename], [unit] )).
    In this case you need to define a distribution between particles. This is descrbed it the previous topic Multiple complex source in Fluka - #2 by horvathd

Hope I wrote it clear and it will useful,
Illia

Dear Illia,

Thank you for your advice, I have solved my problem through the second method.

Best regards,
Sang