Re: [fluka-discuss]: HEMISPHERICAL UNIFORM SOURCE

From: Santana, Mario <msantana_at_slac.stanford.edu>
Date: Fri, 3 Nov 2017 17:59:24 +0000

Hi,

If you wanted uniform generation within a full sphere you would use the BEAMPOS cards with SDUM "SPHE-VOL” (check the manual).

(On the other hand, what you wanted was to produce a uniform and isotropic fluence within a FULL sphere, you would use the SDUM “FLOOD" )

But since you want a semi-sphere, you can’t use built-in sources, and, as pointed by Joachim, you will need to use the source.f routine.

This is a highlight of the steps:
1) include the SOURCE card to tell Ffluka you will be using a source routine
2) Modify source.f to implement the semi-spherical uniform source.

A) simple way, using cartesian coordinates and rejection method

Look for the following lines in source.f

      XFLK (NPFLKA) = XBEAM
      YFLK (NPFLKA) = YBEAM
      ZFLK (NPFLKA) = ZBEAM

Edit this to the following (in this example the radius is 3 cm, and the half-sphere is on positive Z)

 55 radius = 3.0D0
          XFLK (NPFLKA) = ((FLRNDM()*TWOTWO)-ONEONE) * radius
          YFLK (NPFLKA) = ((FLRNDM()*TWOTWO)-ONEONE) * radius
          ZFLK (NPFLKA) = FLRNDM()*radius
          IF (XFLK(NPFLKA)**2+YFLK(NPFLKA)**2+ZFLK(NPFLKA).gt.radius**2)
      $ THEN
            goto 55
          END IF

B) The previous scheme as an efficiency of 52%, you could use spherical coordinates (without rejection), here are some hints:

http://mathworld.wolfram.com/SpherePointPicking.html


3) compile your code, i.e.

$FLUPRO/flutil/lfluka -m fluka -o ./flukahp source.f


Hope this helps,

Mario



On Nov 3, 2017, at 12:43 AM, Joachim Vollaire <Joachim.Vollaire_at_cern.ch<mailto:Joachim.Vollaire_at_cern.ch>> wrote:

Hi
Have a look at the BEAMPOS card, using SDUM = FLOOD you can use the built-in source features to generate primaries from a full sphere.
To select only one half of a sphere the solution would be to write a source routine to sample the position and direction of primaries…
Greetings
Joachim

for SDUM = FLOOD:

the command defines a source distribution on a spherical surface, centred at the x,y,z point defined by another BEAMPOS<http://www.fluka.org/fluka.php?id=man_onl&sub=14> command with SDUM blank or = NEGATIVE, such as to produce a uniform and isotropic fluence within the sphere.
     WHAT(1) > 0.0: radius of the sphere in cm
             = 0.0: ignored
             < 0.0: resets to default
               Default: 1/sqrt(pi) cm

     WHAT(2)-WHAT(6): not used
     Default (option BEAMPOS<http://www.fluka.org/fluka.php?id=man_onl&sub=14> not requested): beam starting at
            point 0., 0., 0. in the z direction)




From: owner-fluka-discuss_at_mi.infn.it<mailto:owner-fluka-discuss_at_mi.infn.it> [mailto:owner-fluka-discuss_at_mi.infn.it] On Behalf Of RIYA DEY
Sent: 03 November 2017 05:04
To: fluka-discuss_at_fluka.org<mailto:fluka-discuss_at_fluka.org>
Subject: [fluka-discuss]: HEMISPHERICAL UNIFORM SOURCE

Dear Fluka Experts ,

                How to make hemispherical uniform source in Fluka Flair ? Is it can be done by making a spherical source and then uniform random sampling from only the upper half half of the sphere ? If so, is there any in-built uniform random sampling code for the sphere in Fluka Flair ?


With regards,
Riya Dey


__________________________________________________________________________
You can manage unsubscription from this mailing list at https://www.fluka.org/fluka.php?id=acc_info
Received on Fri Nov 03 2017 - 20:40:57 CET

This archive was generated by hypermail 2.3.0 : Fri Nov 03 2017 - 20:41:00 CET