Skip to content

Commit

Permalink
improved DWA wake calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
qianglbl committed Apr 20, 2023
1 parent f174c62 commit 48e150d
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions src/Appl/Field.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2544,16 +2544,16 @@ subroutine dwakefield_FieldQuant(Nx,Ny,Nz,hx,hy,hz,chgdens,dexwake,&
if(dtyp.eq.0)then
lx=PI/dkx(1)
do e=1,2
do l=1,nint(dnkx)
kx=dkx(l)
do m=1,nint(dnky)
do m=1,nint(dnky)
if(2*((m-1)/2).eq.m-1)then
par=0
else
par=1
endif
ky=dky(l,m,e)
kz=sqrt((kx*kx+ky*ky)/(deps-1)) ! omega/c
do l=1,nint(dnkx)
kx=dkx(l)
ky=dky(l,m,e)
kz=sqrt((kx*kx+ky*ky)/(deps-1)) ! omega/c
do k=1,Nz
z=(k-1)*hz
fs(k)=amp(l,m,e)*cos(kz*z)
Expand All @@ -2570,17 +2570,17 @@ subroutine dwakefield_FieldQuant(Nx,Ny,Nz,hx,hy,hz,chgdens,dexwake,&
enddo ! n
enddo ! k
if(e.eq.1)then
call dwakeConv_FieldQuant(Nz,lam,hz,fs,lams)
call dwakeConv_FieldQuant(Nz,lam,hz,fa,lama)
call dwakeConv_FieldQuant(Nz,lam,hz,fs,lams)
call dwakeConv_FieldQuant(Nz,lam,hz,fa,lama)
else
call dwakeConv_FieldQuant(Nz,laa,hz,fs,laas)
call dwakeConv_FieldQuant(Nz,laa,hz,fa,laaa)
call dwakeConv_FieldQuant(Nz,laa,hz,fs,laas)
call dwakeConv_FieldQuant(Nz,laa,hz,fa,laaa)
endif
do i=1,Nx
x=xmin+(i-1)*hx
do k=1,Nz
do j=1,Ny
y=ymin+(j-1)*hy
do k=1,Nz
do i=1,Nx
x=xmin+(i-1)*hx
if(par.eq.0.and.e.eq.1)then ! LSM-SYM
dexwake(i,j,k)=dexwake(i,j,k)-lama(k)*sin(kx*x)*cosh(kx*y)&
*kx/kz
Expand Down Expand Up @@ -2618,13 +2618,12 @@ subroutine dwakefield_FieldQuant(Nx,Ny,Nz,hx,hy,hz,chgdens,dexwake,&
*(kx*kx+kz*kz)/kx/kz
dbzwake(i,j,k)=dbzwake(i,j,k)+laas(k)*sin(kx*x)*cosh(kx*y)
endif
enddo ! k (z)
enddo ! i (x)
enddo ! j (y)
enddo ! i (x)
enddo ! m
enddo ! l
enddo ! k (z)
enddo ! l
enddo ! m
enddo ! e


! take care of units: V/m and T
conv2V=dv*gammaz/lx/hz
Expand Down

0 comments on commit 48e150d

Please sign in to comment.