Re: [fluka-discuss]: Magfld file problem

From: <dkizil_at_metu.edu.tr>
Date: Thu, 9 Jan 2014 10:33:48 +0200

Dear Paola,

Thank you very much for your help. I did all what you said and my code is
running. But there is still something that I do not understand.

First of all, I added 1 dipole and 4 quadrupole magnets. In my magfld.f
file there is a line:

"B= B0*SQRT(Xs*Xs+Ys*Ys)/QRAP"

If I runned the code with this line and B0 values, there was a mistake
about beam line. However, I wrote B= B0B*SQRT(Xs*Xs+Ys*Ys)/QRAP isntead of
this and deleted B0 values, everything is fine. I do not understand what
does it mean.

And I want to learn final beam size. Can I learn USRYIELD card by putting
detector?

I attached my input and magfld files.

Thank you very much
Best reagrds,
Dilek

> Dear Dilek
> the magfield routine should returrn the direction and MODULE of the
magnetic field, where the module is a non-negative number. In your
routine, you set B to a negative value, that is ignored by the tracking
routines. You should instead provide a POSITIVE B , and set BTY=-ONEONE
to
> have it directed in the negative y direction.
> Besides this, you used the "transform" directives in the geometry to
place
> and tilt your magnets, but you do not apply any transformation in the
magfld.f routine, thus your calculation of the field will not correspond
to the position in the magnets. The magfld routine and the tracking
routines use the coordinates of the particle in the global geometry ,
while you are calculating the fields as if the magnet axis were on the z
axis, in a non-rotated frame. Both the modulus and the direction of the
field are coming out wrong.
> To do things correctly, you can do, for instance,
> * define local coordinates
> Xs = X
> Ys = Y
> Zs = Z
> * transform them to the system where the magnet is along z-axis
> * applying the inverse of the rotation applied to the magnet
> * (where krotat is the number of the transformation used for this
magnet)
> CALL UNDOTR (1, Xs, Ys, Zs, KROTAT)
> *** ...
> *** here calculate B, Btx, Bty, BtZ using xs,ys,zs
> ** ...
> * now transform the cosines of the field to the global system, using the
*rotation only, not the full roto-translation
> CALL DORTNO ( 1, BTX, BTY, BTZ, KROTAT)
> ( for your information, the full direct transformation is obtained by
calling the DOTRSF routine)
> Another issue: in the comments of the magfld you wite "p=30 MeV" , but
in
> the input you set the kinetic energy equal to 30 MeV , that is not the
same.
> Hope it helps
> Paola
>> Dear Fluka experts,
>> I am a fluka beginner and I have a problem with bend?ng of particles in a
>> magnetic field in my design.
>> I want to bend particles by using dipoles and I want to enlarge the
beam
>> by using quadrupoles. However after the first dipole, the direction of
particles remain same and varying the magnitude of magnetic field in
dipole doesn't have any effect.
>> I attached my input file and magfld.f file.
>> Any suggestions or comments will be appreciated.
>> Thank you very much in advance.
>> Best Regards,
>> Dilek
> Paola Sala
> INFN Milano
> tel. Milano +39-0250317374
> tel. CERN +41-227679148






Received on Thu Jan 09 2014 - 10:34:26 CET

This archive was generated by hypermail 2.3.0 : Thu Jan 09 2014 - 10:34:27 CET