# RE: special beams in FLUKA

From: Markus Brugger <Markus.Brugger_at_cern.ch>
Date: Mon, 24 Nov 2008 14:02:06 +0100

Hi Juan,
sampling different values for beam divergence (e.g., xz, yz) requires
the use of an external source-routine, as the current set of cards BEAM,
BEAMPOS, BEAMAXES allows you to set the following:
- a transversal profile and a divergence (including a 2pi divergence,
i.e. an isotropic source) is available by a simple command (BEAM)=20
- in addition there is the option, which allows to
define a "beam reference frame" different from the normal coordinate
system
used in the problem geometry. This 'frame' is defined through the
command BEAMAXES, the user can define profile/divergence/polarization
in the frame of the beam, which is relatively easy, and the program
will do
the transformation to the normal reference frame
- it is possible to define any transversal profile,
a divergence or a polarization by means of a source routine. But it
is
the user's responsibility to code a sampling scheme for this purpose.
The values of variables such as DIVBM, XSPOT, YSPOT, UBMPOL, VBMPOL,
WBMPOL,
defined by commands BEAM and POLARIZA, are available in subroutine
SOURCE

In your case you need to directly sample the angular distribution of the
particle source by using something similar to:

define XDIVBM, YDIVBM + possible width (Gaussian or rectangular: XFWHM,
YFWHM) and then sample your beam direction accordingly -> the following
is NOT a full implementation and only intended as a hint, please check
carefully and add the missing parts):

e.g., for a rectangular-like distribution
-> the problem here is to properly sample the Cosines, depending on the
angle (e.g., if also big) you have to introduce appropriate cuts!

COSDIV =3D COS ( HLFHLF * XDIVBM )
THETAX =3D ACOS ( ( ONEONE - COSDIV ) * FLRNDM (COSDIV) + =
COSDIV
)
... and similar for Y

or a Gaussian like situation:

123 CONTINUE
CALL FLNRRN (DUM)
THETAX =3D XDIVBM * DUM / XFWHM
IF ( ABS (THETAX) .GT. PIPIPI ) THEN
ISGTHE =3D NINT ( SIGN ( ONEONE, THETAX ) )
THETAX =3D ABS (THETAX)
MOD2PI =3D INT ( ONEMNS * ( THETAX - PIPIPI ) / TWOPIP ) + 1
THETAX =3D ISGTHE * ( THETAX - MOD2PI * TWOPIP )
END IF
... and similar for Y

and then set the cosines accordingly:

* Cosines (tx,ty,tz)
TXFLK (NPFLKA) =3D ...
TYFLK (NPFLKA) =3D ...
TZFLK (NPFLKA) =3D SQRT ( ONEONE - TXFLK (NPFLKA)**2 - TYFLK =
(NPFLKA)**2
)

don't forget protecting against possibly unphysical situations
(consequence of projected angles, etc...)

e.g. THETAX and THETAY have to be in the same half-plane,
IF ( ABS (THETAX) .GT. PIHALF .NEQV.
& ABS (THETAY) .GT. PIHALF ) GO TO 123
* (123 see above!)

or angles (ANGLGB set to 'zero' according to machine accuracy ->
available in DBLPRC)

IF (ABS (THETAX).LT. ANGLGB ) THEN
...
IF (ABS (THETAY).LT. ANGLGB ) THEN
...
IF ( ABS ( ABS (THETAX) - PIHALF ) .LT. ANGLGB ) THEN
...
IF ( ABS ( ABS (THETAY) - PIHALF ) .LT. ANGLGB ) THEN
...

hope this helps, cheers

Markus

> -----Original Message-----
> From: owner-fluka-discuss_at_mi.infn.it [mailto:owner-fluka-
> discuss_at_mi.infn.it] On Behalf Of Juan Blanco Sancho
> Sent: Freitag, 21. November 2008 14:36
> To: fluka-discuss_at_fluka.org
> Subject: divergence + convergence
>=20
> Hi all,
> I wonder how can I set a beam that converges with the BEAM card or
with
> the source.f+DIVBM.
> I also want to set a different value of divergence for xz and yz
> planes.
>=20
> Cheers,
> Juan.
>=20
Received on Mon Nov 24 2008 - 22:59:29 CET

This archive was generated by hypermail 2.2.0 : Mon Nov 24 2008 - 22:59:29 CET