ComputationalRadiationPhysics / picongpu

Performance-Portable Particle-in-Cell Simulations for the Exascale Era :sparkles:
https://picongpu.readthedocs.io
Other
705 stars 218 forks source link

Energy Particles plugin: NaNs for photons #2568

Open n01r opened 6 years ago

n01r commented 6 years ago

If the Energy Particles plugin is activated for photons, one gets nan values after some point.

I have just noticed this but haven't figured out exactly why, yet.

Here some example output of <sim>/simOutput/ph_energy_all.dat. From a 3D sim:

19100 6.842066621241910e-10 6.842066621241910e-10
19200 9.254669290576025e-10 9.254669290576025e-10
19300 1.086544615558932e-09 1.086544615558932e-09
19400 1.331550927268848e-09 1.331550927268848e-09
19500 nan nan
19600 nan nan
19700 nan nan
19800 nan nan

From a 2D sim:

34200 5.834918226123808e-17 5.834918226123808e-17
34300 1.016388305050472e-16 1.016388305050472e-16
34400 1.161795768861727e-16 1.161795768861727e-16
34500 1.235043324595790e-16 1.235043324595790e-16
34600 1.580212274514588e-16 1.580212274514588e-16
34700 nan nan
34800 nan nan
34900 nan nan
35000 nan nan

My production branch is based on commit 2b7bd80eee09d7f6d352d562e1626571879abe71.

ax3l commented 6 years ago

Can you please copy the photon definition in you speciesDefinition.param here?

n01r commented 6 years ago
/*--------------------------- photons ----------------------------------------*/

value_identifier( float_X, MassRatioPhotons, 0.0 );
value_identifier( float_X, ChargeRatioPhotons, 0.0 );

using ParticleFlagsPhotons = bmpl::vector<
    particlePusher< particles::pusher::Photon >,
    shape< UsedParticleShape >,
    interpolation< UsedField2Particle >,
    massRatio< MassRatioPhotons >,
    chargeRatio< ChargeRatioPhotons >,
    exchangeMemCfg< PhotonExchangeMemCfg >
>;

/* define species photons */
using Photons = Particles<
    PMACC_CSTRING( "ph" ),
    ParticleFlagsPhotons,
    DefaultParticleAttributes
>;

The massRatio is given because I remember we once had an offline discussion about that we do not want to assume zero mass when it's not given but we want to explicitly treat zero-mass particles separately.

ax3l commented 6 years ago

How are the photons created? Bremsstrahlung or Synchrotronstrahlung? Looks to me like the Energy Particles is already calculating them correctly but something weird happens to them, e.g. some have no momentum or so... One should dump all photons and verify if some of them have weird looking attribute values (momentum, specifically).

n01r commented 6 years ago

They're created from Bremsstrahlung.

I have photon dumps in my particle dumps as well, so I can have a look at their attributes.