- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]

From: Luigi Salvatore Esposito <luigi.salvatore.esposito_at_cern.ch>

Date: Tue, 18 Aug 2015 08:02:15 +0000

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 - 11:25:16 CEST

Date: Tue, 18 Aug 2015 08:02:15 +0000

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 - 11:25:16 CEST

*
This archive was generated by hypermail 2.3.0
: Tue Aug 18 2015 - 11:25:17 CEST
*