Open 1661145410 opened 7 months ago
Hi @1661145410, thanks for reaching out!
We can in WarpX, e.g., we feed in neutral plasma in moving window simulations, or from surfaces, or via Python, inject new particles at any time. But I think we need to understand your scenario a bit better to guide you:
Hi @ax3l ,
Thank you for your prompt response and guidance. I appreciate your willingness to help with our simulation scenario.
Regarding our simulation, we are indeed using two crossing laser beams interacting with a plasma, where the wakefields play a significant role. Specifically, the electron beam in our simulation is incident forty optical cycles later than the lasers.
Here are part parameters for the plasma and lasers in our setup:
geometry.dims = 2 # simulation dimention geometry.prob_lo = -20.e-6 -45.e-6 # physical domain,lower corner geometry.prob_hi = 20.e-6 115.e-6 # upper corner
################################# ############ PLASMA ############# ################################# my_constants.dens = 1.21e27 # particles.species_names = plasma_e plasma_p beam #
plasma_e.species_type = electron # plasma_e.injection_style = "NUniformPerCell" # plasma_e.num_particles_per_cell_each_dim = 16 1 16 # plasma_e.xmin = -20.e-6 # plasma_e.xmax = 20.e-6 # plasma_e.zmin = 10.e-6 # plasma_e.profile = constant # plasma_e.density = 0.8*dens # number of electrons per m^3 plasma_e.momentum_distribution_type = "at_rest" # plasma_e.do_continuous_injection = 1 #
plasma_p.species_type = proton # plasma_p.injection_style = "NUniformPerCell" # plasma_p.num_particles_per_cell_each_dim = 16 1 16 # plasma_p.xmin = -20.e-6 # plasma_p.xmax = 20.e-6 # plasma_p.zmin = 10.e-6 # plasma_p.profile = constant # plasma_p.density = 0.8*dens # number of electrons per m^3 plasma_p.momentum_distribution_type = "at_rest" # plasma_p.do_continuous_injection = 1 #
beam.species_type = electron # beam.injection_style = "gaussian_beam" #
beam.x_rms = 0.2e-6 # standard deviation in x/y/z beam.y_rms = 1.e-6 # beam.z_rms = 5.e-6 # beam.x_m = 0.e-6 # average position in x/y/z beam.y_m = 0. # beam.z_m = -35.e-6 # beam.npart = 10000 # number of macroparticles in the beam beam.q_tot = -1.602e-37dens0.1 # beam charge beam.momentum_distribution_type = "gaussian" # beam.ux_m = 0.0 # the average momenta along each direction beam.uy_m = 0.0 # beam.uz_m = 1000. # beam.ux_th = 0. # standard deviations along each direction beam.uy_th = 0. # beam.uz_th = 20. #
################################# ############ LASER ############## ################################# lasers.names = laser1 laser2
laser1.profile = Gaussian laser1.position = 0.2183e-6 0. -0.e-6 # This point is on the laser plane laser1.direction = 0.0437 0.0000 -0.9990 # The plane normal direction laser1.polarization = 0.9990 0.0000 0.0437 # The main polarization vector laser1.a0 = 15 # Peak normalized amplitude of the laser field laser1.phi0 = 0 # laser1.do_continuous_injection = 1 # laser1.profile_waist = 10.e-6 # The waist of the laser (in m) laser1.profile_duration = 15.e-15 # The duration of the laser (in s) laser1.profile_t_peak = 17.5e-15 # Time at which the laser reaches its peak (in s) laser1.profile_focal_distance = 10.e-6 # Focal distance from the antenna (in m) laser1.wavelength = 1e-6 # The wavelength of the laser (in m) # laser2.profile = Gaussian laser2.position = -0.2183e-6 0. -0.e-6 # This point is on the laser plane laser2.direction = 0.0437 0.0000 0.9990 # The plane normal direction laser2.polarization = 0.9990 0.0000 -0.0437 # The main polarization vector laser2.a0 = 15 # Peak normalized amplitude of the laser field laser2.phi0 = 0 # laser2.do_continuous_injection = 1 # laser2.profile_waist = 10.e-6 # The waist of the laser (in m) laser2.profile_duration = 15.e-15 # The duration of the laser (in s) laser2.profile_t_peak = 17.5e-15 # Time at which the laser reaches its peak (in s) laser2.profile_focal_distance = 10.e-6 # Focal distance from the antenna (in m) laser2.wavelength = 1e-6 # The wavelength of the laser (in m)
With these parameters, we aim to investigate the interaction dynamics between the lasers, plasma, and the delayed electron beam. We are particularly interested in understanding the effects of the wakefields generated by the lasers on the electron beam's propagation and acceleration.
I have indeed considered using the moving window feature in WarpX and employing the particles_do_continuous_injection parameter to achieve the injection of the electron beam. However, when I set particles_do_continuous_injection = 1, the electron beam does not appear as expected. Similarly, I noticed that when initializing the laser using the lazy module, the laser.delay option allows controlling the timing of the laser pulses. Nevertheless, when I attempt to set a delay of negative forty optical cycles, the laser fails to appear. This behavior is unexpected, as setting a delay of -5 or -10 optical cycles results in the successful appearance of the laser. I am perplexed by this inconsistency and would appreciate any insights or suggestions on how to address these issues effectively within the WarpX framework.
Could you please advise on how we can effectively model this scenario in WarpX, considering the delayed injection of the electron beam and the wakefield effects? Any specific suggestions or pointers to relevant documentation would be greatly appreciated.
Thank you again for your support. Looking forward to your guidance on this matter.
@roelof-groenewald
I'm sorry for my mistake, your comment is very useful, thanks!
@1661145410 would you be willing to implement the equivalent functionality for the do_not_deposit
flag as in the above PR? That should provide what you need to effectively delay the injection of a particle beam, right?
I am currently working with the WarpX simulation software and have encountered an issue related to particle injection. The current implementation of particle injection in WarpX initializes all plasma components, including the initial plasma and the electron beams that are scheduled to be injected, at the zero moment after program initialization.
However, a limitation I have noticed is the inability to specify a time delay for subsequent particle injections. This becomes problematic when attempting to simulate scenarios where a laser pulse and an electron beam need to propagate in the same direction. Since the laser is initialized using an antenna approach, the electrons interact with the pulse in the opposite direction, altering their distribution when they enter the plasma region.
I am seeking guidance on how to address this issue. Is there a way to introduce a time delay for the injection of the electron beam in WarpX? This would enable a more accurate simulation of the interaction between the laser pulse and the electron beam, ensuring they propagate together as intended.
Please let me know if there are any existing features or workarounds that could help achieve this, or if you have any suggestions on how to approach this problem. Your assistance in this matter would be greatly appreciated.
Thank you for your time and support.