[fluka-discuss]: Question about source.f file

From: lzfneu <lzfneu_at_live.com>
Date: Fri, 13 Dec 2013 07:12:07 +0000

Dear all,
  My problem required a linear source uniformly distributed
along Z between Z1 and Z2, and the particles emitted from the linear source and
incident at an angle of THERTA0 into the cylinder surface whose radius is R0.

My sampling formulas are as
follows:
 
1) sampling
formulars of particle location:
 
     X=R0*cos(2*pi*X1);
     Y=R0*sin(2*pi*X1);
     Z=Z1+X2*(Z2-Z1);
where X1 and X2 are random numbers. R0 is the Cylinder
radius.
 
2) sampling formulars of particle direction:
 
      U=sin(THERTA0)*cos(2*pi*X1);
     
V=sin(THERTA0)*sin(2*pi*X1);
      W=cos(THERTA0);
 where THERTA0 is the particle incident angle. X1 is the
random number.
 
  I rewrite part of the source.f file according to my
sampling formulars and the compilation was passed. Part of my source.f file is
as follows. I also have attatched full source.f file in the attachment. I wonder
whether my source.f file is correct. Thanks in advance.

 
*** User initialization ***
      Z1 =
NINT(WHASOU(1))
      Z2 =
NINT(WHASOU(2))
      R0 =
NINT(WHASOU(3))
      THERTA0 =
NINT(WHASOU(4))/1000
 
* Cosines
(tx,ty,tz)
      X1 =
FLRNDM(DUMMY)
      X2 =
FLRNDM(UGH)
      TXFLK (NPFLKA) = SIN ( THERTA0 ) * COS ( 2 *
3.1415926 * X1 )
      TYFLK (NPFLKA) = SIN ( THERTA0 ) * SIN ( 2 *
3.1415926 * X1 )
      TZFLK (NPFLKA) = COS ( THERTA0
)
 
* Particle
coordinates
      XFLK (NPFLKA) = R0 * COS ( 2 * 3.1415926 * X1 )

      YFLK (NPFLKA) = R0 * SIN ( 2 * 3.1415926 * X1 )

      ZFLK (NPFLKA) = ZBEAM + Z1 + X2 * (Z2 -
Z1)



Received on Fri Dec 13 2013 - 09:23:07 CET

This archive was generated by hypermail 2.3.0 : Fri Dec 13 2013 - 09:23:08 CET