Re: [fluka-discuss]: Re: Fluka custom source

From: Mikhail Polkovnikov <pmk_at_ihep.ru>
Date: Tue, 24 Jul 2018 08:30:42 +0300

Dear Thomas,

That, what i have found:

1. The particle momentum must be calculated explicitly from the kinetic
energy value. Do not use PBEAM value!

       TKEFLK (NPFLKA) = ENRGY(LINE)
*  Particle momentum (DONT KNOW ABOUT THIS LINE!!!!!!)
       PMOFLK (NPFLKA) = SQRT ( TKEFLK (NPFLKA) * ( TKEFLK (NPFLKA)
      &                       + TWOTWO * AM (IONID) ) )

2. Error in particle cosines calculation (may be a typo).

       TZFLK (NPFLKA) = SQRT(ONEONE-(UU(LINE)**2+VV(LINE)**2))

3. You didn't save maximum number of lines from your data file, and the
NLINES parameter have been used for sampling instead!
The sampling part must be rewritten.

       IF ( LFIRST ) THEN
          ...........
          ...........
          DO I = 1, NLINES
             READ( 80, *, ERR = 1198, END = 1200) JCOO(I), XCOO(I),
      &         YCOO(I), ZCOO(I), ENRGY(I), UU(I), VV(I), WEIGH(I)
             KOUNT = I
          END DO

  1198    CALL FLABRT( 'SOURCE', 'LINE READING FAILED')
  1200    CONTINUE
          CLOSE(80)
          WRITE( LUNOUT, *) 'MAX LINE COUNT: ', KOUNT
          .............
          .............
       END IF

*  Sample a line from the file
       XI = FLRNDM(DUMMY)
       LINE = INT(XI * DBLE(KOUNT)) + 1


All the changes above are in the attachment file.


Best regards,

Mikhail


On 23.07.2018 16:34, Thomas Grandsaert wrote:
>
> Thank you Mikhail,
>
> You were correct, the normalization of the cosines was causing problems!
>
> I got my MB 1st WS.dat file to perform correctly (see plots), however,
> another data file with a different energy range (MEBT BUNCHER
> STUDY.dat) causes a floating point exception, and this I need help with.
>
> I am sure that the problem is indeed the energy range. For a number
> like 0.231 (Gev), it works fine, 0.231e-3, 0.231e-2, 0.231e-1 will
> throw a floating point exception, and 2.31e-4 or lower *actually
> works*. Any ideas would be very helpful. (I am running latest fluka
> version on flupix)
>
> Thanks again in advance.
>
> Cheers,
>
> T
>
> *From:*Mikhail Polkovnikov <Михаил Полковников> <pmk_at_ihep.ru>
> *Sent:* den 10 juli 2018 16:01
> *To:* Thomas Grandsaert <Thomas.Grandsaert_at_esss.se>;
> fluka-discuss_at_fluka.org
> *Subject:* Re: [fluka-discuss]: Re: Fluka custom source
>
> On 10.07.2018 02:11, Thomas Grandsaert wrote:
>
> I have managed to progress on this problem, despite my limited
> fortran knowledge…
>
> I believe that the routine is now reading my dat file, however the
> the program aborts, and looking at units in the output file show
> very large and confusing position vectors. (E+30)
>
> */0 !!! Exit being called from Flklfx !!!/*
>
> */    **** KLOOP :  203 ****/*
>
> */ Ir=     -1
> Xb=-4.18552924768640E+31-5.50381630413239E+31-6.23871370810403E+31/*
>
> */            Wb= 4.18591057360087E+30 5.50431773361980E+30
> 6.23928209099399E+30 Dist= 1.00000000000000E+01/*
>
> /*Particle discarded because inside no known region.*/
>
> According to my dat file the units are very much different.
>
> */1/*
>
> */0.4520.333/*
>
> */-10.231/*
>
> */1.01.0/*
>
> */1/*
>
> */1/*
>
> */0.2110.168/*
>
> */-10.231/*
>
> */1.01.0/*
>
> */1/*
>
> */1/*
>
> */0.742-0.0918/*
>
> */-10.231/*
>
> */1.01.0/*
>
> */1/*
>
> */1/*
>
> */-0.03760.149/*
>
> */-10.231/*
>
> */1.01.0/*
>
> */1/*
>
> Again, any help on this problem would be appreciated!
>
> Thank you,
>
> T
>
> On 04 Jul 2018, at 21:20, Thomas Grandsaert
> <Thomas.Grandsaert_at_esss.se <mailto:Thomas.Grandsaert_at_esss.se>>
> wrote:
>
> Thank you Joachim,
>
> I was able to follow your steps. The scripts compile and run
> the input file, however the fluka run is aborted with the
> following error:
>
> */1NUMBER OF BEAM   NUMBER OF BEAM        APPROXIMATE NUMBER  
>  AVERAGE TIME USED     TIME LEFT (RESERVED   NUMBER OF STARS/*
>
> */ PARTICLES HANDLED    PARTICLES LEFT        OF BEAM
> PARTICLES     BY A BEAM PARTICLE 10000.0 SECONDS      CREATED/*
>
> */                        THAT CAN STILL BE                  
>         FOR PRINTOUT)/*
>
> */                        HANDLED/*
>
> */ NEXT SEEDS: 0       0       0       0       0 0    3955  
>  3039       0       0/*
>
> I spent some time refining the source.f file, with respect to
> input I found in other threads, but to no avail.
>
> My guess is that my dat file is somehow formatted incorrectly?
> Again the input file compiles and runs on its own.
>
> Thanks in advance for any input!
>
> Cheers,
>
> T
>
> On 04 Jul 2018, at 15:33, Joachim Vollaire
> <joachim.vollaire_at_cern.ch
> <mailto:joachim.vollaire_at_cern.ch>> wrote:
>
> Hi
>
> To use a user routine and create your own executable the
> following commands from a terminal should work (FLAIR is
> an alternative):
>
> $FLUPRO/flutil/fff source.f
>
> Which will create an object file
>
> Create a new executable with a name relevant for you
>
> $FLUPRO/flutil/lfluka -m fluka -o YOURFLUKA source.o
>
> Run FLUKA with the executable you created (the path to the
> data file in your source routine should be coherent with
> the location from where you are running the code)
>
> $FLUPRO/flutil/rfluka –e YOURFLUKA –M1 scint.par.inp
>
> Greetings
>
> Joachim
>
> *From:*owner-fluka-discuss_at_mi.infn.it
> <mailto:owner-fluka-discuss_at_mi.infn.it>
> <owner-fluka-discuss_at_mi.infn.it
> <mailto:owner-fluka-discuss_at_mi.infn.it>>*On Behalf
> Of*Thomas Grandsaert
> *Sent:*04 July 2018 14:36
> *To:*fluka-discuss_at_fluka.org <mailto:fluka-discuss_at_fluka.org>
> *Subject:*[fluka-discuss]: Fluka custom source
>
> Dear fluka experts,
>
> I am attempting to use the following source.f subroutine
> as well as attached particle data file to use as a custom
> source for the attached input file. (I have added a source
> card to the input file)
>
> The command I used:
> $FLUPRO/flutil/rfluka –e source.f –M1 scint.par.inp
>
> When running the input file it compiles and runs, but when
> using the subroutine, the simulation starts then ends very
> quickly, produces no output files, and leading me to
> believe that something is wrong with my source.f subroutine.
>
> If someone could take a look when you have a chance that
> would be very much appreciated.
>
> Cheers,
> T
>
> <customS.inp><particles_new.dat><source.f>
>
> Dear Thomas,
>
> It doesn't work because of cosines normalization! Variables UU and VV
> both have the same value in your input file (1.0). That is invalid in
> case of direction of the particle.
>
> Best regards,
>
> Mikhail
>





__________________________________________________________________________
You can manage unsubscription from this mailing list at https://www.fluka.org/fluka.php?id=acc_info

Received on Tue Jul 24 2018 - 08:58:04 CEST

This archive was generated by hypermail 2.3.0 : Tue Jul 24 2018 - 08:58:05 CEST