Voxel like volumetric source

Hello FLUKA experts,

I am trying to set up a volumetric source of an arbitrary geometry given by an external file. Therefore I create a voxel geometry but I would like every voxel to be a separate source (different weights for every source). For now I set up a second data file to use with source_newgen.f which generates one source in every single voxel.
Is it possible to change this in a way that every single voxel is a volumetric source (and every point inside the voxel can be the source) as it can be defined with the BEAMPOS card and SDUM CART-VOL?

I already read through this thread. Maybe I overlooked something but it did not help me any further than where I am now.

Thanks in advance

Dear Tim,

To my knowledge it is possible to set up different weights for particles coming from different source by using directly the routine source_newgen.f with the appropriate variables.
It is also possible to have a spatial distribution in a voxel directly in the routine as long as you know its position.

Could you forward us your routine/ input file/ source for us to have a closer look?

Best regards,

Hi Jean-Baptiste,

I am using source_newgen.f with a changed “read_phase_space_file” subroutine in source_library.inc. The new routine “read_phase_position_file” was not implemented by myself though and as I am also new to fortran I am not 100% sure why certain things were done/changed (especially that probability/intensity part in the end).

I hope I attached everything necessary.

Best regards,
example.zip (46.9 KB)

Dear Tim,

first, sorry for the delayed reply!

Your question caused a bit of confusion for us, since the voxel geometry (as it is used in FLUKA, see the manual), is not related to the source, and we thought you want to create a source based on one of that.

But, after taking a look at you input files / user routines, it is clear, that you want to create a voxel like distributed source.

The only thing missing from your source routine was to distribute the source location around the center of the “voxel”. This can be done easily in the source routine by:

coordinate_x = phase_position_entry%x1 -0.5D0 + FLRNDM(xdummy)
coordinate_y = phase_position_entry%y1 -0.5D0 + FLRNDM(xdummy)
coordinate_z = phase_position_entry%z1 -0.5D0 + FLRNDM(xdummy)

This change will shift the source location with [-0.5 … 0.5) cm uniformly around the center, along each axes.

The result is in the y = 0 position:


1 Like

Hi David,

thank you for your answer. As easy as it looks… that is what I needed. That solves my problem.

Best Regards