Simulation of The Finite Difference Time Domain in Two Dimension
Simulation of The Finite Difference Time Domain in Two Dimension
∂H y ∂ ( Ezx + Ezy )
Abstract—The finite-difference time-domain (FDTD) method is µ + σ x* H y = (2)
one of the most widely used computational methods in ∂t ∂x
electromagnetic. This paper describes the design of two-dimensional
(2D) FDTD simulation software for transverse magnetic (TM)
∂Ezx ∂H y
polarization using Berenger's split-field perfectly matched layer
ε + σ x Ezx = (3)
∂t ∂x
International Science Index, Computer and Information Engineering Vol:6, No:3, 2012 waset.org/Publication/5827
(1 − e ) H
conductivity (σ*) that will make the boundary condition to −σ *x ( i +1 2, j +1 2 )δ t ε
(6)
work as wave absorber region. This paper describes the design − n
( i, j + 1 2 ) − H yn ( i + 1, j + 1 2 )
of a two-dimensional (2D) FDTD simulation software for σ x* ( i + 1 2 , j + 1 2 ) δ x y
International Scholarly and Scientific Research & Innovation 6(3) 2012 360 scholar.waset.org/1307-6892/5827
World Academy of Science, Engineering and Technology
International Journal of Computer and Information Engineering
Vol:6, No:3, 2012
50
analytical solution
Then, the local error of the computed field in ΩT, due to
FDTD + PML ( 16 ) reflections from the PML, is obtained by subtracting the field
45
FDTD + PML ( 8 ) at any point within ΩT at a given time step from the field at the
corresponding point in ΩB. Here, Ez is used to define the error
40
n n
= Ez ,T − Ez , B i , j
n
|E|
elocal i, j i, j
(8)
35
International Scholarly and Scientific Research & Innovation 6(3) 2012 361 scholar.waset.org/1307-6892/5827
World Academy of Science, Engineering and Technology
International Journal of Computer and Information Engineering
Vol:6, No:3, 2012
0
10 iefbc = ie + 2*iebc;
jefbc = je + 2*jebc;
ibfbc = iefbc + 1;
-10
10 jbfbc = jefbc + 1;
%**********************************************
% Material parameters
-20
%**********************************************
Global Error
10
media = 2;
Mur ABC
eps = [1.0 4.0];
PML ABC (16 cell)
10
-30
PML ABC (8 cell)
sig = [0.0 0.12];
PML ABC (4 cell) mur = [1.0 1.0];
sim = [0.0 0.0];
10
-40
%**********************************************
% Field arrays
%**********************************************
10
-50 ez = zeros(ibfbc,jbfbc); %fields in main grid
0 100 200 300 400 500 ezx = zeros(ibfbc,jbfbc);
Time Step
ezy = zeros(ibfbc,jbfbc);
Fig. 4 Global error within a 100×50 cell two-dimensional TM test hx = zeros(iefbc,jefbc);
grid hy = zeros(iefbc,jefbc);
%**********************************************
International Science Index, Computer and Information Engineering Vol:6, No:3, 2012 waset.org/Publication/5827
-5
x 10
2 % Updating coefficients
%**********************************************
1.5 for i = 1:media
Normalized Reflection Along J = 1
eaf = dt*sig(i)/(2.0*epsz*eps(i));
1
ca(i) = (1.0-eaf)/(1.0+eaf);
cb(i) = dt/epsz/eps(i)/dx/(1.0+eaf);
haf = dt*sim(i)/(2.0*muz*mur(i));
0.5
da(i) = (1.0-haf)/(1.0+haf);
db(i) = dt/muz/mur(i)/dx/(1.0+haf);
0 end
%**********************************************
-0.5 % Geometry specification (main grid)
PML ABC ( 16 cell )
PML ABC ( 8 cell ) %**********************************************
-1 % Initialize entire main grid to free space
caezx(1:ibfbc,1:jbfbc) = ca(1);
-1.5 cbezx(1:ibfbc,1:jbfbc) = cb(1);
0 20 40 60 80 100 caezy(1:ibfbc,1:jbfbc) = ca(1);
Grid Position, I
cbezy(1:ibfbc,1:jbfbc) = cb(1);
Fig. 5 Comparative local error measures for Mur and PML ABCs dahxy(1:iefbc,1:jefbc) = da(1);
along the test grid outer boundary at time-step n = 100. dbhxy(1:iefbc,1:jefbc) = db(1);
dahyx(1:iefbc,1:jefbc) = da(1);
dbhyx(1:iefbc,1:jefbc) = db(1);
APPENDIX
%********************************************** % Add dielectric cylinder
% Fundamental constants diam = 40; % diameter of cylinder: 6 cm
%********************************************** rad = diam/2.0; % radius of cylinder: 3 cm
cc = 2.99792458e8; %speed of light in free space ic = iefbc/2; % i-coordinate of cylinder's center
muz = 4.0*pi*1.0e-7; %permeability of free space jc = jefbc/2; % j-coordinate of cylinder's center
epsz = 1.0/(cc*cc*muz); %permittivity of free space
freq = 2.5e+9; %frequency of source excitation for i = iebc+1:ie+iebc-1
omega = 2.0*pi*freq; for j = jebc+1:je+jebc-1
%********************************************** dist2 = (i-ic)^2 + (j-jc)^2;
% Grid parameters if dist2 <= rad^2
%********************************************** caezy(i,j) = ca(2);
ie = 50; %number of grid cells in x-direction cbezy(i,j) = cb(2);
je = 50; %number of grid cells in y-direction caezx(i,j) = ca(2);
cbezx(i,j) = cb(2);
ib = ie + 1; end
jb = je + 1; end
end
dx = 3.0e-3; %space increment of square lattice %**********************************************
dt = dx/(2.0*cc); %time step % Fill the PML regions
%**********************************************
nmax = 500; %total number of time steps delbc = iebc*dx;
sigmam=-log(rmax/100.0)*epsz*cc*(orderbc+1)/(2*delbc);
iebc = 8; %thickness of left and right PML region bcfactor=eps(1)*sigmam/(dx*(delbc^orderbc) * …
jebc = 8; %thickness of front and back PML region (orderbc+1));
rmax = 0.00001;
orderbc = 2; % FRONT region
ibbc = iebc+1; caezy(1:ibfbc,1) = 1.0;
jbbc = jebc+1; cbezy(1:ibfbc,1) = 0.0;
International Scholarly and Scientific Research & Innovation 6(3) 2012 362 scholar.waset.org/1307-6892/5827
World Academy of Science, Engineering and Technology
International Journal of Computer and Information Engineering
Vol:6, No:3, 2012
for j = 2:jebc
y1 = (jebc-j+1.5)*dx; for i = 1:iebc
y2 = (jebc-j+0.5)*dx; x1 = (iebc-i+1)*dx;
sigmay = bcfactor*(y1^(orderbc+1)-y2^(orderbc+1)); x2 = (iebc-i)*dx;
ca1 = exp(-sigmay*dt/(epsz*eps(1))); sigmax = bcfactor*(x1^(orderbc+1)-x2^(orderbc+1));
cb1 = (1.0-ca1)/(sigmay*dx); sigmaxs = sigmax*(muz/(epsz*eps(1)));
caezy(1:ibfbc,j) = ca1; da1 = exp(-sigmaxs*dt/muz);
cbezy(1:ibfbc,j) = cb1; db1 = (1-da1)/(sigmaxs*dx);
end dahyx(i,1:jefbc) = da1;
sigmay = bcfactor*(0.5*dx)^(orderbc+1); dbhyx(i,1:jefbc) = db1;
ca1 = exp(-sigmay*dt/(epsz*eps(1))); end
cb1 = (1-ca1)/(sigmay*dx);
caezy(1:ibfbc,jbbc) = ca1; % RIGHT region
cbezy(1:ibfbc,jbbc) = cb1; caezx(ibfbc,1:jbfbc) = 1.0;
cbezx(ibfbc,1:jbfbc) = 0.0;
for j=1:jebc for i = 1:iebc-1
y1 = (jebc-j+1)*dx; x1 = (i+0.5)*dx;
y2 = (jebc-j)*dx; x2 = (i-0.5)*dx;
sigmay = bcfactor*(y1^(orderbc+1)-y2^(orderbc+1)); sigmax = bcfactor*(x1^(orderbc+1)-x2^(orderbc+1));
sigmays = sigmay*(muz/(epsz*eps(1))); ca1 = exp(-sigmax*dt/(epsz*eps(1)));
da1 = exp(-sigmays*dt/muz); cb1 = (1-ca1)/(sigmax*dx);
International Science Index, Computer and Information Engineering Vol:6, No:3, 2012 waset.org/Publication/5827
International Scholarly and Scientific Research & Innovation 6(3) 2012 363 scholar.waset.org/1307-6892/5827
World Academy of Science, Engineering and Technology
International Journal of Computer and Information Engineering
Vol:6, No:3, 2012
REFERENCES
[1] K.S. Yee, “Numerical solution of initial boundary value problems
involving Maxwell’s equations in isotropic media,” IEEE Trans.
Antennas & Propag., vol. 14, 1966, pp: 302-307.
[2] A. Taflove, and M.E. Brodwin, "Numerical solution of steady-state
electromagnetic scattering problems using the time-dependent
Maxwell's equations," IEEE Trans. on Microwave Theo. & Tech., vol.
23, no. 8, 1975, pp.:623–630.
[3] A. Taflove, ” Application of the finite-difference time-domain method
to sinusoidal steady state electromagnetic penetration problems,” IEEE
Trans. Electromag. Compatibil., vol. 22, 1980, pp.: 191-202.
[4] A. Taflove, S. Hagness, “ Computational Electrodynamics: The Finite-
Difference Time-Domain Method,” 3rd Ed.. Artech House Publishers.
2005.
[5] K. Umashankar, and A. Taflove, "A novel method to analyze
electromagnetic scattering of complex objects," IEEE Trans.
Electromag. Compatibil., vol. 24, 1982, pp.:397–405.
[6] J.P. Berenger, “A perfectly matched layer for the absorption of
electromagnetic waves,” J. Comput. Phys., vol. 114, 1994, pp.: 185-200.
[7] R. Harrington, “Time Harmonic Electromagnetic Fields,” New York:
International Science Index, Computer and Information Engineering Vol:6, No:3, 2012 waset.org/Publication/5827
McGraw-Hill. 1961.
[8] T. Moore, J. Blaschak, A. Taflove, and G. Kriegsmann, “Theory and
application of radiation boundary operators,” IEEE Trans. Antennas &
Propagat., vol. 36, 1988, pp. 1797-1812.
[9] G. Mur, “Absorbing boundary conditions for the finite-difference
approximation of the time-domain electromagnetic-field equations,”
IEEE Trans. Electromag. Compatibil., vol. 23, no. 4, 1981, pp. 377-382.
International Scholarly and Scientific Research & Innovation 6(3) 2012 364 scholar.waset.org/1307-6892/5827