Warwick-Plasma / epoch

Particle-in-cell code for plasma physics simulations
https://epochpic.github.io
GNU General Public License v3.0
186 stars 59 forks source link

Have a focusing gaussian beam coming out of the boundary at an angle #464

Open lasertime opened 1 year ago

lasertime commented 1 year ago

Does anyone know how to have a focusing Gaussian beam that comes out at an angle? Additionally, be able to move the laser so it doesn't come out a 0 on the boundary? I have been trying my best using the other issues that talked about it and the EPOCH manual but haven't had any luck doing it.

TomGoffrey commented 1 year ago

Does #451 help at all?

lasertime commented 1 year ago

It did help for shifting the laser. I will share what I got for the laser block which I think has all the information necessary. I ran 2 simulations with input parameters. One was angled at pi/6 and other not angled. Both came out the ymin boundary with other boundaries open. If things worked, I thought taking the magnitude of the electric field would be a good baseline. I plotted what the maximum magnitude was overtime and there was some deviation so makes me think it isn't accurate but I could be wrong.

`

ANGLED LASER

begin:laser

boundary = y_min

amp = amp_Bound

lambda = lambda0 * cos(las_angle)

t_start = 0

t_end = 84 * femto

t_profile = if( (time lt (84femto)), sin(pi time / (84*femto) ), 0 )

phase = -(x(2.0 pi/ lambda0) sin(las_angle)) + (((2.0 pi/ lambda0)) (x - laser_x_pos)^2 / (2.0 RC)) - gouy

polarisation_angle = pi/2

profile = gauss(x,laser_x_pos,w_bnd)

end:laser

NOT ANGLED LASER

begin:laser boundary = y_min amp = amp_Bound lambda = lambda0 t_start = 0 t_end = 84 femto t_profile = if( (time lt (84femto)), sin(pi time / (84femto) ), 0 ) phase = (((2.0 pi/ lambda0)) (x)^2 / (2.0 * RC)) - gouy polarisation_angle = pi/2 profile = gauss(x,0,w_bnd) end:laser `

max_electric_field_magnitude_overtime

skuschel commented 1 year ago

Maybe you want to have a look here: https://github.com/skuschel/epochinput/blob/master/focuslaser/input.deck#L48

Using this template, I managed to inject a laser pulse over the edge of the simulation box (meaning from 2 boundaries).

lasertime commented 1 year ago

Maybe you want to have a look here: https://github.com/skuschel/epochinput/blob/master/focuslaser/input.deck#L48

Using this template, I managed to inject a laser pulse over the edge of the simulation box (meaning from 2 boundaries).

I think I see what to do from the input deck you shared for doing an angle and shift. I would define some angle and if I need to shift i would add a constant


las_angle = some value in radians
x_shift = some value
y_shift = some value
z_las = ((x + x_shift)*cos(las_angle)) + ((y+ y_shift)*sin(las_angle) ))
r_las = sqrt((-sin(las_angle)*(x+ x_shift) + cos(las_angle)*(y+ y_shift))^2 + z^2)

I checked out your input deck and I was wondering what is laser_focus_time and how is it calculated/chosen? and what is it doing in the phase part of the laser block? in the profile part of the laser block, what does the gauss factor that utilizes the time variable actually doing and why is it there?

begin:laser
  # LASER 1
  # laser block for primary laser pulse (more will be added later)
  boundary = x_min
  # intensity at the injection boundary
  intensity_w_cm2 = (las_width / las_w) ^ (ndims-1) * las_intensity_focus
  lambda = las_lambda
  # phase profile required to add curved wavefronts in order to focus the beam
  # Added pi / 2 so there will be a cosinus and not a sinus
  phase = - las_k * z_las - las_k * las_rc_shift + las_gouy  - 2 * pi * c / las_lambda * las_focus_time + las_cep + pi / 2

  pol_angle = las_polangle
  #radial * temporal/longitudinal profiles
  profile = gauss(r_las , 0, las_w) * gauss(time - las_rc_shift / c, las_focus_time + z_las /c, las_widtht)
end:laser
lasertime commented 1 year ago

also, how was las_focus_time calculated and what is it for? What does the - 2 pi c / las_lambda * las_focus_time do?

skuschel commented 1 year ago

the simulation always starts at t=0. The laser pulse will be injected such, that at t=las_focus_time the maximum of the laser pulses reaches the focus. Depending on how far your boundary is from the focus position and you long your laserpulse is, you have to set the las_focus_time accordingly.

The value las_focus_time is in the phase term to adjust the injection for the correct CE-phase.

lasertime commented 1 year ago

so then las_focus_time would be the distance laser travels from boundary to origin (assuming i want focus to be at origin) divided by the speed of light plus the time until FWHM?

skuschel commented 1 year ago

yes, you should set it to at least that value. Its probably a good idea to add 3*FWHM to make sure, that the laser pulse is not cut on the rising edge.