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 Sat Mar 21 2015 - 19:09:41 CET