# Annular distribution converging at a point with Source_newgen

Dear Fluka community,

I’m playing with the annular distribution already declared at the source_newgen to randomize my source. The initial beam starts from z = 72 km, x=y=0 with an inner radius rmin ~ 0 and rmax = 10 km (Section source_newgen 5.2.3).
Then, I fix the direction cos_x and direction cos_y leaving the cos_z negative (in the input) to randomize the direction downwards.
The next two figures give an idea of the distribution in xy and xz

I was wondering if it is possible to, instead of randomizing the beam direction (second figure), point each primary to a specific position, let’s say x=y=z=0.

Please find attached the necessary files.

source_newgen.f (19.0 KB)
shower.inp (1.4 KB)
usrdraw.f (7.4 KB)

Jordi

Dear @tuneu,
If I have understood correctly your need, it can be directly implemented by defining the beam angles in the source_newgen.f file, which now will be a function of the sample of initial positions.

First, as you mention correctly, you may activate the annular distribution subroutine. Next, you can activate the variables “direction_cosx” and “direction_cosy” such that, for every initial value both beam angles point to the desired direction. I write down the lines I have used in my example, together with the output plots:

``````coordinate_z = -5.0D0
call sample_annular_distribution( 0.0D0 , 1.0D0 , coordinate_x , coordinate_y )
direction_cosx = - coordinate_x / sqrt( (coordinate_x )**2.0D0 + (coordinate_z)**2.0D0 )
direction_cosy = - coordinate_y / sqrt( (coordinate_y )**2.0D0 + (coordinate_z)**2.0D0 )
``````

I hope this helps.
Best regards,

Mario Sacristan Barbero

2 Likes

Dear Mario,