+ All Categories
Home > Documents > Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

Date post: 17-Feb-2022
Category:
Upload: others
View: 3 times
Download: 0 times
Share this document with a friend
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
Transcript
Page 1: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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

Page 2: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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

Page 3: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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=21x

y

z

PEC area

Page 4: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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).

Page 5: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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 (X1, Y1, Z1)

Cube (X2, Y2, Z2)

Cube (X1, Y1, Z1)

Cube (X2, Y2, Z2)

Or

Page 6: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

72

Example

probe 5 8 7 ez

The example constitutes an instruction to the FDTD simulation program to output field

component nxE )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.

Page 7: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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 nzE )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 nxE )4,8,6( . The resistance is 50Ohm. The last line declares a short perfect

conducting wire (Type = 1) in the location of field component nyE )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.

Page 8: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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

Page 9: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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 Rs = 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 Mur’s

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

xTop view of the model

Front view of the modelResistive voltagesource

Resistivetermination

A

B

x

z

Bottom ABC

Top ABC

Layers of buffer cubes

Region of interest

Layers of buffer cubes

LeftABC

RightABCGround plane

Microstrip line

PCBdielectric

air

Page 10: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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 voltagesource

Resistive termination

Page 11: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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=xn ), 35 cubes along y-axis ( 35=yn ) and 11 cubes along z-axis

( 11=zn ). 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 ( zyx ∆∆∆ , , ) 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:

mm52.0 mm,75.0 mm,8.0 =∆=∆=∆ zyx

Page 12: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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 Ez 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 nzE )4,6,9( and n

zE )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).

Page 13: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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++ syntax’s complying with ANSI (American National Standard Institute)

Windows Interface Module

• Routines to create a Windows basedapplication.

• Handle user interface such as dialogboxes, 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 determiningcomputation 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 orLINUX.

Input file (MDF) Output Files

Simulationresults

Instructionsand settingsfor simulation

Page 14: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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.

Page 15: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

81

Figure 5.7 – Computation flow of the FDTD program.

Create entry based onlumped components

Assign computational modebased on surfacecharacteristics of cubes

Assign computational modebased on dielectriccharacteristics of cubes

Create entry based on cubes

StandardFDTD routines

End of iteration?

Update H field componentsin field object

Update E field componentsin field object

Initialize field objects

Parse input file

Start

Initialize cube object

Print output data

Yes

End

Update Boundary E fields

Set up computationcoefficient look-up table

No

Page 16: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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 Ex field component, in an isotropic region with linear,

lossless dielectric is repeated here again:

−−

−+=

+−

+∆∆+

−+

∆∆+ 2

121

21

21

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

),,(n

kjiyn

kjiyztn

kjizn

kjizytn

kjixn

kjix HHHHEE εε (5.3.1a)

This can be written as:

−−

−+=

+−

++−

++ 21

21

21

21

)1,,(),,(1),1,(),,(0),,(1

),,( n

kjiyn

kjiyXn

kjizn

kjizXn

kjixn

kjix HHCHHCEE (5.3.1b)

where

zt

Xyt

X CC ∆∆

∆∆ == εε 10 , (5.3.2)

The computation coefficients C0X and C1X 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 Ex computations that share similar update form as Equation (5.3.1a) and

similar dielectric constant ε will use the computation coefficients C0X and C1X stored in

row r of the array. The computation coefficients will be different for Ex 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 Ex

Page 17: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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:

( )

( ) zyRx

Xn

kjiyn

kjiyzCt

nkjiz

nkjizyC

tnkjixC

Cnkjix

CHH

HHEE

X

XX

X

∆∆∆+

−+

∆+∆

+−

+∆+

∆+−+

=

−+

=

, 21

21

21

21

)1,,(),,(1

),1,(),,(1),,(111

),,(

ε

ε(5.3.3)

In this case the computation coefficients will be:

( ) ( ) zXCt

XyXCt

XXCXC

X CCC∆+

∆∆+

∆+−

===12111

10 , ,

εε(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, Ex, Ey, Ez, Hx,

Hy, Hz 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 Ex 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

nextvalue

nextvalue

next

NULL

value

next

Optional linked-list

Computational CoefficientsLook-up Table for Ex

Page 18: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

84

Figure 5.8 – Computational coefficients look-up table for Ex 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 Ex field component using these coefficients. For

instance umode = 0 means the Ex field is in a linear, lossless and non-dispersive

dielectric, umode = 100 means the Ex 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

Page 19: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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 tHfieldtCube tABC

tEHfdtd

Page 20: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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 Ex and Hx components. In Figure 5.10,

uparamex and uparamhx are the variables associated with the row index of the look-up

tables for Ex and Hx 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 Ex. 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 Ey and Ez. The same can be said for

tHfield, where nine three-dimensional arrays are declared for Hx, Hy and Hz. 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

Ex

fHx

umodhx

uparamhx

Hx

Page 21: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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 Ex field components. Figure 5.13 shows the state

diagram for creating the computation coefficient look-up table for Ex field components

during the initialization stages. The procedures shown in Figure 5.12 and Figure 5.13

are then repeated for Ey, Ez, Hx, Hy and Hz 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 tEfielduparamex[ ][ ][ ]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 tHfielduparamhx[ ][ ][ ]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

Page 22: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

88

Figure 5.12 – Update E field component sequence, as seen for Ex component.

Accesscoefficients basedon uparamex

Check umodex

Update Exn+1

using Equation(1)

Update Exn+1

using Equation(2)

Update Exn+1

using Equation(3)

Sample E field update functions

Update H field componentsin field object

Update E field componentsin field object

Update Boundary E fields

( )( )

( )

( )

: :

:(3)Equation

0

:(2)Equation

:(1)Equation

21

21

21

21

21

21

21

21

)1,,(),,(1

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

),,(

1),,(

)1,,(),,(

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

),,(

−−

−+=

=

−−

−+=

+−

+

∆+∆

+−

+

∆+∆+

+

+−

+∆∆

+−

+∆∆+

∆∆∆

∆∆∆

nkjiy

nkjiyz

t

nkjiz

nkjizy

tnkjix

nkjix

nkjix

nkjiy

nkjiyz

t

nkjiz

nkjizy

tnkjix

nkjix

HH

HHEE

E

HH

HHEE

zyzC

zyzC

ε

ε

ε

ε

ε

ε

fC0 fC1 fC2 umode… pList

stCCEx[0]

Computation Coefficient Look-up Table for Ex

fC0 fC1 fC2 umode… pList

stCCEx[1]

fC0 fC1 fC2 umode… pList

stCCEx[2]

fC0 fC1 fC2 umode… pList

stCCEx[m]

FromFigure 5.7

Page 23: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

89

Figure 5.13 – State diagram for creating computational coefficient look-up table for Ex

field components.

Start

• Assign εr and σ for )1,1,1(xE ,

AssignEpsilonSigma( ) is called.• Create entry in stCCEx[ ] based on update mode

for )1,1,1(xE , CreateExConstEntry( ) is called.

• Update auxiliary look-up table stCEAx[ ].

• Create entry for Ex component which coincidewith perfect electric conductor (PEC).

• Update auxiliary look-up table stCEAx[ ].

Assign εr and σ for next Ex

component

Compare εr, σ andumode of ),,( kjixE with

entry in stCEAx[ ]

Set uparamx of ),,( kjixE to

current index

Next entry in stCEAx[ ]

End of Ex fieldcomponents ?

• Create new entry in stCCEx[ ] ,(call CreateExConstEntry( ) )

• Update stCEAx[ ]

End

Yes

Set uparamx of

),,( kjixE to 1

No

Not equalEqual

End of entryin stCEAx[ ]

umode = 1

Note:stCEAx is needed because values of εr andσ are embedded in the computationcoefficients. It is difficult to extract thesevalues from the coefficients.

stCEAx[ ] stCCEx[ ]

• stCCEx[ ] is the computation coefficient look-up table for Ex 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 rowindex.

Page 24: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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.

Page 25: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

91

Figure 5.14 – Screen shots of “winFDTD”, “ winFDTD_draw” and “Plot”.

FDTD simulation engine

winFDTD_draw

Plot

Page 26: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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. Vs 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 T1 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, Mur’s first order

absorbing boundary condition is employed.

Figure 5.15a – Schematic and the view of the model at k = 4 ( zz ∆= 4 ).

Zc = 50ΩTd = 150ps

Vin VL

∆x = 0.7mm∆y = 0.8mm∆z = 0.52mm∆t = 1ps16 cells along x-axis45 cells along y-axis13 cells along z-axis

y

x

Lumpedinductor

Lumpedresistor

Resistive voltagesource along z-axis

Mur’sfirstorderABCs

PEC Conductor

Microstrip line

Page 27: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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 RL coincides with

)5,37,9(yE and the lumped inductor LL conincides with )5,34,9(yE . Thus the effective

voltage across the series RL load can be computed as:

( )ny

ny

nL EEyNV )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:

nz

nin zENV )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

Resistivevoltagesource PEC wires

to modelvias

Lumpedinductor

Lumpedresistor

PCB

Microstrip line

Page 28: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

94

0 1000 2000 3000 4000 5000 60001

0

1

2

3

V2n

V3n

n Int⋅

Figure 5.16a – The effective voltage across the resistive voltage source.

0 1000 2000 3000 4000 5000 60001

0

1

2

3

V1n

V4n

n Int⋅

Figure 5.16b – The effective voltage across the series RL load.

Vin

FDTD

PSPICE

ps

VL

FDTD

PSPICE

ps

Page 29: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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 ( zz ∆= 4 ).

Vs 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 Vs

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 = 1ps21 cells along x-axis51 cells along y-axis13 cells along z-axis

V1 V2

V3 V4

50

50

50

50

Active microstrip line

Passive microstrip lineVs

Active line

Passive line

x

y

Sourceend

Loadend

Page 30: Chapter 5 – The FDTD Simulation Program 5.1 Introduction In this

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 60000.5

0

0.5

1

1.5

2

V1n

V2n

V3n

V4n

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

V1

V2

V3

V4

Near-End Crosstalk (V3)Far-End Crosstalk (V4)

Source pulse (V1)

Delay of tranmission line

V2


Recommended