ECP-WarpX / WarpX

WarpX is an advanced electromagnetic & electrostatic Particle-In-Cell code.
https://ecp-warpx.github.io
Other
292 stars 188 forks source link

PFT seems to increase laser energy #3045

Open bzdjordje opened 2 years ago

bzdjordje commented 2 years ago

Modifying just the PFT beta with a sweep of values -0.4e-15, -0.2e-15, 0, 0.2e-15, 0.4e-15 seems to increase the laser energy away from the baseline Gaussian mode, while I believe it should remain constant. The field energy corresponds to the maximum field energy in the simulation box using reduced diagnostics. @MaxThevenet @RemiLehe

pft_h_p04_v_3400 pft_h_p02_v_3400 gau_h_v_3400 pft_h_m02_v_3400 pft_h_m04_v_3400

input_pft.txt

ax3l commented 2 years ago

Thanks! Is this only a problem in 2D (but conserved in 3D)?

bzdjordje commented 2 years ago

I have only tried this in 2D since it's for an ion acceleration application, but I can check in 3D as well.

RemiLehe commented 2 years ago

Thanks for reporting this @bzdjordje Could you also post the script that you used in order to compute the energy? Also: in which units is the energy that you quote on the plots?

Note that the formulas are defined here In principle, this should always have the same energy (as beta changes - at least in 3D), but this formula does make a number of approximation, including the paraxial approximation, and it assumes that the longitudinal field (Ez) is negligible in the total energy.

RemiLehe commented 2 years ago

Well, actually, I had a look at the code, and it looks like my comment above is incorrect: the current code does not preserve the energy. @bzdjordje Would you be able to try the code here: https://github.com/ECP-WarpX/WarpX/pull/3054 and to recompile and rerun your test?