Re: [fluka-discuss]: problem with Source Geometry

From: Andrea Fontana <andrea.fontana_at_pv.infn.it>
Date: Tue, 24 Sep 2019 12:09:23 +0200

Dear Razieh,
    I am happy that the first step (geometry definition) worked.

For the second step, I will try to better explain what I am doing:
the idea is to generate a random point in 3D uniformly distributed
within a cartesian box that contains your cylinder and to check
if the point is inside or outside the cylinder. If it is inside,
the point is considered as a valid source, otherwise another point
is generated until it is inside.

The variables X1,Y1,Z1,X2,Y2,Z2 define the cartesian box interval:
I have chosen a volume bigger than your cylinder, but we can do it
precisely by indicating the exact minimum dimension that contains
the cylinder (X and Y: -0.5,0.5 and Z: -0.5,1.5).
The variables RGEN,ZGEN are the positions generated uniformly
within this box (actually I have discarded XGEN and YGEN that
were left from a first trial and not used): since you have a
cylinder I generate a radius and deduce X and Y with trigonometry.

Now start the tricky part: as you see, the spherical endcaps are
not in the routine, but only in the .inp file. But we have defined
the FLUKA regions and your tube is region 3. Therefore I use the
subroutine GEOREG to return for each generated point X,Y,Z the
region to which it belongs: if the returned value is 3, I am within
the tube, I assign the values to the FLUKA inner variable
XFLK(NPFLKA)... and I continue. If the point is outside, I return
to line 111 and generate another point until it falls within
the cylinder.

I send you a cleaner version of the routine, in which I have
removed the unused variable and also a screenshot of the result,
obtained by scoring USRBIN on BEAMPART.

Hopefully, this explanation helps...
Kind regards,
Andrea


Il 24/09/2019 11:35, r_rajabi ha scritto:
> Hi dear Andrea
> Thank you very much for your advice. I do first step and it works fine. But i am a
> beginner to use source routine. You used a spherical and cylindrical coordinate. Where
> is the exact location of the two semi- spherical in routine? It is in the part
> Cosines? Why did you consider x1=-2 and x2=2, etc. and you didn’t from -0.5 to 0.5?
> What is a XGEN… ZGEN? Because of the very small size of this simulation, it is
> necessary for me to consider the exact definition of the source. Can you help me.
> thanks in advance
> Best regards
> Razieh
>

-- 
========================================================================
Dr. Andrea Fontana                    tel: +39 0382 987991
Istituto Nazionale                    fax: +39 0382 423241
di Fisica Nucleare
Sezione di Pavia                      e-mail: andrea.fontana_at_pv.infn.it
Via Bassi 6                           web   : www.pv.infn.it/~fontana
27100 PAVIA, Italy
========================================================================




__________________________________________________________________________
You can manage unsubscription from this mailing list at https://www.fluka.org/fluka.php?id=acc_info

cylsou_21_plot.png
(image/png attachment: cylsou_21_plot.png)

Received on Tue Sep 24 2019 - 13:08:29 CEST

This archive was generated by hypermail 2.3.0 : Tue Sep 24 2019 - 13:08:31 CEST