基于UPML的三维FDTD正演模拟及其应用

13 下载量 34 浏览量 更新于2024-09-05 1 收藏 1.09MB PDF 举报
基于UPML的三维FDTD正演模拟 基于UPML的三维FDTD正演模拟是依托时域有限差分法(Finite-Difference Time Domain, FDTD)计算电磁场问题的方法。时域有限差分法是一种常用的数值模拟方法,能够模拟电磁波在三维空间中的传播情况及其规律。但是,时域有限差分法需要设置适当的吸收边界条件(Absorbing Boundary Condition, ABC),将无限空间转化为有限空间,以便模拟电磁波的传播情况。 单轴各向异性完全匹配层(Uniaxial Perfectly Matched Layer, UPML)是常用的吸收边界条件之一。UPML是一种人工边界条件,能够吸收电磁波的能量,从而模拟电磁波在三维空间中的传播情况。基于UPML的三维FDTD正演模拟方法能够模拟电磁波在三维空间中的传播情况,并且具有很高的计算精度。 FDTD的基本原理是将时域有限差分法应用于电磁场问题的计算中。时域有限差分法是一种离散化方法,将时间和空间离散化为有限个点,计算电磁场在每个点上的值。基于UPML的三维FDTD正演模拟方法则是将UPML吸收边界条件应用于三维时域有限差分法中,以模拟电磁波在三维空间中的传播情况。 基于UPML的三维FDTD正演模拟方法的迭代公式是基于时域有限差分法的基本原理。该公式将电磁场问题分解为时间和空间两个方向,计算电磁场在每个点上的值,并且应用UPML吸收边界条件,以模拟电磁波在三维空间中的传播情况。 在实际应用中,基于UPML的三维FDTD正演模拟方法可以与Matlab编程软件结合使用,以模拟电磁波在三维空间中的传播情况。Matlab是一种强大的图形处理软件,能够对电磁波的传播情况进行可视化展示,从而帮助研究人员更好地理解电磁波的传播规律。 基于UPML的三维FDTD正演模拟方法是一种有用的数值模拟方法,能够模拟电磁波在三维空间中的传播情况,并且具有很高的计算精度。该方法可以在电磁勘探、地球动力学等领域中应用,以帮助研究人员更好地理解电磁波的传播规律。 知识点: 1. 时域有限差分法(FDTD):一种数值模拟方法,用于模拟电磁波在三维空间中的传播情况。 2. 吸收边界条件(ABC):一种人工边界条件,用于将无限空间转化为有限空间,以便模拟电磁波的传播情况。 3. 单轴各向异性完全匹配层(UPML):一种常用的吸收边界条件,能够吸收电磁波的能量,从而模拟电磁波在三维空间中的传播情况。 4. 三维FDTD正演模拟:一种基于时域有限差分法的数值模拟方法,用于模拟电磁波在三维空间中的传播情况。 5. Matlab编程软件:一种强大的图形处理软件,能够对电磁波的传播情况进行可视化展示。
2015-08-13 上传
%*********************************************************************** % 3-D FDTD code with PEC boundaries %*********************************************************************** % % Program author: Susan C. Hagness % Department of Electrical and Computer Engineering % University of Wisconsin-Madison % 1415 Engineering Drive % Madison, WI 53706-1691 % 608-265-5739 % hagness@engr.wisc.edu % % Date of this version: February 2000 % % This MATLAB M-file implements the finite-difference time-domain % solution of Maxwell's curl equations over a three-dimensional % Cartesian space lattice comprised of uniform cubic grid cells. % % To illustrate the algorithm, an air-filled rectangular cavity % resonator (充气矩形空腔谐振器) is modeled. The length, width, and height of the % cavity are 10.0 cm (x-direction), 4.8 cm (y-direction), and % 2.0 cm (z-direction), respectively. % % The computational domain is truncated using PEC boundary % conditions: % ex(i,j,k)=0 on the j=1, j=jb, k=1, and k=kb planes % ey(i,j,k)=0 on the i=1, i=ib, k=1, and k=kb planes % ez(i,j,k)=0 on the i=1, i=ib, j=1, and j=jb planes % These PEC boundaries form the outer lossless walls of the cavity. % % The cavity is excited by an additive current source oriented % along the z-direction. The source waveform is a differentiated % Gaussian pulse given by % J(t)=-J0*(t-t0)*exp(-(t-t0)^2/tau^2), % where tau=50 ps. The FWHM ( 半最大值全宽度(full width at half maximum)) % spectral bandwidth of this zero-dc- % content pulse is approximately 7 GHz. The grid resolution (分辨率) % (dx = 2 mm) was chosen to provide at least 10 samples per % wavelength up through 15 GHz. % % To execute this M-file, type "fdtd3D" at the MATLAB prompt. % This M-file displays the FDTD-computed Ez fields at every other % time step (第一个时间步), and records those frames in a movie matrix, M, which % is played at the end of the simulation using the "movie" command. % %*********************************************************************** clear %*********************************************************************** % Fundamental constants %*********************************************************************** cc=2.99792458e8; %speed of light in free space muz=4.0*pi*1.0e-7; %permeability of free space epsz=1.0/(cc*cc*muz); %permittivity of free space %*********************************************************************** % Grid parameters %*********************************************************************** ie=50; %number of grid cells in x-direction je=24; %number of grid cells in y-direction ke=10; %number of grid cells in z-direction ib=ie+1; jb=je+1; kb=ke+1; is=26; %location of z-directed current source js=13; %location of z-directed current source kobs=5; dx=0.002; %space increment of cubic lattice dt=dx/(2.0*cc); %time step nmax=500; %total number of time steps %*********************************************************************** % Differentiated Gaussian pulse excitation %*********************************************************************** rtau=50.0e-12; tau=rtau/dt; ndelay=3*tau; srcconst=-dt*3.0e+11; %*********************************************************************** % Material parameters %*********************************************************************** eps=1.0; %相对介电常数 epsz,真空介电常数 sig=0.0; %相对电阻率 %*********************************************************************** % Updating coefficients %*********************************************************************** ca=(1.0-(dt*sig)/(2.0*epsz*eps))/(1.0+(dt*sig)/(2.0*epsz*eps)); cb=(dt/epsz/eps/dx)/(1.0+(dt*sig)/(2.0*epsz*eps)); da=1.0; db=dt/muz/dx; %*********************************************************************** % Field arrays %*********************************************************************** ex=zeros(ie,jb,kb); ey=zeros(ib,je,kb); ez=zeros(ib,jb,ke); hx=zeros(ib,je,ke); hy=zeros(ie,jb,ke); hz=zeros(ie,je,kb); %*********************************************************************** % Movie initialization %*********************************************************************** tview(:,:)=ez(:,:,kobs); sview(:,:)=ez(:,js,:); subplot('position',[0.15 0.45 0.7 0.45]), pcolor(tview'); %shading flat; %caxis([-1.0 1.0]); %colorbar; %axis image; title(['Ez(i,j,k=5), time step = 0']); xlabel('i coordinate'); ylabel('j coordinate'); subplot('position',[0.15 0.10 0.7 0.25]), pcolor(sview'); %shading flat; %caxis([-1.0 1.0]); %colorbar; %axis image; title(['Ez(i,j=13,k), time step = 0']); xlabel('i coordinate'); ylabel('k coordinate'); rect=get(gcf,'Position'); rect(1:2)=[0 0]; M=moviein(nmax/2,gcf,rect); %*********************************************************************** % BEGIN TIME-STEPPING LOOP %*********************************************************************** for n=1:nmax %*********************************************************************** % Update electric fields %*********************************************************************** ex(1:ie,2:je,2:ke)=ca*ex(1:ie,2:je,2:ke)+... cb*(hz(1:ie,2:je,2:ke)-hz(1:ie,1:je-1,2:ke)+... hy(1:ie,2:je,1:ke-1)-hy(1:ie,2:je,2:ke)); ey(2:ie,1:je,2:ke)=ca*ey(2:ie,1:je,2:ke)+... cb*(hx(2:ie,1:je,2:ke)-hx(2:ie,1:je,1:ke-1)+... hz(1:ie-1,1:je,2:ke)-hz(2:ie,1:je,2:ke)); ez(2:ie,2:je,1:ke)=ca*ez(2:ie,2:je,1:ke)+... cb*(hx(2:ie,1:je-1,1:ke)-hx(2:ie,2:je,1:ke)+... hy(2:ie,2:je,1:ke)-hy(1:ie-1,2:je,1:ke)); ez(is,js,1:ke)=ez(is,js,1:ke)+... srcconst*(n-ndelay)*exp(-((n-ndelay)^2/tau^2)); % J(t)=-J0*(t-t0)*exp(-(t-t0)^2/tau^2) %*********************************************************************** % Update magnetic fields %*********************************************************************** hx(2:ie,1:je,1:ke)=hx(2:ie,1:je,1:ke)+... db*(ey(2:ie,1:je,2:kb)-ey(2:ie,1:je,1:ke)+... ez(2:ie,1:je,1:ke)-ez(2:ie,2:jb,1:ke)); hy(1:ie,2:je,1:ke)=hy(1:ie,2:je,1:ke)+... db*(ex(1:ie,2:je,1:ke)-ex(1:ie,2:je,2:kb)+... ez(2:ib,2:je,1:ke)-ez(1:ie,2:je,1:ke)); hz(1:ie,1:je,2:ke)=hz(1:ie,1:je,2:ke)+... db*(ex(1:ie,2:jb,2:ke)-ex(1:ie,1:je,2:ke)+... ey(1:ie,1:je,2:ke)-ey(2:ib,1:je,2:ke)); %*********************************************************************** % Visualize fields %*********************************************************************** if mod(n,2)==0; timestep=int2str(n); tview(:,:)=ez(:,:,kobs); sview(:,:)=ez(:,js,:); subplot('position',[0.15 0.45 0.7 0.45]), pcolor(tview'); % shading flat; % caxis([-1.0 1.0]); % colorbar; % axis image; title(['Ez(i,j,k=5), time step = ',timestep]); xlabel('i coordinate'); ylabel('j coordinate'); subplot('position',[0.15 0.10 0.7 0.25]), pcolor(sview'); % shading flat; % caxis([-1.0 1.0]); % colorbar; % axis image; title(['Ez(i,j=13,k), time step = ',timestep]); xlabel('i coordinate'); ylabel('k coordinate'); nn=n/2; M(:,nn)=getframe(gcf,rect); end; %*********************************************************************** % END TIME-STEPPING LOOP %*********************************************************************** end movie(gcf,M,0,10,rect);