# Multiple cylindrical source as shown in figure

Dear Experts,
Is it possible to model multiple cylindrical sources (as shown in the attached figure) in FLUKA ? How to sample different orientation of the source cylinders in a single source.f ?

Can these cylindrical sources be activated in region-basis option of newgen_source.f as shown below?
call regionsource ( coordinate_x, coordinate_y, coordinate_z, [region number], [xmin], [xmax], [ymin], [ymax], [zmin], [zmax] )
Here how to put the [region number] of these many cylindrical source regions?

Waiting for your suggestions.
Thanking you in advance.

Dear @ArghyaC,

Similarly as it was discussed in Multiple complex source in Fluka, you can use a random number to select between regions.

Please note, the regionsource() subroutine is not part of the distributed version of the source_newgen.f user routine.

Also, since it is using a rejection method, the speed of the sampling is worse, than sampling directly from a cylinder and then roto-translating the coordinates to match the geometry.

Cheers,
David

Thank you for quick reply.

Can I code like below:

random = FLRNDM(XDUMMY)

if (random .lt. beam1_probablility) then
call regionsource ( coordinate_x, coordinate_y, coordinate_z, [region number_1], [xmin], [xmax],[ymin], [ymax], [zmin], [zmax] )
else if (random .lt. beam1_probability + beam2_probability) then
call regionsource ( coordinate_x, coordinate_y, coordinate_z, [region number_2], [xmin], [xmax], [ymin], [ymax], [zmin], [zmax] )
else if (random .lt. beam1_probability + beam2_probability + beam3_probability) then
call regionsource ( coordinate_x, coordinate_y, coordinate_z, [region number_3], [xmin], [xmax], [ymin], [ymax], [zmin], [zmax] )
else
call regionsource ( coordinate_x, coordinate_y, coordinate_z, [region number_4], [xmin], [xmax], [ymin], [ymax], [zmin], [zmax] )
end if

Kindly correct me if the above code is wrong.

Whether you have some example source.f file using roto-translating the coordinates for such application?

Kindly give me some suggestions.

Dear @ArghyaC,

The code looks correct, but you need to optimize the x/y/z min/max values for each regions separately, to increase the success rate of the rejection sampling.

I’m not aware of an example for a roto-translation, but since it is only 2 dimensional matrix and vector operations are needed, it should be hard to program them. (Rotation matrix - Wikipedia)

Cheers,
David

Thank you for your reply and co-operations.

Since it is a cylindrical region, can I use ([Rmin], [Rmax], [Zmin], [Zmax]) instead of ([xmin], [xmax], [ymin], [ymax], [zmin], [zmax] ) for calling region source ?

Dear @ArghyaC,

no, you can’t change the arguments unless you alter the subroutine accordingly.

The x/y/z min/max values set up a bounding box around the desired region. A point is uniformly sampled in this box, and checked if it is inside the region. If not, a new point is sampled. So if you change it to a cylinder, you will encounter the problem of the rotated regions, as they won’t align with the bounding region.

Cheers,
David