Number density calculation #5927
-
|
Greetings! I'm new to WarpX. As far as I understand, there is no direct way to get number density as output. I came up with some ideas: I want to know if these options are adequate. Maybe I'm missing some simpler way. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
You can add custom diagnostics to achieve this.
Then you will have the variables num and ene for each species in your output files. The density is num / cell volume. Similarly, the species energy density is species mass * ene / cell volume. |
Beta Was this translation helpful? Give feedback.
You can add custom diagnostics to achieve this.
diag.particle_fields_to_plot = num enediag.particle_fields.num.do_average = 0diag.particle_fields.ene.do_average = 0diag.particle_fields.num(x,y,z,ux,uy,uz) = "1."diag.particle_fields.ene(x,y,z,ux,uy,uz) = "u2=ux*ux+uy*uy+uz*uz;gamma=sqrt(1.+u2);1./(1.+gamma)*u2*clight*clight"Then you will have the variables num and ene for each species in your output files. The density is num / cell volume. Similarly, the species energy density is species mass * ene / cell volume.