# Re: [fluka-discuss]: Ques on multiple cylindrical source

From: Santana, Mario <msantana_at_slac.stanford.edu>
Date: Sat, 11 Jan 2020 17:52:10 +0000

Hi,

[please use fluka-discuss for all communications so that others can benefit=
]

Your implementation seems right, but you must use double-precision numbers,=
e.g. ZERZER (or 0.0D0) instead of just '0', 20.0D0 instead of 20, etc.

And yes, if you want to use uneven probabilities, you will just accordingly=
apportion more likelihood (pi) to whatever cylinder, making sure that SUM(=
pi) =3D ONEONE if you are comparing to a non-scaled random number.

-M

________________________________
From: Raksha Rajput <rakshak_at_britatom.gov.in>
Sent: Saturday, January 11, 2020 3:48 AM
To: Santana, Mario <msantana_at_slac.stanford.edu>
Subject: Re: [fluka-discuss]: Ques on multiple cylindrical source

Hi,
Thanks for the guidance.
Can you please go through the Particle co-ordinates, as given in the user-r=
outine below, to arrange 9 cylindrical sources in a plane ? It is as follow=
s:

Particle coordinates
RNDNUM =3D FLRNDM(DUMMY)
IF (RNDNUM .LE. 0.11) THEN
XORIG =3D 0
YORIG =3D 0
RMIN =3D 0
RMAX =3D 0.3
ZMIN =3D -20
ZMAX =3D +20
ELSE IF (RNDNUM .GT. 0.11 .AND. RNDNUM .LE. 0.22) THEN
XORIG =3D 1
YORIG =3D 0
RMIN =3D 0
RMAX =3D 0.3
ZMIN =3D -20
ZMAX =3D +20
ELSE IF (RNDNUM .GT. 0.22 .AND. RNDNUM .LE. 0.33) THEN
XORIG =3D 2
YORIG =3D 0
RMIN =3D 0
RMAX =3D 0.3
ZMIN =3D -20
ZMAX =3D +20
ELSE IF (RNDNUM .GT. 0.33 .AND. RNDNUM .LE. 0.44) THEN
XORIG =3D 3
YORIG =3D 0
RMIN =3D 0
RMAX =3D 0.3
ZMIN =3D -20
ZMAX =3D +20
ELSE IF (RNDNUM .GT. 0.44 .AND. RNDNUM .LE. 0.55) THEN
XORIG =3D 4
YORIG =3D 0
RMIN =3D 0
RMAX =3D 0.3
ZMIN =3D -20
ZMAX =3D +20
ELSE IF (RNDNUM .GT. 0.55 .AND. RNDNUM .LE. 0.66) THEN
XORIG =3D 5
YORIG =3D 0
RMIN =3D 0
RMAX =3D 0.3
ZMIN =3D -20
ZMAX =3D +20
ELSE IF (RNDNUM .GT. 0.66 .AND. RNDNUM .LE. 0.77) THEN
XORIG =3D 6
YORIG =3D 0
RMIN =3D 0
RMAX =3D 0.3
ZMIN =3D -20
ZMAX =3D +20
ELSE IF (RNDNUM .GT. 0.77 .AND. RNDNUM .LE. 0.88) THEN
XORIG =3D 7
YORIG =3D 0
RMIN =3D 0
RMAX =3D 0.3
ZMIN =3D -20
ZMAX =3D +20
ELSE
XORIG =3D 8
YORIG =3D 0
RMIN =3D 0
RMAX =3D 0.3
ZMIN =3D -20
ZMAX =3D +20

ENDIF
R=3DSQRT(FLRNDM(DUMMY)) * (RMAX-RMIN) + RMIN
THETA =3D FLRNDM(DUMMY) * TWOPIP
x =3D R * cos(THETA) + XORIG
y =3D R * sin(THETA) + YORIG
z =3D ZMIN + (ZMAX - ZMIN) * FLRNDM(DUMMY)
XFLK (NPFLKA) =3Dx
YFLK (NPFLKA) =3Dy
ZFLK (NPFLKA) =3Dz

Now, here I understand that I have given equal weights to all the nine sour=
ces. But how to give different weight, depending on the source strength of =
each source. Say, one source is 8 KCi while another is 10 KCi and so on. Sh=
ould I make it as: 8 kCi divided by total source strength of all nine penci=
ls ?
In total my sum of weights should be 1.

Is this the right way to give energy:
Kinetic energy of the particle (GeV)
E =3D FLRNDM()
IF (E .LE. 0.5D0) THEN
ENERGY =3D 1.33D-03
ELSE
ENERGY =3D 1.17D-03
ENDIF

* TKEFLK (NPFLKA) =3D SQRT ( PBEAM**2 + AM (IONID)**2 ) - AM =
(IONID)
TKEFLK (NPFLKA) =3D ENERGY

* Particle momentum
* PMOFLK (NPFLKA) =3D PBEAM
PMOFLK (NPFLKA) =3D SQRT ( TKEFLK (NPFLKA) * ( TKEFLK (NPFLKA=
)
& + TWOTWO * AM (IONID) ) )

* Cosines (tx,ty,tz)

Regards
Raksha

----- Original Message -----
From: msantana_at_slac.stanford.edu
To: "Raksha Rajput" <rakshak_at_britatom.gov.in>
Cc: fluka-discuss_at_fluka.org
Sent: Friday, January 10, 2020 10:49:01 PM
Subject: Re: [fluka-discuss]: Ques on multiple cylindrical source

Hi,

As of now you cannot define two pre-built distributed sources in a single
input file. Thus, the remaining alternatives are:
1) Run simulations with each of the sources (using the BEAMPOS cards), and
combine the results according to the weight of the sources, or
2) write a user subroutine (source.f) that handles the definition of each
of the volumetric sources as well as the relative strength of each.

Probably option 1 is going to be easier and also allows for recalculation
of results as a function of the relative strengths, as long as you keep
the individual output results.

Regarding c user routines, Paola announced that those are being prepared
and will be made available shortly.

-M

> On Jan 10, 2020, at 12:52 AM, Raksha Rajput <rakshak_at_britatom.gov.in>
wrote:
>
>
> Dear experts,
>
>
>
> I have successfully used FLUKA, as a beginner, for calculating dose rate
> at 100 cm from a cylindrical source (radius: 0.3 cm and height =3D 40 cm)=
,
> with energy deposition, using two BEAMPOS cards.
>
>
>
>
> Now, as a next step: I would like to calculate dose rate using two
> cylindrical sources (say, Co-60), placed at a distance apart, say 1 cm.
> How should I do this with BEAMPOS cards? How can I do this when the
> strength of two cylindrical sources are unequal? Can I give weight to the
> BEAMS so that contribution of each source is considered? Kindly suggest.
>
>
>
>
> Secondly, any sample user routine, written in c, is available for
> reference ? Kindly share.
>
>
>
>
>
> Regards
>
> Raksha.
>
>
>
>
> _________________________________________________________________________=
_
> You can manage unsubscription from this mailing list at
https://www.fluka.org/fluka.php?id=3Dacc_info
>

__________________________________________________________________________
You can manage unsubscription from this mailing list at https://www.fluka.o=
rg/fluka.php?id=3Dacc_info

__________________________________________________________________________
You can manage unsubscription from this mailing list at https://www.fluka.org/fluka.php?id=acc_info
Received on Sun Jan 12 2020 - 11:10:35 CET

This archive was generated by hypermail 2.3.0 : Sun Jan 12 2020 - 11:10:43 CET