Re: [fluka-discuss]: Question about three different sources?

From: Leonel Morejon <leonel.morejon_at_eli-beams.eu>
Date: Mon, 6 Jun 2016 10:18:20 +0200

Hi arghyac,

     The way I would do this is sample randomly the direction of the
particle. Then you can use the script as it is, except the directions
will change for every particle sent to the stack. Please, take a careful
look at this lecture
<https://indico.cern.ch/event/489973/contributions/2000440/attachments/1272042/1885396/11_AdvancedSources2016.pdf>
from the latest Fluka Advanced Course.
     Bur for short, every time you generate a particle, you need to
generate two different random numbers $r_1$, $r_2$ and then their
relations to $\theta$ and $\phi$ will be:

     $$\phi = 2 \pi r_1$$

     $$\cos{ \theta} = 2 r_2 - 1$$

then you just assign the directions using on those values:

           TXFLK (NPFLKA) = COS(THETA)*COS(PHI)
           TYFLK (NPFLKA) = COS(THETA)*SIN(PHI)
           TZFLK (NPFLKA) = SIN(THETA)

     The effect now is that particles will be sampled from different
positions (each different source) and will have different directions
every time, but uniform in direction (isotropic).

Cheers,

Leonel

On 6.6.2016 07:14, arghyac_at_barc.gov.in wrote:
> Dear Fluka experts,
> The attached sample source.f file I have seen. Three point sources
> are there directed along X, Y and Z directions. Now suppose all the
> three sources are isotropic and cylindrical. In that case how to
> sample using source.f. Any suggestion will be welcome.
>
> Thanking you in advance.
>
>
>
>
>
> On 2016-06-02 17:37, Leonel Morejon wrote:
>> Dear Zhefu,
>>
>> Yes you need to use source.f routine to simulate this. You have to
>> modify it to sample particles coming from each source, and using the
>> corresponding source's parameters (energy, position, particle type,
>> etc).
>> As for the different intensities, you can simply sample from each
>> source with different frequencies, according to their intensities; for
>> example if source X is twice as intense as source Y then make sure to
>> sample twice from X as many samples you do for Y.
>>
>> Here attached you can find a modified source.f where I set three
>> sources and sample from each of them. It assumes all the sources emit
>> the same particle (defined in the input with the BEAM card) and a
>> monoenergetic beam. But you can easily extend from there to a more
>> general case.
>>
>> Leonel
>>
>> On 2.6.2016 01:44, lzfneu wrote:
>>
>>> Dear all,
>>>
>>> My problem is concerned with three different sources with different
>>> beam intensities hit one same target at the same time.
>>>
>>> Maybe the problem could be solved in source.f file, but I am not
>>> quite sure.
>>>
>>> I have two questions to consult you:
>>> 1)how to define three different beam intensities in source.f file.
>>>
>>> 2)how to define three different sources hit the same target at the
>>> same time.
>>>
>>> Any help will be appreciated and thanks in advance!
>>>
>>> Zhefu
>>
>> --
>> Leonel Morejon
>>
>> -------------------------------------- ELI BEAMLINES
>>
>> Address: \n Za Radnicí 835 25241 Dolní Břežany Czech Republic
>>
>> Office: +420 266 051 406
>>
>> Mobile: +420 773 666 453
>>
>> --------------------------------------
>


__________________________________________________________________________
You can manage unsubscription from this mailing list at https://www.fluka.org/fluka.php?id=acc_info
Received on Mon Jun 06 2016 - 11:55:52 CEST

This archive was generated by hypermail 2.3.0 : Mon Jun 06 2016 - 11:56:00 CEST