picongpu icon indicating copy to clipboard operation
picongpu copied to clipboard

A comparison of the field energy evolution between the `master` and the current `dev` show massive differences

Open PrometheusPi opened this issue 2 years ago • 18 comments

A comparison of the field energy evolution between the master and the current dev show massive differences

grafik

Thus something changed the evolution of the KHI between our last 0.6.0 release and today's dev.

Originally posted by @PrometheusPi in https://github.com/ComputationalRadiationPhysics/picongpu/issues/4402#issuecomment-1362907768

PrometheusPi avatar Dec 22 '22 14:12 PrometheusPi

Grr this will be a nightmare to search the problem. We did a full rewrite of the field solver.

We need to check if this is produced by the field solver or current deposition.

psychocoderHPC avatar Dec 22 '22 16:12 psychocoderHPC

We should do a git bisect next year to find the origin of the difference and I should test whether the dev or the master is correct.

PrometheusPi avatar Dec 23 '22 11:12 PrometheusPi

Screen shot of the Laser Wakefield electric charge density (scalar field) using the dev branch on 8 December

Screenshot from system reset to 8 December

Screen shot of the Laser Wakefield electric charge density (scalar field) using the dev branch on 31 December and on 1 January

Screenshot of dev branch 1 January 2023

I don't have finer resolution on the particular day the change occurs since I didn't capture screenshots during full system testing between those dates.

I'm very glad to see that you posted this discovery. I had just started to troubleshoot whatever I must have messed up to produce such a completely garbled visualization.

Kim

kimjohn1 avatar Jan 01 '23 22:01 kimjohn1

@kimjohn1 Thanks for the report. Do you use the default settings of the laser wakefield simulation? I am running the latest dev from today and can not see any issues when checking the png files.

./bin/picongpu -d 1 1 1 -s 2000 --periodic 1 0 1 -g 192 1024 192 --e_png.period 10 --e_png.axis yx --e_png.slicePoint 0.5 --e_png.folder pngElectronsYX

e_png_yx_0 5_000980

psychocoderHPC avatar Jan 04 '23 09:01 psychocoderHPC

I checked the KHI where I changed the ions to positrons (shape=TSC current deposition=Esirkepov) by setting the mass ratio to 1.0.

If I compare these to results from 2017 https://github.com/ComputationalRadiationPhysics/picongpu/pull/2275#issuecomment-331383352 I can not see an issue or the tests do not cover the issue:

./bin/picongpu -d 1 1 1 -g 128 512 12 -s 3000 --periodic 1 1 1 --e_png.period 10 --e_png.axis yx --e_png.slicePoint 0.5 --e_png.folder pngElectronsYX --fields_energy.period 10 --e_energy.period 10 --e_energy.filter all --i_energy.period 10 --i_energy.filter all --openPMD.period 250 --openPMD.file simData --openPMD.ext h5

charge conservation step 2500

src/tools/bin/plot_chargeConservation.py simOutput/openPMD/simData_002500.h5 charge_conservation_2500

charge conservation over time

src/tools/bin/plot_chargeConservation_overTime.py simOutput/openPMD/simData_%T.h5 --export charge_conservation.png charge_conservation

heating

src/tools/bin/plotNumericalHeating . --export heating.png heating

psychocoderHPC avatar Jan 04 '23 09:01 psychocoderHPC

OK looks like something is broken, using the test KHI (positrons/electron) and changing the drift to z-direction instead of x-direction is showing different images.

lds_energy.period 10 --e_energy.period 10 --e_energy.filter all --i_energy.period 10 --i_energy.filter all --openPMD.period 250 --openPMD.file simData --openPMD.ext h5

drift in z-direction plane YZ step 10

e_png_yz_0 5_000010

heating

drift in x-direction plane YX step 10

e_png_yx_0 5_000010

The x drift looks correct, from my experience I know if there are clouds in the image after 10 steps something is wrong. The instability in advanced time steps with the z-drift is totally wrong :-(

psychocoderHPC avatar Jan 04 '23 10:01 psychocoderHPC

I was going back with my KHI-z direction test case until 18th Jan 2022 https://github.com/ComputationalRadiationPhysics/picongpu/tree/e48017d498ef9f1645b484ac1678fabc9bf36786 and have everywhere the some issue that changing the drift into z-direction produces wrong results.

psychocoderHPC avatar Jan 04 '23 11:01 psychocoderHPC

@psychocoderHPC I use the Laser Wakefield example simulation, but I use a custom config file that packages and sends output data using openPMD SST to the visualization application. It is pretty interesting to note that the .png images are normal looking. Do you know if the field energy evolution image that you included in the original post uses data supplied by openPMD? Perhaps there is an openPMD issue and not a solver issue at work here. Kim

kimjohn1 avatar Jan 04 '23 13:01 kimjohn1

@psychocoderHPC I believe the openPMD SST implementation uses ADIOS2 to format the data. I should have included that in my last post. Kim

kimjohn1 avatar Jan 04 '23 13:01 kimjohn1

@PrometheusPi and me performed some more checks with the dev branch.

default KHI pos/el drift in X step 600

e_png_yx_0 5_000600

same as default but drift in Z and supercell 4x8x8 cells

e_png_yz_0 5_000600

psychocoderHPC avatar Jan 04 '23 14:01 psychocoderHPC

I switched back to a branch where we still had EsirkepovNative and FieldInterpolatin (no coordinate shift for the field interpolation) native in our code.

git checkout ce7aa8ff91f22777dd56d901f9c01d3395359486

The results are equal to the latest dev results, so I assume that the coordinate shift in the field interpolation is not the root of the evil.

psychocoderHPC avatar Jan 04 '23 14:01 psychocoderHPC

@psychocoderHPC I believe the openPMD SST implementation uses ADIOS2 to format the data. I should have included that in my last post. Kim

Could you please open an issue with you image from https://github.com/ComputationalRadiationPhysics/picongpu/issues/4407#issuecomment-1368556570 It is possible that we break something in the openPMD output and therefore you see wrong densities. IMO your issue is independent of the numerical issue we observe and is an issue in the derived field implementation or an openPMD-plugin issue.

psychocoderHPC avatar Jan 04 '23 14:01 psychocoderHPC

@psychocoderHPC Will do. Kim

kimjohn1 avatar Jan 04 '23 15:01 kimjohn1

@PrometheusPi and me performed some more checks with the dev branch.

default KHI pos/el drift in X step 600

e_png_yx_0 5_000600

same as default but drift in Z and supercell 4x8x8 cells

e_png_yz_0 5_000600

OK the issue is not exiting, the problem was that the example was not fully permutated. I missed to change in png.param that we need to plot b.x() green/blue and not b.z() what we plot in the default example. To fully permutate the example you need to do

  • permutate x and z for the global volume size
  • particle.param
    • set numParticlesPerDimension to 1,5,5
    • permutate DriftParamPositive_direction and DriftParamNegative_direction
  • speciesDefinition.param change ions to poitron, change MassRatioIons to 1.0
  • memory.param change supercell size to 4,8,8
  • png.param change preChannel1 and preChannel2 to b.x()

KHI pos/el step 600 drift into Z-direction e_png_yz_0 5_000600

psychocoderHPC avatar Jan 09 '23 15:01 psychocoderHPC

Thus, only the initial issue remains and might be not significant since measuring the (global) growth showed the same results.

PrometheusPi avatar Jan 19 '23 10:01 PrometheusPi

offline discussed with @PrometheusPi two weeks ago. Maybe we can trigger the start of the KHI differently and not via numerical effects to become a more reliable setup.

psychocoderHPC avatar Jan 19 '23 10:01 psychocoderHPC

@PrometheusPi any new updates?

BrianMarre avatar Feb 28 '23 10:02 BrianMarre

@BrianMarre not yet - the main (global) physics (growth rate of the KHI) was reproduced fine. Only the minor field components deviate (relative to themselves significantly, not significantly to the governing field dynamic)

PrometheusPi avatar Mar 24 '23 10:03 PrometheusPi