%***********************************************************************
% 3-D FDTD code with UPML absorbing boundary conditions 三维FDTD方法代码UPML吸收边界条件
%***********************************************************************
%
% Program author: Keely J. Willis, Graduate Student
% UW Computational Electromagnetics Laboratory
% Director: Susan C. Hagness
% Department of Electrical and Computer Engineering
% University of Wisconsin-Madison
% 1415 Engineering Drive
% Madison, WI 53706-1691
% [url=mailto:[email protected]][email protected][/url]
%
% Copyright 2005
%
% This MATLAB M-file implements the finite-difference time-domain 这基于MATLAB的M -文件执行时域有限差分法
% solution of Maxwell's curl equations over a three-dimensional 解决麦克斯韦方程超过三维笛卡儿空间网格
% Cartesian space lattice comprised of uniform cubic grid cells. 组成的网格均匀立方米细胞。
%
% The dimensions of the computational domain are 8.2 cm 尺寸计算域
% (x-direction), 3.4 cm (y-direction), and 3.2 cm (z-direction).
% The grid is terminated with UPML absorbing boundary conditions. 网格是终止UPML吸收边界条件。
%
% An electric current source comprised of two collinear Jz components 电流源组成的两个组成部分(实现了赫兹偶极子)共锦州兴奋一径向传播波
% (realizing a Hertzian dipole) excites a radially propagating wave. 当前源位于中心的网格。
% The current source is located in the center of the grid. 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 spectral bandwidth of this zero-dc- 的半高宽光谱带宽这一零直流脉冲内容大约是7千兆赫
% content pulse is approximately 7 GHz. The grid resolution 选择提供至少10个采样率 波长通过15千兆赫。
% (dx = 2 mm) was chosen to provide at least 10 samples per
% wavelength up through 15 GHz.
%
% To execute this M-file, type "fdtd3D_UPML" at the MATLAB prompt. 执行此的M -文件,键入“ fdtd3D_UPML ”在MATLAB的提示
%
% This code has been tested in the following Matlab environments: 此代码已经过测试以下Matlab的环境
% Matlab version 6.1.0.450 Release 12.1 (May 18, 2001)
% Matlab version 6.5.1.199709 Release 13 Service Pack 1 (August 4, 2003)
% Matlab version 7.0.0.19920 R14 (May 6, 2004)
% Matlab version 7.0.1.24704 R14 Service Pack 1 (September 13, 2004)
% Matlab version 7.0.4.365 R14 Service Pack 2 (January 29, 2005)
%
% Note: if you are using Matlab version 6.x, you may wish to make
% one or more of the following modifications to this code:
% --uncomment line numbers 485 and 486 注释行号485和486
% --comment out line numbers 552 and 561 注释掉行号552和561
%
%***********************************************************************
clear
%***********************************************************************
% Fundamental constants 基本常数
%***********************************************************************
cc=2.99792458e8; %真空光速c
muz=4.0*pi*1.0e-7; %真空磁导系数 4pie-7
epsz=1.0/(cc*cc*muz); %真空介电常数 8.85e-12
etaz=sqrt(muz/epsz);
%***********************************************************************
% Material parameters 材料参数
%***********************************************************************
mur=1.0;
epsr=1.0;
eta=etaz*sqrt(mur/epsr);
%***********************************************************************
% Grid parameters 网格参数
%
% Each grid size variable name describes the number of sampled points 每个网格尺寸变量名称描述了一些采样点的
% Additionally, the variable names indicate the region of the grid 某一特定领域的组成部分的方向发展的组成部分。
% for a particular field component in the direction of that component.
% for which the dimension is relevant. For example, ie_tot is the 该方面的相关
% number of sample points of Ex along the x-axis in the total 例如, ie_tot是一些采样点的前沿X轴的总计算网格,
% computational grid, and jh_bc is the number of sample points of Hy 和jh_bc是一些采样点的海兰沿Y轴的Y染色体正常UPML地区。
% along the y-axis in the y-normal UPML regions.
%
%***********************************************************************
ie=41; % Size of main grid 大小的主要网格
je=17;
ke=16;
ih=ie+1;
jh=je+1;
kh=ke+1;
upml=10; % Thickness of PML boundaries 厚度的PML边界
ih_bc=upml+1;
jh_bc=upml+1;
kh_bc=upml+1;
ie_tot=ie+2*upml; % Size of total computational domain总规模计算域
je_tot=je+2*upml;
ke_tot=ke+2*upml;
ih_tot=ie_tot+1;
jh_tot=je_tot+1;
kh_tot=ke_tot+1;
is=round(ih_tot/2); % Location of z-directed current source位置的Z -指示电流源
js=round(jh_tot/2);
ks=round(ke_tot/2);
%***********************************************************************
% Fundamental grid parameters基本电网参数
%***********************************************************************
delta=0.002;
dt=delta*sqrt(epsr*mur)/(2.0*cc);
nmax=100;
%***********************************************************************
% Differentiated Gaussian pulse excitation有区别的高斯脉冲激励
%***********************************************************************
rtau=50.0e-12;
tau=rtau/dt;
ndelay=3*tau;
J0=-1.0*epsz;
%***********************************************************************
% Initialize field arrays初始化外地阵列
%***********************************************************************
ex=zeros(ie_tot,jh_tot,kh_tot);
ey=zeros(ih_tot,je_tot,kh_tot);
ez=zeros(ih_tot,jh_tot,ke_tot);
dx=zeros(ie_tot,jh_tot,kh_tot);
dy=zeros(ih_tot,je_tot,kh_tot);
dz=zeros(ih_tot,jh_tot,ke_tot);
hx=zeros(ih_tot,je_tot,ke_tot);
hy=zeros(ie_tot,jh_tot,ke_tot);
hz=zeros(ie_tot,je_tot,kh_tot);
bx=zeros(ih_tot,je_tot,ke_tot);
by=zeros(ie_tot,jh_tot,ke_tot);
bz=zeros(ie_tot,je_tot,kh_tot);
%***********************************************************************
% Initialize update coefficient arrays初始化更新系数阵列
%***********************************************************************
C1ex=zeros(size(ex));
C2ex=zeros(size(ex));
C3ex=zeros(size(ex));
C4ex=zeros(size(ex));
C5ex=zeros(size(ex));
C6ex=zeros(size(ex));
C1ey=zeros(size(ey));
C2ey=zeros(size(ey));
C3ey=zeros(size(ey));
C4ey=zeros(size(ey));
C5ey=zeros(size(ey));
C6ey=zeros(size(ey));
C1ez=zeros(size(ez));
C2ez=zeros(size(ez));
C3ez=zeros(size(ez));
C4ez=zeros(size(ez));
C5ez=zeros(size(ez));
C6ez=zeros(size(ez));
D1hx=zeros(size(hx));
D2hx=zeros(size(hx));
D3hx=zeros(size(hx));
D4hx=zeros(size(hx));
D5hx=zeros(size(hx));
D6hx=zeros(size(hx));
D1hy=zeros(size(hy));
D2hy=zeros(size(hy));
D3hy=zeros(size(hy));
D4hy=zeros(size(hy));
D5hy=zeros(size(hy));
D6hy=zeros(size(hy));
D1hz=zeros(size(hz));
D2hz=zeros(size(hz));
D3hz=zeros(size(hz));
D4hz=zeros(size(hz));
D5hz=zeros(size(hz));
D6hz=zeros(size(hz));
%***********************************************************************
% Update coefficients, as described in Section 7.8.2. 更新系数所描述的第7.8.2 。
% In order to simplify the update equations used in the time-stepping为了简化更新方程中所用的时间加强环
% loop, we implement UPML update equations throughout the entire 我们实施UPML更新方程在整个网格。
% grid. In the main grid, the electric-field update coefficients of 在主要的网格,电场更新系数的方程7.91af和相应的磁场更新系数
% Equations 7.91a-f and the correponding magnetic field update 提取方程7.89和七点九〇顷�
评论0