Re: [fluka-discuss]: no particle interaction after the last lattice, magnetic fields routine used....

From: Santana, Mario <msantana_at_slac.stanford.edu>
Date: Mon, 23 Mar 2015 06:53:08 +0000

Hi Andrija,

It is hard to diagnose the problem from the information that you give, moreover, you did not attach the figure that you mention nor the input file and full routine.
In any case, just as a test, you should try with the current FLUKA version, as the development distribution from Frascati had some bugs.
Also you could methodically try to isolate the problem by checking e.g. what happens if you remove all the latticed magnets, etc, or what happens if you don't use magfld routine for the magnetic field (it is not really needed in case you deal with just uniform dipole fields).

Mario

From: andrija matic <matic.andrija_at_gmail.com<mailto:matic.andrija_at_gmail.com>>
Date: Saturday, March 21, 2015 9:42 AM
To: fluka-discuss <fluka-discuss_at_fluka.org<mailto:fluka-discuss_at_fluka.org>>
Subject: [fluka-discuss]: no particle interaction after the last lattice, magnetic fields routine used....

Hi Fluka experts,

I am trying to simulate entire beam line with magnetic fields.
At the present time I use Fluka version distributed during advanced Fluka course in Frascati
I am using magfld.f routine based on an example from the same course.
And at the present time I have included magnetic fields only for dipole magnets. The first seven magnets are copies (lattice) and results were very nice. However, the last magnet is created on the place (not lattice). After compiling routine I can see on a plot that a magnetic field is activated also in the last magnet. All of this maybe are completely not related with a main problem:

My proton beam do not interact with magnetic field or any other target on the end.
I place an iron as material instead of vacuum and beam still goes straight without any interaction.
I used USRBIN to score protons in that are and beam goes completely straight:


The core of my magfld.f routine is:

*----------------------------------------------------------------------*
* core
*----------------------------------------------------------------------*

      XNEW = X
      YNEW = Y
      ZNEW = Z
      MLAT = MLATTC
      IF (MLAT .GT. 0 ) THEN
* Ovde radim transformaciju koordinata iz lattice u original
            CALL DOTRSF(1, XNEW, YNEW, ZNEW, LAT_ROT(MLAT))
      ENDIF

      IF (NREG .EQ. NUM_135 ) THEN
* Ovo je 135 degree dipol
            BTX = ZERZER
            BTY = B2G2_F
            BTZ = ZERZER
            WRITE (LUNOUT,*) ' 135 Degree Magnet '
      ELSEIF (LAT_VER(MLAT) .EQ. 2) THEN
            BTX = ZERZER
            BTY = FIELD_VA(MLAT)
            BTZ = ZERZER
      ELSEIF (LAT_VER(MLAT) .EQ. 4) THEN
* WRITE (LUNOUT,*) MLAT
            BTX = FIELD_VA(MLAT) * YNEW/1D+02
            BTY = FIELD_VA(MLAT) * XNEW/1D+02
            BTZ = ZERZER
      ELSE
* ni jedan drugi region nije magnetni
            CALL FLABRT('MAGFLD','NO MAGNETIC FIELD IN THIS REGION !')
      ENDIF

      B = SQRT(BTX**2 + BTY**2 + BTZ**2)

* check against numerical precision
      IF ( B .GT. 1.0D-12 ) THEN
* normalise field components
            BTX = BTX / B
            BTY = BTY / B
            BTZ = BTZ / B
      ELSE
* restore default values
            BTX = ZERZER
            BTY = ZERZER
            BTZ = ONEONE
            B = ZERZER
      ENDIF

      IF (MLAT .GT. 0) THEN
            CALL UNDRTO (1, BTX, BTY, BTZ, LAT_ROT(MLAT))
      ENDIF


      RETURN



I went over output file from the simulation and region connected with 135 Degree magnet is recognized in the first pass through magfld.f routine, but it is newer used later on core of the routine.

 In the attachment a plot you can see proton beam and part of geometry....


Thank you in advance Andrija


__________________________________________________________________________
You can manage unsubscription from this mailing list at https://www.fluka.org/fluka.php?id=acc_info
Received on Mon Mar 23 2015 - 09:27:01 CET

This archive was generated by hypermail 2.3.0 : Mon Mar 23 2015 - 09:27:05 CET