Chapter 5 - The FDTD Simulation Program

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

67

Chapter 5 The FDTD Simulation Program


5.1 Introduction
In this chapter the FDTD simulation program will be described in detail. The flow, the
dynamics and important algorithms of the FDTD simulation engine will be shown. The
source code for the program is included in a CD-ROM attached to this thesis. The
chapter begins by looking at syntax created to describe a three-dimensional model in
terms of cubes. The architecture of the FDTD simulation program is then explained. A
few sample simulation examples will be illustrated at the end of the chapter. More
simulation results will be shown in Chapter 7.
5.2 Building a Three-Dimensional (3D) Model from Cubes
In Section 4.2 it is shown how by combining dielectric cubes with conducting patches
on the top surface allows the construction of complicated metallic patterns on a PCB
surface. In addition to assigning conducting patch on the top surface of a cube, the
conducting patch can also be assigned to other faces of the cube. This would enable
complicated three-dimensional (3D) metallic structures to be constructed in addition to
planar metallic structures. Moreover each cube can be assigned some properties, which
include the dielectric constant of the cube, the nature of the dielectric such as (1) linear,
lossless, non-dispersive (2) linear, lossy, non-dispersive (3) linear, lossless and
dispersive etc. Combining and stacking these cubes can achieve a realistic 3D model of
a PCB assembly.
A three-dimensional model consists of many characteristics and elements. To
describe to the FDTD simulation program the nature of the model, obviously a
computer file with certain syntax is required. A syntax is developed in this thesis and
the file describing the model is called a Model Definition File (MDF). The MDF is a
text file, consisting of lines of text which describe the properties of a single cube, or a
collection of cubes, for all cubes in the 3D model. There are five important keywords in
68
the syntax. A brief account of the keywords is given below. The FDTD program is not
case sensitive.
Keyword: Cube
Function
Specifies the characteristics of a single cube.
Syntax
cube X Y Z Er Sigma D N [parameter list..]
X = Position of the cube along x-axis.
Y = Position of the cube along y-axis.
Z = Position of the cube along z-axis.
Er = The dielectric constant of the cube.
Sigma = The conductivity of the cube.
D = Cube characteristic (from 0-255), i.e. whether it is a lossless dielectric (0), lossy
dielectric (1), linearly dispersive (2) etc (At present only 0 and 1 are used).
N = Cube surface characteristic (from 0 to 255). This specifies whether the cube has
any PEC conducting patches on its surface and the shape of the conducting patches.
Figure 5.1 shows a list of conducting patches with the corresponding value for N (At
present only 0 to 21 are used).
[parameter list] = A list of optional parameters (In this version it is not used).
Example
cube 5 8 9 4.2 0 0 0
cube 4 5 10 2.7 100.0 1 1
This first line declares a cube at (i,j,k) = (5,8,9) with dielectric constant
r
= 4.2, zero
conductivity. This cube is a lossless dielectric (D = 0) with no surface conductor (N =
0). The second line specifies a cube at location (4,5,10) with dielectric constant
r
= 2.7
and conductivity = 100.0. This cube has a perfect conducting plane on face 1 (N=1,
remember a cube has six surfaces) and is lossy (D = 1) since the conductivity is
69
nonzero. If we set D = 0 in line 2, then the conductivity will be ignored and the cube is
assumed lossless. It is envisaged that in future, the parameter list feature of the cube
keyword will allows the description of dispersive and nonlinear dielectric. For example
the list could contain a description of the poles and zeros of the frequency response of a
linear dispersive dielectric.
Figure 5.1 PEC conducting patches on cube surface.
N=0 N=1
N=2
N=3 N=4
N=5 N=6
N=7 N=8
N=9
N=10
N=11
N=12
N=13
N=14
N=15
N=16
N=17
N=18
N=19
N=20
N=21
x
y
z
PEC area
70
Keyword: Region
Function
Specifies the characteristics for a range or a collection of cubes. This keyword is useful
when we have to declare the characteristics for a number of cubes that are adjacent to
each other. Instead of using a multitude of cube lines, we could simply use a single
line with the region keyword. The usage of region keyword is almost similar to the
cube keyword except the position of two cubes which form the end-points of the
three-dimensional region must be specified. All the cubes within the enclosure of these
end-points will be assigned the same characteristics. This concept is illustrated in
Figure 5.2.
Syntax
region X1 Y1 Z1 X2 Y2 Z2 Er Sigma D N [parameter list..]
X1 = Position of the first cube along x-axis.
Y1 = Position of the first cube along y-axis.
Z1 = Position of the first cube along z-axis.
X2 = Position of the second cube along x-axis.
Y2 = Position of the second cube along y-axis.
Z2 = Position of the second cube along z-axis.
Er = The dielectric constant of the the range cube.
Sigma = The conductivity of the cube.
D = Cube characteristic (from 0-255), i.e. whether it is a lossless dielectric (0), lossy
dielectric (1), linearly dispersive (2) etc (In this version only 0 and 1 are used).
N = Cube characteristic (from 0 to 255). Same as N for keyword cube.
[parameter list] = A list of optional parameters (In this version it is not used).
71
Figure 5.2 The end-points of a region.
Example
region 1 1 2 5 8 9 4.2 0 0 0
region 2 3 4 10 15 16 2.7 0 0 1
This first line declares a range of cubes in a region delimited by Cube (1,1,2) and Cube
(5,8,9) with dielectric constant
r
= 4.2. These cubes are lossless dielectric (D = 0), with
no surface conducting patch (N = 0). The second line specifies a range of cube
delimited by Cube (2,3,4) and Cube (10,15,16) with dielectric constant
r
= 2.7. These
cubes have a perfect conducting plane on face 1 (N = 1, remember a cube has six
surfaces). Again the cubes are lossless dielectric (D = 0).
Keyword: Probe
Function
Specifies which field components to print out on the output file, and in what format.
Syntax
probe X Y Z Field
Field = ex, ey, ez, hx, hy, hz for x, y and z components of electric and magnetic fields.
X = Position of the field along x-axis.
Y = Position of the field along y-axis.
Z = Position of the field along z-axis.
Cube (X
1
, Y
1
, Z
1
)
Cube (X
2
, Y
2
, Z
2
)
Cube (X
1
, Y
1
, Z
1
)
Cube (X
2
, Y
2
, Z
2
)
Or
72
Example
probe 5 8 7 ez
The example constitutes an instruction to the FDTD simulation program to output field
component
n
x
E
) 7 , 8 , 5 (
to the output data file. Actually the probe features supported by
the FDTD simulation program in this thesis is much more powerful than this. There are
numerous modes for probe which is not discussed here. For more information please
refer to the online help of the FDTD simulation program.
Keyword: Comp
Function
Specifies a lumped component in the FDTD spatial grid. The component is assumed to
coincide with the electric field component.
Syntax
comp X Y Z Field Type Ref [parameter list..]
X = Position of the field along x-axis.
Y = Position of the field along y-axis.
Z = Position of the field along z-axis.
Field = ex, ey or ez corresponding to x, y or z components of the electric field.
Type = The type of components. For instance 100 represents a resistor, 101 represents
a capacitor and 200 represents an inductor. For a complete up to date list of the
description of each individual component, please refer to Appendix 7.
[parameter list] = a list of optional parameters.
Ref = The parameter list reference. The user has the choice of adding the component
parameter list immediately after the component declaration, or having the parameter list
declared elsewhere in the MDF file. The parameter list reference is used to locate the
correct parameter list for the component. It is an integer. When the parameter list
immediately trails the component declaration, the reference is assigned a value of zero.
73
Example
comp 5 5 4 ez 50 0 48 0 3.3 30 100 300 500
comp 6 8 4 ex 100 0 50
comp 10 10 7 ey 1 0
The first line defines a component of the type resistive voltage source (Type=50) at the
location of field component
n
z
E
) 4 , 5 , 5 (
. For Type = 50 the voltage source is a trapezoidal
pulse generator. The optional parameters [48,0,3.3,50,30,100,300,500] fix the
resistance of the voltage source resistance at 48Ohm, the low voltage level at 0, the high
voltage level at 3.3V, delay of 30 picoseconds, the rise/fall time at 100.0 picoseconds,
output-high period of 300.0 picoseconds, output-low periods of 500.0 picoseconds. The
second line declares a component of type resistor (Type = 100) at the location of field
component
n
x
E
) 4 , 8 , 6 (
. The resistance is 50Ohm. The last line declares a short perfect
conducting wire (Type = 1) in the location of field component
n
y
E
) 7 , 10 , 10 (
. No
parameter is required for this component. The full details of each component, including
the parameters format are provided in Appendix 7.
Keyword: Param
Function
Specifies a parameter list. This is useful when many components or cubes share similar
parameter list.
Syntax
param Ref [parameter list..]
Ref = An integer to identify the parameter list.
Parameter list = A sequence of real values such as 2.978, 11.54E-09 and 0.5 separated
by space or tab.
74
Examples
For instance we have 3 positive y-oriented diodes. The parameters of the diode are
similar to those listed in Section 4.4 (see Appendix 7 for more details). This would
normally be defined as:
comp 7 45 5 ey 150 0 1 (2.682E-09 1.836 0.5 0.333 4.0E-12 11.54E-09 0.5)
comp 8 45 5 ey 150 0 1 (2.682E-09 1.836 0.5 0.333 4.0E-12 11.54E-09 0.5)
comp 9 45 5 ey 150 0 1 (2.682E-09 1.836 0.5 0.333 4.0E-12 11.54E-09 0.5)
The brackets in the above example are optional, using brackets adds clarity to the
declaration. The characters ( and ) will be ignored by the FDTD simulation program
when the MDF file is read. If the parameters of the diodes are similar, we could also
write the above statements as:
comp 7 45 5 ey 150 10
comp 8 45 5 ey 150 10
comp 9 45 5 ey 150 10
param 10 (1 2.682E-09 1.836 0.5 0.333 4.0E-12 11.54E-09 0.5)
In the second example the identification for the parameter list is 10. All 3 diode
declarations refer to the same parameter listing. This capability is only applied to
comp keyword. Again note that the brackets in the param declaration are optional.
Keyword: *
Function
Specifies that the characters that follow * are just comments.
Example
* This is a comment
A very simple MDF file listing is shown in Example 5.1. The MDF content of Example
5.1 describes the physical model illustrated in Figure 5.3. The corresponding electrical
75
schematic is shown in Figure 5.4. Figure 5.3 shows a short length of microstrip line, on
a PCB with linear, lossless and non-dispersive dielectric with 2 . 4 =
r
. The thickness
of the PCB is equivalent to three cubes. On one end of the microstrip line there is a
resistive voltage source with R
s
= 50. The other end of the microstrip line is
terminated with a 50 lumped resistor. The detailed connection of the resistive voltage
source and lumped resistive termination is shown in Figure 5.5. Notice that in Figure
5.3 there should be a few layers of buffer cubes between the region of interest and the
boundaries of the model as mentioned in Section 3.4. This is because the Murs
Absorbing Boundary Condition (ABC) works best when the incident numerical wave is
almost normal to the boundary. Usually a minimum of five cubes between the
boundary and the nearest conductor is required. The recommended number of buffer
cubes is ten. No buffer cubes are required for the ground plane as it covers the whole of
the bottom face of the model boundary.

Figure 5.3 Top view and front view of a simple model.
y
x
Top view of the model
Front view of the model
Resistive voltage
source
Resistive
termination
A
B
x
z
Bottom ABC
Top ABC
Layers of buffer cubes
Region of interest
Layers of buffer cubes
Left
ABC
Right
ABC
Ground plane
Microstrip line
PCB
dielectric
air
76
Figure 5.4 The electrical schematic of the model of Figure 5.3.
Figure 5.5 End-points of the microstrip line.
Example 5.1 Model Definition File for the model shown in Figure 5.1
16 35 11
* ### Begins model definition ###
* --- PCB dielectric definition ---
* The dielectric of the PCB is linear and lossless
region 1 1 3 16 35 4 4.2 0 0 0
* --- PCB ground plane ---
x
z
Ground planes
PEC wires
At end-point A At end-point B
Resistive voltage
source
Resistive termination
77
region 1 1 2 16 35 2 4.2 0 0 5
* --- Microstrip line ---
region 7 6 4 10 28 4 4.2 0 0 6
* --- termination ---
comp 9 29 4 ez 100 0 50
comp 9 29 3 ez 1 0
comp 9 29 2 ez 1 0
* --- source definition ---
* pulsed voltage source
comp 9 6 4 ez 50 1
comp 9 6 3 ez 1 0
comp 9 6 2 ez 1 0
* --- definition components to probe ---
probe 9 6 4 ez
probe 9 29 4 ez
* --- parameter declaration ---
* This corresponds to 50Ohm source resistance, Vlow=0, Vhigh=3V
* Tdelay=0, Trise/fall=50ps, Thigh=100ps and Tlow=200ps
param 1 (50 0 3 0 50 100 200)
* ### End of File ###
The first line in Example 5.1 declares that the size of this model is 16 cubes
along x-axis ( 16 =
x
n ), 35 cubes along y-axis ( 35 =
y
n ) and 11 cubes along z-axis
( 11 =
z
n ). The location of Cube (1,1,1), Cube (1,1,16), Cube (1,35,1) etc. follows the
convention shown in Figure 3.8. The size of each cube ( z y x , , ) is not declared in
the MDF file, but will be defined in the software together with t . Typically for a FR4
double-sided PCB (a PCB with copper layers on the top and bottom sides sandwiching a
glass-epoxy material called FR4), the size of each cube is fixed as:
mm 52 . 0 mm, 75 . 0 mm, 8 . 0 = = = z y x
78
Every line beginning with the keyword * is a comment and will be ignored. The first
line describing the model is:
region 1 1 3 16 35 4 4.2 0 0 0
This describes a range of cubes enclosed by the end-cubes (1,1,3) and (16,35,4), with
lossless, linear and non-dispersive dielectric (D = 0),
r
= 4.2 and no PEC conducting
patches on the cube faces (N = 0). Essentially this line defines the dielectric of the
PCB. In a similar manner the other two lines with region keywords define the
microstrip line and ground plane respectively. In case of overlapping, the latest
region, cube or comp declaration will override the previous declarations. The
lines with comp keywords define all the lumped components used in the model. As
can be seen all the lumped components coincide with E
z
field components. The
resistive voltage source can be declared as:
comp 9 6 4 ez 50 1
* Tdelay=0, Trise/fall=50ps, Thigh=100ps and Tlow=200ps
param 1 (50 0 3 0 50 100 200)
where the parameters are defined in another statement, or:
* Tdelay=0, Trise/fall=50ps, Thigh=100ps and Tlow=200ps
comp 9 6 4 ez 50 0 50 0 3 0 50 100 200
where the parameters list immediately trails the component declaration. The probe
lines request that the values of field components
n
z
E
) 4 , 6 , 9 (
and
n
z
E
) 4 , 29 , 9 (
are to be saved
in an output data file during execution of the FDTD simulation program at specific
interval of time-steps. Again the user can set this interval. These two field components
correspond to the E field across the lumped resistive voltage source and the lumped
resistor respectively. By multiplying these field components with z , we could obtain
an estimate of the voltage across the lumped components (assuming that quasi-TEM
mode electromagnetic field is propagating in the model).
79
5.3 The FDTD Simulation Engine An Overview
The basic simulation engine is divided into two modules: the interface to the
Windows operating system and the actual simulation engine. This is shown in Figure
5.6. In this chapter only an overview of the program will be given. Emphasis is on the
concepts of organizing the data in the program systematically so that many types of
condition can be modeled. The actual source code for the complete software contains
more than 10,000 lines of codes and is included with the accompanying CD-ROM.
Figure 5.6 Major software blocks for the FDTD simulation program.
The Windows Interface Block is coded in C Language (Microsoft MSDN), as
there are many standard templates for creating a Windows based program in C. The
FDTD Simulation Engine is coded in C++ Language with future upgrade and expansion
in mind. Using object-oriented programming language approach such as C++ allows
efficient code reuse and project management (Horton 1998, Murray and Pappas, 1996).
Standard C++ syntaxs complying with ANSI (American National Standard Institute)
Windows Interface Module
Routines to create a Windows based
application.
Handle user interface such as dialog
boxes, menu, mouse, keyboard etc.
Read and parse input files.
Set up all the datatypes and variables in
the program.
Print output results.
Coded in C.
FDTD Simulation Engine
Preprocessing and determining
computation coefficients.
Perform E and H fields update.
Enforce boundary condition.
Coded using object-oriented
language C++.
Can be ported to other
platforms such as UNIX or
LINUX.
Input file (MDF) Output Files
Simulation
results
Instructions
and settings
for simulation
80
are used, thus ensuring that the FDTD Simulation Engine can be compiled and run in
other platforms such as UNIX or LINUX.
The output of the software contains two files, an output file (data.out) containing
the electric field or magnetic field components and a header file (data.hdr) containing a
listing of the field components plotted out in the output file. The data.out file is stored
in binary format as this saves space while the data.hdr file is stored in text format.
Thus visualizing software is required to view the output file. Software such as
MATLAB

or MATHCAD

is employed in visualizing the output file.


5.3.1 Software Flow
Figure 5.7 shows the high-level flow of the FDTD Simulation Engine module. The
flow is typical of an FDTD algorithm except for the initialization part.
81
Figure 5.7 Computation flow of the FDTD program.
Create entry based on
lumped components
Assign computational mode
based on surface
characteristics of cubes
Assign computational mode
based on dielectric
characteristics of cubes
Create entry based on cubes
Standard
FDTD routines
End of iteration?
Update H field components
in field object
Update E field components
in field object
Initialize field objects
Parse input file
Start
Initialize cube object
Print output data
Yes
End
Update Boundary E fields
Set up computation
coefficient look-up table
No
82
There are more steps in the initialization portion as compared to the basic flow
of Figure 3.9 as the FDTD simulation engine needs to accommodate different types of
elements with various update functions. Furthermore frequently used values are pre-
computed and stored as computational coefficients. A system is therefore needed to
track the location of each coefficient. The following sections will attempt to provide in
more details the key components of the software flow.
5.3.2 Pre-Computation and Look-up Table
In order to hasten the update of all electric and magnetic field components, regularly
used expressions are pre-computed and stored in a look-up table. Each look-up table
can be implemented as a two dimensional array of floating point values. The row index
to the array corresponds to a certain update mode. An example will help to clarify the
idea. The update equation for E
x
field component, in an isotropic region with linear,
lossless dielectric is repeated here again:

+ =
+

+
2
1
2
1
2
1
2
1
) 1 , , ( ) , , ( ) , 1 , ( ) , , ( ) , , (
1
) , , (
n
k j i y
n
k j i y z
t
n
k j i z
n
k j i z y
t n
k j i x
n
k j i x
H H H H E E

(5.3.1a)
This can be written as:

+ =
+

+ +

+
+
2
1
2
1
2
1
2
1
) 1 , , ( ) , , (
1
) , 1 , ( ) , , (
0
) , , (
1
) , , (

n
k j i y
n
k j i y
X
n
k j i z
n
k j i z
X
n
k j i x
n
k j i x
H H C H H C E E (5.3.1b)
where
z
t
X
y
t
X
C C

= =

1 0
, (5.3.2)
The computation coefficients C
0X
and C
1X
are frequently used as other E field
components in similar dielectric will use similar update function too. These coefficients
are stored in a two-dimensional array and assigned a certain row index, for example row
r. Hence all E
x
computations that share similar update form as Equation (5.3.1a) and
similar dielectric constant will use the computation coefficients C
0X
and C
1X
stored in
row r of the array. The computation coefficients will be different for E
x
in region of
different dielectric constant . Another row entry will have to be created for that
particular region. Sometimes the update form also varies, for instance when E
x
83
component coincide with a lumped resistor of resistance R Ohms, the update equation
will be given by (4.3.4), which is repeated here again:
( )
( ) z y R
x
X
n
k j i y
n
k j i y z C
t
n
k j i z
n
k j i z y C
t n
k j i x C
C
n
k j i x
C H H
H H E E
X
X X
X

+
+

+
+

]
]
]

]
]
]

+
,
`

.
|

,
2
1
2
1
2
1
2
1
) 1 , , ( ) , , ( 1
) , 1 , ( ) , , ( 1 ) , , ( 1
1
1
) , , (

(5.3.3)
In this case the computation coefficients will be:
( ) ( ) z
X
C
t
X
y
X
C
t
X
X
C
X
C
X
C C C
+


1
2
1
1
1
1
0
, ,

(5.3.4)
In this software, the actual computation coefficient table is implemented as an
array of structures instead of a two-dimensional floating-point array (note: the structure
here is a form of datatype in C/C++ Language). Each field component, E
x
, E
y
, E
z
, H
x
,
H
y
, H
z
has its own look-up table. The structures are named stCCEx, stCCEy, stCCEz,
stCCHx, stCCHy and stCCHz. Each structure contains ten double type variables fC0 to
fC9, a char type variable umode and a void pointer plist. For example the look-up table
for E
x
field components would look like this:
stCCEx[0]
stCCEx[1]
stCCEx[2]
stCCEx[m-1]
stCCEx[m]
fC0 fC1 fC2 fC9 umode plist
stCCEx[1]
value
next
value
next
value
next
NULL
value
next
Optional linked-list
Computational Coefficients
Look-up Table for E
x
84
Figure 5.8 Computational coefficients look-up table for E
x
field components.
Each entry stCCEx[i] can store up to ten coefficients. The variable umode is an
8-bit unsigned integer (known as char datatype in C/C++) used to identify the type of
lumped element associated with the E
x
field component using these coefficients. For
instance umode = 0 means the E
x
field is in a linear, lossless and non-dispersive
dielectric, umode = 100 means the E
x
field component coincide with a lumped resistor
and so forth. The values assigned to umode are the same as that used to differentiate
various lumped components as given in Appendix 7. The void pointer plist can point to
a linked-list (Murray and Pappas, 1996). This is used when the ten variables fC0 - fC9
are not sufficient to store the computation coefficients, and extra memory locations are
needed. The linked-list provides a mechanism of variable length storage. It will be
asked why not do away with fC0 - fC9, having just plist and umode. The reason is
retrieving information from a linked-list is computationally slower and more
cumbersome than directly reading from an array. To access fC2 in stCCEx[1], the
following statement is used: stCCEx[1].fC2. To access the third elements in the linked-
list, we have to access the first element, then the second and finally the third in a
sequential manner (Murray and Pappas, 1996). Most update functions for E and H field
components usually do not require so many coefficients, so having ten variables in the
structure and the rest in an optional linked-list provide a compromise between computer
memory requirement and speed.
5.3.3 Other Important Objects in the Simulation Engine
In the parlance of object-oriented programming, there is no variable or datatype.
Instead there are only objects or class as it is called in C++ (Horton 1998, Murray &
Pappas 1996). Each object consist of a number of members, which can be a data
storage element such as integer, floating-point (float), long floating-point (double),
character (char), structures etc. or functions. The functions within an object are known
as methods. The members of an object have different visibility scope, some members
are accessible by functions outside of the object, while others are only accessible by
other members within the object. An object can be inherited by other objects, making
85
all its member data and functions available to the child object. The inherited object is
usually called the parent object. During program execution all active objects will reside
in the computer memory.
A number of objects are declared for the FDTD Simulation Engine. Among the
more important objects are the electric field object (tEfield), magnetic field object
(tHfield) and Absorbing Boundary Condition object (tABC). The electric field object
contains the variables to store all the E field components in the model. Similarly the
magnetic field object contains the variables to store all H field components in the
model. The Absorbing Boundary Condition object contains some variables and
functions for updating the E fields tangential to the model boundary. These three are
the base objects, sometimes also called the parent objects. A child object, the FDTD
field object (tEHfdtd) inherits both tEfield and tHfield objects. There is also another
object, the cube object (tCube) which is used during the initialization stage and for
creating the computation coefficient look-up table. The cube object tCube is used to
store the characteristics of every cube in the model as the MDF file is read and parsed.
Information contained in tCube is then used to assist in constructing the look-up table
depicted in Figure 5.8 for E and H field components. The object tCube will be removed
from the computer memory once initialization is completed. The details of each object
or class are defined in the header file fdtd_class.h in the CD-ROM.
Figure 5.9 Various objects declared in the FDTD simulation engine.
tEfield tHfield tCube tABC
tEHfdtd
86
Associated with each field component are three variables. A char variable to
specify the update mode for the field such as Equations (5.3.1a) or (5.3.3), another char
variable specifies the row index for the associated computation coefficients look-up
table, and lastly a double variable to store the current value of the field component.
Figure 5.10 illustrates this concept for E
x
and H
x
components. In Figure 5.10,
uparamex and uparamhx are the variables associated with the row index of the look-up
tables for E
x
and H
x
field respectively. The variables umodex and umodhx are
associated with the update mode. Lastly the current values for the fields are stored in
fEx and fHx. All these variables are contained in tEfield and tHfield objects.
Figure 5.10 Three data storage locations are needed for each field component.
Since the tEfield object contains storage locations for all E field components, it
has three-dimensional arrays of the variables uparamex, umodex and fEx for E
x.
Of the
three variables, only fEx is accessible by external functions. Variables uparamex and
umodex are private to the tEfield and can only be accessed by methods declared within
the object. This is known as encapsulation in object-oriented programming. It serves to
provide transparency to external functions and prevent accidental modification of
important variable, reducing the chances of programming bug. Another two similar sets
of arrays have also been declared in tEfield for E
y
and E
z
. The same can be said for
tHfield, where nine three-dimensional arrays are declared for H
x
, H
y
and H
z
. The
tEHfdtd object inherits both tEfield and tHfield objects. It also introduces all functions
required to update E and H field components under various modes. This relationship is
shown in Figure 5.11.
fEx
umodex
uparamex
E
x
fHx
umodhx
uparamhx
H
x
87
Figure 5.11 Relationship between tEHfdtd, tEfield and tHfield.
Finally, Figure 5.12 illustrates the details of a typical field component update
sequence. This example is for E
x
field components. Figure 5.13 shows the state
diagram for creating the computation coefficient look-up table for E
x
field components
during the initialization stages. The procedures shown in Figure 5.12 and Figure 5.13
are then repeated for E
y
, E
z
, H
x
, H
y
and H
z
field components. There are also other
objects or data structures not described by this short discussion. This includes a linked-
list to store the information for field components to probe or save to the output file,
and a linked-list for storing the information for various lumped components.
Object tEfield
uparamex[ ][ ][ ]
uparamey[ ][ ][ ]
uparamez[ ][ ][ ]
umodex[ ][ ][ ]
umodey[ ][ ][ ]
umodez[ ][ ][ ]
fEx[ ][ ][ ]
fEy[ ][ ][ ]
fEz[ ][ ][ ]
Functions to read values stored
in umode and uparam
Functions to change values
stored in umode and uparam.
Function to initialize all
variables.
Object tHfield
uparamhx[ ][ ][ ]
uparamhy[ ][ ][ ]
uparamhz[ ][ ][ ]
umodhx[ ][ ][ ]
umodhy[ ][ ][ ]
umodhz[ ][ ][ ]
fHx[ ][ ][ ]
fHy[ ][ ][ ]
fHz[ ][ ][ ]
Functions to read values stored
in umode and uparam
Functions to change values
stored in umode and uparam.
Function to initialize all
variables.
Functions to update E field components
Functions to update H field components
Object tEHfdtd
88
Figure 5.12 Update E field component sequence, as seen for E
x
component.
Access
coefficients based
on uparamex
Check umodex
Update E
x
n+1
using Equation
(1)
Update E
x
n+1
using Equation
(2)
Update E
x
n+1
using Equation
(3)
Sample E field update functions
Update H field components
in field object
Update E field components
in field object
Update Boundary E fields
( )
( )
( )
( )
:
:

: (3) Equation
0
: (2) Equation

: (1) Equation
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
) 1 , , ( ) , , (
1
) , 1 , ( ) , , (
1
) , , (
1
) , , (
1
) , , (
) 1 , , ( ) , , (
) , 1 , ( ) , , ( ) , , (
1
) , , (

+ =
=

+ =
+

+
+

+
+
+
+
+

n
k j i y
n
k j i y
z
t
n
k j i z
n
k j i z
y
t n
k j i x
n
k j i x
n
k j i x
n
k j i y
n
k j i y z
t
n
k j i z
n
k j i z y
t n
k j i x
n
k j i x
H H
H H E E
E
H H
H H E E
z y
z C
z y
z C

fC0 fC1 fC2 umode

pList
stCCEx[0]
Computation Coefficient Look-up Table for E
x
fC0 fC1 fC2 umode

pList
stCCEx[1]
fC0 fC1 fC2 umode

pList
stCCEx[2]
fC0 fC1 fC2 umode

pList
stCCEx[m]
From
Figure 5.7
89
Figure 5.13 State diagram for creating computational coefficient look-up table for E
x
field components.
Start
Assign
r
and for
) 1 , 1 , 1 ( x
E ,
AssignEpsilonSigma( ) is called.
Create entry in stCCEx[ ] based on update mode
for
) 1 , 1 , 1 ( x
E , CreateExConstEntry( ) is called.
Update auxiliary look-up table stCEAx[ ].
Create entry for E
x
component which coincide
with perfect electric conductor (PEC).
Update auxiliary look-up table stCEAx[ ].
Assign
r
and for next E
x
component
Compare
r
, and
umode of
) , , ( k j i x
E with
entry in stCEAx[ ]
Set uparamx of
) , , ( k j i x
E to
current index
Next entry in stCEAx[ ]
End of E
x
field
components ?
Create new entry in stCCEx[ ] ,
(call CreateExConstEntry( ) )
Update stCEAx[ ]
End
Yes
Set uparamx of
) , , ( k j i x
E to 1
No
Not equal
Equal
End of entry
in stCEAx[ ]
umode = 1
Note:
stCEAx is needed because values of
r
and
are embedded in the computation
coefficients. It is difficult to extract these
values from the coefficients.
stCEAx[ ]
stCCEx[ ]
stCCEx[ ] is the computation coefficient look-up table for E
x
field components.
stCEAx[ ] is a local auxialiary table, it is used to store the all the different sets
of
r
, and umode for comparison. stCCEx[ ] and stCEAx[ ] share similar row
index.
90
5.4 The Complete Package
The complete FDTD simulation package developed for this thesis consists of three
separate programs.
1. The FDTD simulation engine called winFDTD which is described in details in
Section 5.3.
2. A utility called winFDTD_draw which is a program for the user to draw the three-
dimensional model layer-by-layer. The program then generates the model definition
file (MDF) automatically. Thus the user has the option of defining the model by
creating the model definition file using a text editor, or through the
winFDTD_draw utility.
3. A simple utility called Plot, to plot either the field components, or the equivalent
voltages and currents. This program is embedded with the interface of the FDTD
simulation engine.
Both winFDTD_draw and Plot are also Windows based programs that are created
using the programming language Visual Basic 6.0 by Microsoft Corp. The details will
not be described, as these are merely helper programs. The source codes for
winFDTD_draw and Plot are also included in the CD-ROM attached to this thesis.
A tutorial for using winFDTD, winFDTD_draw and Plot is included in Appendix
8. Figure 5.14 shows the screen shots of the three programs.
91

Figure 5.14 Screen shots of winFDTD, winFDTD_draw and Plot.
FDTD simulation engine
winFDTD_draw
Plot
92
5.5 Sample Simulation Examples
Transmission Line Loaded with Series RL Impedance
The first simulation example shows a resistive voltage source driving a short length of
transmission line with a series RL load. The schematic and top view of the model are
shown in Figure 5.15a while Figure 5.15b shows the side view of the model. V
s
is a
trapezoidal pulse source, with rise/fall time of 200ps, amplitude of 3.3V, high period of
600ps and low period of 1000ps. Transmission line T
1
is a lossles microstrip line, it is
designed to have a characteristic impedance of 50, and propagation delay of 150ps.
The printed circuit board (PCB) is assumed to be linear, lossless with 2 . 4 =
r
.
Thickness of the PCB is three cells along the z-axis. A PEC conducting plane covers
the bottom of the PCB. At the top and four sides of the model, Murs first order
absorbing boundary condition is employed.

Figure 5.15a Schematic and the view of the model at k = 4 ( z z = 4 ).
Z
c
= 50
T
d
= 150ps
V
in
V
L
x = 0.7mm
y = 0.8mm
z = 0.52mm
t = 1ps
16 cells along x-axis
45 cells along y-axis
13 cells along z-axis
y
x
Lumped
inductor
Lumped
resistor
Resistive voltage
source along z-axis
Murs
first
order
ABCs
PEC Conductor
Microstrip line
93
Figure 5.15b Side view of the model.
The simulation results are shown in Figure 5.16a and Figure 5.16b respectively.
The effective voltages are obtained by performing a numerical line integration of the
corresponding E field components. For instance the lumped resistor R
L
coincides with
) 5 , 37 , 9 ( y
E and the lumped inductor L
L
conincides with
) 5 , 34 , 9 ( y
E . Thus the effective
voltage across the series RL load can be computed as:
( )
n
y
n
y
n
L
E E y N V
) 5 , 34 , 9 ( ) 5 , 37 , 9 (
+ = (5.5.1)
where N = -1 because positive current flows in positive y direction. Similarly the
voltage across the resistive voltage source can be computed as:
n
z
n
in
zE N V
) 4 , 7 , 9 (
= (5.5.2)
where N = 1 because positive current flows in negative z direction. For the sake of
comparison, the schematic of Figure 5.15a is also implemented in PSPICE circuit
simulator and the results are superimposed on the FDTD results in Figure 5.16a and
Figure 5.16b.
y
z
Resistive
voltage
source
PEC wires
to model
vias
Lumped
inductor
Lumped
resistor
PCB
Microstrip line
94
0 1000 2000 3000 4000 5000 6000
1
0
1
2
3
V2
n
V3
n
n Int
Figure 5.16a The effective voltage across the resistive voltage source.
0 1000 2000 3000 4000 5000 6000
1
0
1
2
3
V1
n
V4
n
n Int
Figure 5.16b The effective voltage across the series RL load.
V
in
FDTD
PSPICE
ps
V
L
FDTD
PSPICE
ps
95
Crosstalk Simulation
The second example is a simulation of electromagnetic coupling between two adjacent
microstrip lines. This is the classical crosstalk simulation. The schematic and top view
of the model are shown in Figure 5.17a. The discretization of the model domain and the
printed circuit board characteristics are similar to the first example. In the schematic,
both the active and passive transmission lines are terminated with its own characteristic
impedance of 50.
Figure 5.17a Top view of the model at k = 4 ( z z = 4 ).
V
s
is a trapezoidal pulse source, with rise/fall time of 200ps, amplitude of 3.3V,
high period of 600ps and low period of 1000ps. As the electromagnetic energy from V
s
travels along the active transmission line, energy is also coupled to the passive
transmission line via electric and magnetic field coupling. The coupled electromagnetic
energy appears as voltages across the source and load end of the passive transmission
line. These voltages are known as Near-End Crosstalk (NEXT) and Far-End Crosstalk
x = 0.7mm
y = 0.8mm
z = 0.52mm
t = 1ps
21 cells along x-axis
51 cells along y-axis
13 cells along z-axis
V
1 V
2
V
3
V
4
50
50
50
50
Active microstrip line
Passive microstrip line
V
s
Active line
Passive line
x
y
Source
end
Load
end
96
(FEXT) respectively in the literature (Blood 1980, Johnson and Graham, 1993). The
result of the simulation is shown in Figure 5.17b.
0 1000 2000 3000 4000 5000 6000
0.5
0
0.5
1
1.5
2
V1
n
V2
n
V3
n
V4
n
n Int
Figure 5.17b Voltages on the source and load ends of the active and passive
transmission lines.
As observed in Figure 5.17b, crosstalk only occurs when there is a transition of
the electrical signal on the active transmission line. The effect of crosstalk can be
modeled by assuming the existence distributed mutual inductance and capacitance
between the two transmission lines under quasi-static approximation. As the changing
electrical pulse travels along the active transmission line, energy is coupled into the
passive line via the distributed mutual inductance and capacitance. The coupled energy
propagates in both directions on the passive transmission line, resulting in near-end and
far-end crosstalk voltages (Blood 1980).
ps
V
1
V
2
V
3
V
4
Near-End Crosstalk (V
3
)
Far-End Crosstalk (V
4
)
Source pulse (V
1
)
Delay of tranmission line
V
2

You might also like