Re: [fluka-discuss]: Magfld file problem

From: paola sala <paola.sala_at_cern.ch>
Date: Thu, 9 Jan 2014 18:24:09 +0100

hello
If I am not wrong, you never define the value of "B0" in your routine,
therefore you cannot use it.

There is a misunderstanding in the meaning of the MLATTC variable. This
variable contains the REPLICA number of the region in which the particle
is. It is different from zero only if the geometry contains LATTICES,
that are cloned repetitions of a given geometry part. The simple
application of a transformation in the geometry DOES NOT qualify the
region as a lattice. so, in your geometry (which is perfectly correct
and well built) , all regions have MLATTC = 0. I should have told you
last time, but you did not use it and I thought the variable was there
for future upgrades of the geometry.
The other point is that the GEON2R call accepts only 3 arguments. It
does NOT return the transformaton number, also because transformations
are applied to bodies.
Unfortunately, you will have to write "by hand" the number of the
transformation in the routine.

For the beam size: you can place a USRBIN scoring particle fluence in a
3D grid ( see the manual and the scoring lecture at the last fluka
course (courses--> prague--> program).
Regards
Paola
On 01/09/2014 09:33 AM, dkizil_at_metu.edu.tr wrote:
> 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 - 19:21:12 CET

This archive was generated by hypermail 2.3.0 : Thu Jan 09 2014 - 19:21:12 CET