Re: [fluka-discuss]: Divergence Sampling

From: Luigi Salvatore Esposito <luigi.salvatore.esposito_at_cern.ch>
Date: Tue, 18 Aug 2015 09:17:30 +0000

Hi Yuri,
I executed your input with WHAT(3) = -1 with your source routine and I got the result in attachment,
that is what one would expect.
I dumped the direction cosine just after they are computed in the source routine.

Your USRBIN scoring does not provide any information on the beam divergence, but only a spatial information.
With 1 mrad FWHM ~ 0.4 mrad, the beam will open by about 0.13 mm over a 30 cm. This implies that you will see
almost all beam particles inside the central bin of your USRBIN scoring, which has a bin width of 0.2 mm.

If you want to check the beam parameters at z = 30 cm, you could intercept the particles at that boundary with the mgdraw routine.

Best regards, luigi

On 18 Aug 2015, at 10:29, Yuri Simeonov <yuri.simeonov_at_gmail.com<mailto:yuri.simeonov_at_gmail.com>> wrote:


Hi Luigi,

thank you for your effort.
The source routine I am going to use for simulating intensity modulated raster scanning from a particle accelarator, this is just the divergence part.

Regards
Yuri

Luigi Salvatore Esposito <luigi.salvatore.esposito_at_cern.ch<mailto:luigi.salvatore.esposito_at_cern.ch>> schrieb am Di., 18.08.2015, 10:22:
Sorry, Yuri, but I was too impulsive in my last email.
The conversion is actually taken in charge by FLUKA itself when it reads the BEAM card.
I need more time to understand what’s wrong.

On 18 Aug 2015, at 10:02, Luigi Salvatore Esposito <luillo_at_cern.ch<mailto:luillo_at_cern.ch>> wrote:

Dear Yuri,
in your code, you should convert the beam divergence from mrad (as it is expected in WHAT(3) of the BEAM card) to radiant.

Btw, I see that your source routine re-implements only the beam divergence, otherwise everything is like the default FLUKA executable.
It is strongly recommended not to use customised user routines especially in case one can use what is already
available in FLUKA. This would be less error prone.

Best regards, luigi

On 17 Aug 2015, at 18:46, Yuri Simeonov <yuri.simeonov_at_gmail.com<mailto:yuri.simeonov_at_gmail.com>> wrote:

Dear Luigi,

thank you very much for your answear!

Divbm is exactly WHAT(3) with a negative sign, Beam is along the positive Z axis.

When I use your code with WHAT(3) = -100 mrad I get almost the same Results (look at FlukaDiv_vs_MyDiv.jpg, 1E7 Particles)

But with WHAT(3) = -1 mrad I get a strange Peak (look at 1mrad.jpg), which i cannot understand.
I plot the lateral Profile at z = 30cm.

I have attached my .inp file, Source file and .flair.

Regards
Yuri




2015-08-15 20:31 GMT+02:00 Luigi Salvatore Esposito <luigi.salvatore.esposito_at_cern.ch<mailto:luigi.salvatore.esposito_at_cern.ch>>:
Yuri,
for your email, it’s not clear how big is the difference between the two cases…

In any case, I assume that Divbm in your piece of code is the value you have set in WHAT(3) (with a negative sign)
when you run FLUKA without a customised source routine.

Then, if the Divbm is small and the beam is along the positive z axis (see note 4 of the BEAM card entry
in the manual), the results should be almost the same.

- If the divergence is not small, the code should be (TXFLK, TYFLK, TZFLX are cosine directions):


TXHLP = TAN( DIV_VECTORX )
TYHLP = TAN( DIV_VECTORY )
THELP = SQRT( TXHLP*TXHLP + TYHLP*TYHLP + ONEONE )
TXFLK (NPFLKA) = TXHLP / THELP
TYFLK (NPFLKA) = TYHLP / THELP
TZFLK (NPFLKA) = SQRT ( ONEONE - LTXFLK (NPFLKA)**2 - TYFLK (NPFLKA)**2 )

In the limit of small Divbm, the two pieces of code should give the same results.

- If the beam is not along the z-axis, than you have also to take into account an additional rotation of TXFLK (Y,Z)
with the matrix BMAXIS contained in the common (BEAMCM).

Best regards, luigi

On 14 Aug 2015, at 17:07, Yuri Simeonov <yuri.simeonov_at_gmail.com<mailto:yuri.simeonov_at_gmail.com>> wrote:

Dear Fluka Experts,

I am using the source.f Routine and trying to sample my own Gaussian angular divergence. But somehow the results I get (1D X Profile) are different from the one I get when I use the original Fluka without Source.f .

I use the following code:

      Divbm_Sigma = Divbm*0.4246609D+00 *Convert from FWHM to sigma

      CALL FLNRR2 (RGAUSSDIVX,RGAUSSDIVY)
      DIV_VECTORX = RGAUSSDIVX*Divbm_Sigma
      DIV_VECTORY = RGAUSSDIVY*Divbm_Sigma

      TXFLK (NPFLKA) = DIV_VECTORX
      TYFLK (NPFLKA) = DIV_VECTORY
      TZFLK (NPFLKA) = SQRT ( ONEONE - TXFLK (NPFLKA)**2
     & - TYFLK (NPFLKA)**2 )

What am I missing?

Regards
Yuri


<FlukaDiv_vs_MyDiv.jpg><1mrad.jpg><Source_Sampling_Sph_400MeV_D0.008_5cm_20MP_Nucl_Edge.flair><Source_Sampling_Sph_400MeV_D0.008_5cm_20MP_Nucl_Edge.inp><SourceFluka.f>






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

Received on Tue Aug 18 2015 - 12:40:58 CEST

This archive was generated by hypermail 2.3.0 : Tue Aug 18 2015 - 12:40:59 CEST