Sunday, January 18, 2009

Total-Field/Scattered-Field Formulation in One-Dimension FDTD

The total-field/scattered-field (TF/SF) formulation resulted from attempts to realize a plane-wave source that avoid the difficulties caused by using either hard sources or the initial-condition approach. The TF/SF formulation is based on the linearity of Maxwell’s equations.
We note that the finite-difference operations of the Yee algorithm can be applied with equal validity to the incident field, the scattered field, and the total field. This property permits zoning the Yee space lattice into two distinct regions (as shown in Fig.1): Region 1, where total fields are assumed to be stored in the computer memory; and Region 2 (surrounding Region 1), where scattered fields are assumed stored in the computer memory. Regions 1 and 2 are separated by a nonphysical virtual surface that serves to connect the fields in each region, called the total/scattered field boundary.



Fig.1 Total/Scattered field zoning in one-dimensional x-directed FDTD space lattice.
Based on these formulations, the total-field/scattered-field boundary condition has been implemented at both side of the array in the program FD1D_003, list as follow:
!* FD1D_003 1D FDTD simulation in free space *!
!* Absorbing Boundary Condition added *!
!* Total Scattered Boundary Condition added *!
Module common_data
implicit none
!Calculate region
integer,save:: Imin,Imax,Itmin,Itmax
!constant
real,parameter:: Eps0=8.854e-12,Mu0=1.25663706e-6
real,parameter:: C0=3.e8,Z0=377.,Pi=3.1415926536d0
!source parameter
real,save ::SourceT0,SourceT
!MAXIMUM NUMBER OF TIME STEPS
integer,parameter:: timestop=300
!grid size,timestep
real,save:: dx,dt
!variables for Field
real,dimension(:),allocatable,save:: Ez,Hy
!Variables for absorbing boundary
real,dimension(:),allocatable,save:: ABC
endmodule common_data

program main
use common_data
implicit none
integer ntime,i
call pre_processing
!MAIN LOOP FOR FIELD COMPUTATIONS AND DATA SAVING
DO Ntime=1,timestop
call Ezfd1d
call EzTSBC(Ntime)
call EzABC
call Hyfd1d
call HyTSBC(Ntime)
enddo
call savedata
end

subroutine pre_processing
use common_data
implicit none
Imin=-300;Imax=300
Itmin=-200;Itmax=200
allocate(Ez(Imin:Imax))
allocate(Hy(Imin:Imax))
allocate(ABC(1:4))
Ez=0.;Hy=0.;ABC=0.
dx=1.e-2;
dt=dx/2./c0
SourceT0=120;SourceT=50
return
end

subroutine Ezfd1d
use common_data
implicit none
integer i,n
do i=Imin+1,Imax-1
Ez(i)=Ez(i)+(Hy(i-1)-Hy(i))*dt/dx/Eps0
enddo
return
end

subroutine EzTSBC(n)
use common_data
implicit none
integer n,rn
Ez(Itmin)=Ez(Itmin)+exp(-((n-1)*1.-SourceT0)**2/SourceT**2)
* *dt/dx/Eps0/z0
rn=n-802
if(rn.gt.0) then
Ez(Itmax)=Ez(Itmax)-exp(-((rn-1)*1.-SourceT0)**2/SourceT**2)
* *dt/dx/Eps0/z0
endif
return
end

subroutine EzABC
use common_data
implicit none
Ez(Imin)=ABC(2)
ABC(2)=ABC(1)
ABC(1)=Ez(Imin+1)
Ez(Imax)=ABC(4)
ABC(4)=ABC(3)
ABC(3)=Ez(Imax-1)
return
end

subroutine Hyfd1d
use common_data
implicit none
integer i
do i=Imin,Imax-1
Hy(i)=Hy(i)-(Ez(i+1)-Ez(i))*dt/dx/Mu0
enddo
return
end

subroutine HyTSBC(n)
use common_data
implicit none
integer n,rn
Hy(Itmin-1)=Hy(Itmin-1)+exp(-((n-1)*1.-SourceT0)**2/SourceT**2)
* *dt/dx/Mu0
rn=n-801
if(rn.gt.0) then
Hy(Itmax)=Hy(Itmax)-exp(-((rn-1)*1.-SourceT0)**2/SourceT**2)
* *dt/dx/Mu0
endif
return
end

subroutine savedata
use common_data
implicit none
integer i
open(1,file='ex')
open(2,file='z_cell')
write(1,*) (Ez(i),i=Imin,Imax)
write(2,*) (i,i=Imin,Imax)
close(1)
close(2)
return
end
Fig.2 Action of total-field/scattered-field zoning for a one-dimensional linear Yee grid.





No comments:

Post a Comment

Followers

Blog Archive