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

From: Santana, Mario <msantana_at_slac.stanford.edu>
Date: Fri, 27 Mar 2015 17:57:58 +0000

Hi Andrija,


If I understood well you claimed that no interactions took place at your last magnet (?). I sent a beam to it, and saw that

1) the magnetic field there is present and does bend your beam (figure fluencenormal.png)

2) if I replace the media by something denser (i.e. aluminum) particles interact not only with the fields but also with the media (fluence-pipe135isaluminum.png).

So maybe your problem is that your beam did not reach your magnet (?) check if the optics is set right.


thanks


Mario

On Tue, Mar 24, 2015 at 6:54 PM, andrija matic <matic.andrija_at_gmail.com<mailto:matic.andrija_at_gmail.com>> wrote:
Hi Mario,


I tried with an official FLUKA release and I have the same problem. I manage to locate where is probably the problem but I do not have an idea what is the actual problem and how to solve it.
My the the last lattice in geometry is different than others and beam behave normal till the last lattice and after that it does not interact with a matter or a field

All other magnets are cubic shape and my lattice regions are the same size as the prototype. The critical magnet does not have the perpendicular sides, therefore I created a region which consists from a magnet and vacuum around as a prototype and the same size region for lattice. If I place any target in beam before this magnet I can see beam interaction with the target. I also filled vacuum in a prototype for this magnet with different material and I can observe the interaction. However, at the moment when beam goes out of the lattice I can not see any beam interaction. I suppose that maybe there is a mistake with a particle coordinates or something, but I was not able to recognize where is the mistake.

In the attachment you can find my input file and magnetic field routine. I cut out all quad magnets which I have had in geometry and in fortran function since these do not change any thing.

I commented in the files which magnet is in a question (45) with a word PROBLEMATIC.
Thank you in advance,
Regards,
Andrija

On Mon, Mar 23, 2015 at 7:53 AM, Santana, Mario <msantana_at_slac.stanford.edu<mailto:msantana_at_slac.stanford.edu>> wrote:
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

fluencenormal.png
(image/png attachment: fluencenormal.png)

fluence-pipe135isaluminum.png
(image/png attachment: fluence-pipe135isaluminum.png)

Received on Fri Mar 27 2015 - 20:31:37 CET

This archive was generated by hypermail 2.3.0 : Fri Mar 27 2015 - 20:31:46 CET