Mailing List picongpu-users@hzdr.de Message #199
From: Richard Pausch <r.pausch@hzdr.de>
Subject: Re: [PIConGPU-Users] Tracing particles
Date: Tue, 07 Feb 2017 11:10:56 +0100
To: <picongpu-users@hzdr.de>

Dear Bifeng Lei,

please excuse the late response.

As discussed in the user meeting a couple weeks ago you have two options for calculating the radiation. Either the in-situ radiation plugin or extract the traces and calculate the radiation with a post processing code (e.g. Clara2 on our git repo).

Tracing individual particles and extracting them:
In order to trace individual (macro) particles these particles need unique ids. This can be set by default using the code given in the dev Bunch example:

  1. add an id to the particle attributes: https://github.com/ComputationalRadiationPhysics/picongpu/blob/f6e4f8e007d73453de82756a5d64e5f8cf66b9ac/examples/Bunch/include/simulation_defines/param/speciesDefinition.param#L46
  2. a unique id is set automatically to all particles and this id is available in the hdf5 / adios output from which you can generate your traces with the same periodicity as your dump periodicity of your hdf5 / adios dumps and derive your traces from these output files.

Flagging particles with specific attributes:
In order to mark particles of interest for your radiation calculation, you can use the already build in radiation flag.
https://github.com/ComputationalRadiationPhysics/picongpu/blob/f6e4f8e007d73453de82756a5d64e5f8cf66b9ac/examples/Bunch/include/simulation_defines/param/speciesDefinition.param#L48-L50
Currently only a gamma threshold is available without code modifications. In order to use this, you would activate the RAD_ACTIVATE_GAMMA_FILTER flag and set RadiationGamma
accordingly: https://github.com/ComputationalRadiationPhysics/picongpu/blob/f6e4f8e007d73453de82756a5d64e5f8cf66b9ac/src/picongpu/include/simulation_defines/param/radiationConfig.param#L125-L127
See also the wiki page for this plugin for details:
https://github.com/ComputationalRadiationPhysics/picongpu/wiki/Plugin%3A-Radiation

Flagging particles with pz > 1:
For your specific case however, you need to adjust the code in the radiation plugins pusher extension:
https://github.com/ComputationalRadiationPhysics/picongpu/blob/f6e4f8e007d73453de82756a5d64e5f8cf66b9ac/src/picongpu/include/plugins/radiation/particles/PushExtension.hpp#L46-L60
to filter for a specific momentum component threshold and only then set the radiation flag.
So instead of if (((abs2_mom)>((parameters::RadiationGamma * parameters::RadiationGamma - float_X(1.0)) * mass * mass * c2))) set the flag for if (mom_z > paramerts::MyPzThreshold ) with your own MyPzThreshold in the radiation param file.

Additionally flagging only if |x|<x0:
In order to additionally add a filter for a position, you need to adjust the pusher extension interface to take not only momentum values as arguments but also particle positions (https://github.com/ComputationalRadiationPhysics/picongpu/blob/f6e4f8e007d73453de82756a5d64e5f8cf66b9ac/src/picongpu/include/plugins/radiation/particles/PushExtension.hpp#L37-L43) by adding the particles possitionOffset as argument and adjust the call in the particle kernel accordingly (https://github.com/ComputationalRadiationPhysics/picongpu/blob/f6e4f8e007d73453de82756a5d64e5f8cf66b9ac/src/picongpu/include/particles/Particles.kernel#L294-L303).
Then you have access the each particles position as well and add a second if condition as e.g. if (math::abs2(pos_x) < paramerts:x0 * paramerts:x0) with your own x0 defined in the radiation parameter file.

Calculating the radiation:
This use of the radiation flag allows automatically calculating only those particles with the radiation flag set as true with PIConGPU’s radiation plugin.
However if you prefer extracting the particle trajectories from the hdf5 / adios files you have to:

  1. using only particles with the radiation flag set to true (to select only particles that fulfilled your condition)
  2. identifying each particle (per time step) by its id
  3. combining particle positions, momentum, etc. for each unique id for each time step dumped and generate a trace of each unique particle over all time steps
  4. use these traces for a post processing visualization and/or radiation calculation.

Best,
Richard

Am 06.02.2017 um 17:01 schrieb Bifeng Lei:

Dear all,

I am running a LWFA simulation. My problem is to trace the trajectory of the special particles and then to calculate the radiation.

For example, I would like to trace the self-injected electrons in plasma bubble.   What I usually do this  is in post section for the dumped data as following :

1. specifying conditions for electron species, e.g. pz>1 and  |x|<x0

2. once the condition is satified by an electron, then find the corresponding electron ID

3. continously tracing the electron position by its ID untill the condition is broken.

How could I do this in PIConGPU or setup the ID for each particle? If I want further to calculate the radiation from these electrons, can I directly get the radiation data during the simulation?

All best regards,

Bifeng Lei




Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster