ECP-WarpX / WarpX

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

Alternative method of particle initialisation from a file #3948

Open PhysicsDan opened 1 year ago

PhysicsDan commented 1 year ago

Hello, I have a feature suggestion. I have initialised macro particles from an external openPMD file so that I can use the output of a hydrodynamic input as my starting conditions. This method has worked well however requires conversion of particle number density mesh into macroparticles.

An alternative to this could be supplying the number density as an openPMD mesh and then specifying a variable such as total_macro_particle_number to initialise the particles or a second mesh containing the particle per cell number.

This may be a simpler method for users to create custom targets that can't be easily created using an analytical function.

Thanks, Daniel

ax3l commented 1 year ago

Hi Daniel,

Thanks for the suggestion, that would be super useful!

CCing @aeriforme, she suggested this recently, too. X-ref #618 Using openPMD files for the density profile (and maybe also temperature maps) would be ideal.

RemiLehe commented 8 months ago

This would great!

To guide the implementation:

Some features that we would like to have:

Steps:

PhysicsDan commented 8 months ago

Hi Reme,

What would be really nice is if the particle per cell could also be read from an openPMD file.

I would expect that people using this feature would be either for a) preplasma formation or b) some nanostructured foams, where it would be advantageous not to have lots of low weight macroparticles due to a constant 'ppc' setting.

Cheers, Daniel

ax3l commented 3 months ago

Implementation started in #4754. I'll try to spend some time on it next week to push it along for review.