Warwick-Plasma/epoch

how to generated a laser from boundary y_min or y_max

Closed this issue · 3 comments

How do I generate a laser propagating in the positive direction of y on the y_min boundary? I have tried code like this, but it did not work.
begin:laser # p_polarized
boundary = y_min
intensity = intensity0/2
lambda = lambda1
pol_angle = 0
phase = -2.0 * pi/lambda0 * x^2/(2.0 * RC) + gouy
profile = gauss(x,0,w_bnd1)
t_profile = gauss(time,time_delay,t_duration)
end:laser

with boundary condition

begin:boundaries
bc_x_min = simple_laser
bc_x_max = simple_outflow
bc_y_min = simple_laser
bc_y_max = simple_outflow
end:boundaries

Please post your entire input deck.

begin:constant

alpha = 45*pi/180  				#target twist angle, radian  
lambda0 = 0.8 * micron 			#laser wavelength
omega = 2.0 * pi * c /lambda0  	# k = 2*pi*c/lamda0
n_critical = critical(omega)  	# critical density, for 0.8um wavelength
intensity0 = 6e20 * 1e4       	#laser-intensity, (W/m^2)

# transformation of cooridnates, for oblique incidence  angle alpha
targetX = x * cos(alpha) + y * sin(alpha)
targetY = -x * sin(alpha) + y * cos(alpha)

# parameters for laser block
t_FWHM = 30 * femto
w_FWHM = 3.0 * micron

w0 = w_FWHM/(2.*sqrt(loge(2)))          #laser beam waist at focus (1/e radius)
t_duration = t_FWHM/(2.*sqrt(loge(2)))	#laser duration


x_spot = - 20*micron			#Supposing x(w = w0) as ordinary(x = 0)
x_position = 0 *micron			#target position
x_R = pi * w0^2/lambda0 		#rayleigh range
RC = x_spot * (1.0 + (x_R/x_spot)^2)  		#Radicus of curvature on x_min 
gouy = atan(x_spot/x_R)   					#Gouy phase shift at x_min
w_bnd = w0 * sqrt(1.0 +(x_spot/x_R)^2)  	#Spot size at x_min

time_delay = 2 * t_duration					#delay time, 2 * duration

end:constant

begin:control
# number of grid
nx = 4000
ny = 4000

# final time 200fs 
t_end = 200 * femto

# Size of domain
x_min = -20 * micron
x_max = 20 * micron
y_min = -20 * micron
y_max =  20 * micron

stdout_frequency = 100

end:control

begin:laser # p_polarized
boundary = x_min
intensity = intensity0/2
lambda = lambda0
pol_angle = 0 # 0 for p_polarized, pi/2 for s_polarized
phase = -2.0 * pi/lambda0 * y^2/(2.0 * RC) + gouy
profile = gauss(y,0,w_bnd)
t_profile = gauss(time,time_delay,t_duration)
end:laser

begin:laser # p_polarized
boundary = y_min
intensity = intensity0/2
lambda = lambda0
pol_angle = 0 # 0 for p_polarized, pi/2 for s_polarized
phase = -2.0 * pi/lambda0 * x^2/(2.0 * RC) + gouy
profile = gauss(x,0,w_bnd)
t_profile = gauss(time,time_delay,t_duration)
end:laser

begin:boundaries

#boundary setting, laser from x_min, other boundaries no reflection

bc_x_min = simple_laser
bc_x_max = simple_outflow
bc_y_min = simple_laser
bc_y_max = simple_outflow

end:boundaries

begin:species
# Electrons
name = Electrons
charge = -1.0
mass = 1.0

# n Electron per cell = 10, half part, fraction 0.5
npart_per_cell = 10
	
# density ditribution
# target position, x = x_spot, 300nm target, ne = 100nc
density = if((targetX gt x_position)and(targetX lt x_position+0.1*micron),0.9*n_critical,0) 

temperature = 300

end:species

begin:species
# Protons
name = Protons
charge = 1
mass = 1836.2
npart_per_cell = 10
density = density(Electrons)
temperature = 300

end:species

begin:output
name = PIC
file_prefix = PIC

##  timesteps between output_dumps
dt_snapshot = 20 * femto

##  Properties at particle position
particles = always + species
vx = always + species
vy = always + species
particle_energy = always + species

##  Properties on grid
grid = always
ex = always
ey = always 
bx = always
by = always
number_density = always + species

end:output

entire input deck is shown here, the code has slightly changed. But I have tried it which still did not work.

the code is correct. the reason that I have not seen the laser from y_min is that the polarization direction is in z direction which I did not output it in my sdf file