hiphi 4 - asl

90
HiPhi 4.0 Three-dimensional Electrostatics PO Box 13595, Albuquerque, NM 87192 U.S.A. Telephone: +1-505-220-3975 Fax: +1-617-752-9077 E mail: techinfo@fieldp.com Internet: http://www.fieldp.com 1

Upload: others

Post on 21-Jan-2022

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: HiPhi 4 - ASL

HiPhi 4.0Three-dimensional Electrostatics

PO Box 13595, Albuquerque, NM 87192 U.S.A.Telephone: +1-505-220-3975

Fax: +1-617-752-9077E mail: [email protected]

Internet: http://www.fieldp.com

1

Page 2: HiPhi 4 - ASL

Contents

1 Introduction 4

1.1 Program function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.2 Walkthrough example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.3 Theoretical background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2 Organizing HiPhi calculations 17

2.1 Procedures and files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172.2 Script conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3 Script commands 20

3.1 Program control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203.2 Basic material properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223.3 Modeling small details in a large-scale solution . . . . . . . . . . . . . . . . . . . 23

4 Variations of potential and material quantities from mathematical functions and tables 28

4.1 Program capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284.2 Function syntax and table format . . . . . . . . . . . . . . . . . . . . . . . . . . 304.3 Benchmark example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

5 Running the HiPhi program 33

5.1 Interactive operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335.2 Automatic runs under batch file control . . . . . . . . . . . . . . . . . . . . . . . 345.3 Calculations with large meshes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

6 PhiView – file operations and plane plots 36

6.1 File operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366.2 Plane plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396.3 Saving and loading views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

7 PhiView – numerical analysis 44

7.1 Automatic analyses operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447.2 PhiView analysis scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487.3 Script commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

8 PhiView – slice plots 52

8.1 Setting the slice view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528.2 Setting slice plot properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538.3 Analyses in a slice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558.4 Scan menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568.5 Slice vector tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

9 PhiView – surface plots 61

2

Page 3: HiPhi 4 - ASL

10 Customizing PhiView 67

10.1 Defining calculated quantities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6710.2 Introduction to RPN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6910.3 Variables, operations and parameters . . . . . . . . . . . . . . . . . . . . . . . . 7010.4 Setting up the calculated-quantity sections . . . . . . . . . . . . . . . . . . . . . 72

11 Force calculations in PhiView 75

11.1 Surface integrals for force and torque . . . . . . . . . . . . . . . . . . . . . . . . 7511.2 Expressions for electrostatic forces . . . . . . . . . . . . . . . . . . . . . . . . . . 7611.3 Commands for force calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . 7711.4 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

12 Calculating mutual capacitance 81

13 HiPhi file formats 84

3

Page 4: HiPhi 4 - ASL

1 Introduction

1.1 Program function

HiPhi calculates electrostatic fields in arbitrary three-dimensional systems. The program gen-erates either dielectric or conductive solutions. In dielectric solutions, regions in the solution-space may represent electrodes, dielectrics and space-charge density. In conductive solutions,the regions correspond to electrodes or resistive media. You may include up to 250 materialtypes in a solution. HiPhi has several advanced capabilities:

• High accuracy calculations using finite-element techniques on conformal hexahedron meshes.

• Unmatched computation speed through unique structured meshes, optimized for multi-core Windows PCs with full FORTRAN95 coding.

• Dynamic memory allocation for large mesh capacity (20-50 million elements on a standardPC).

• Advanced techniques to assign continuous spatial variations of potential, dielectric con-stant, conductivity and/or space-charge density to regions from mathematical expressions.

The HiPhi package includes two programs:

• hiphi.exe – generates electrostatic solutions interactively in a window or automaticallyunder batch file control

• phiview.exe – conformable postprocessor generates plots and calculates field quantitiesfrom HiPhi solution files.

MetaMesh, the AMaze universal conformal mesh generator, is required to prepare inputgeometry files.

HiPhi has the power to address the full range of your applications and keep pace with yourgrowing expertise. Nonetheless, learning the program can be relatively easy if you proceed inmanageable steps. We suggest the following sequence of activities:

• Follow the walkthrough example in the next section. This will give you quick introductionto the programs.

• Section 1.3 gives a brief review of electrostatic theory and introduces important terms.

• Read Chap. 2 to understand the procedure for HiPhi calculations and the organizationof data files.

• Try some of the ready-to-run solutions supplied in the example library. The examplesillustrate many important techniques and may serve as templates for your applications.

4

Page 5: HiPhi 4 - ASL

• Chapters 6 through 9 gives detailed descriptions of the capabilities of the PhiView post-processor.

• Tackle advanced topics when you have some experience with the programs. Chapter 3describes how to modify HiPhi scripts to invoke advanced functions. Other topics includecreation of microscopic solutions to model small details (Sect. 3.3), definition of continuousspatial variations of potential and material properties (Chap. 4) and automatic operationof programs in the background under batch file control (Sect. 5.2).

• Chapter 10 describes how to customize the operation of PhiView for your application.You can change the order of plot and analysis quantities and even create your own defi-nitions.

• Chapter 11 explains how to use PhiView to calculate electrostatic forces. Chapter 12reviews techniques for calculating mutual capacitances in a multi-electrode system.

• Finally, Chapter 13 describes HiPhi output file formats. The information is useful if youwant to port data to your own analysis programs.

1.2 Walkthrough example

A quick way to understand the solution procedure is to step through an example. The WALKTHRUcalculation describes fields created by a spherical high-voltage electrode on a dielectric supportat an offset position inside a grounded box. Move the file WALKTHRU.MIN (supplied in theexample library) to a working directory. Table 1 shows a portion of the input file to definethe system geometry. The MetaMesh manual describes the format and logic of the script.The listed parts are: 1) a box representing vacuum that fills the entire solution volume, 2) thecylindrical dielectric support and 3) the spherical electrode. To ensure the proper assignment ofnode region numbers, the dielectric regions appear before the fixed-potential electrode region.Not listed are five parts that set a fixed-potential condition on the boundaries of the solutionvolume at ymax, xmin, xmax, zmin and zmax. Because the system is symmetric about y = 0.0,we leave the boundary ymin unassigned. Therefore, the boundary automatically assumes thespecial Neumann condition (i.e., electric fields parallel to the surface).

To begin, we shall use Geometer to check the geometry of the assembly. Run the program,choose the command File/Load script and pick WALKTHRU.MIN. Figure 1 shows views normalto the y and x axis. The display was created by modifying the default view with the followingoperations:

• Click on View/Toggle parts/regions to display objects by their region number.

• Use View/Displayed parts/regions to bring up the view settings dialog. To see the internalparts, uncheck the Solid box for Region 4 so that the boundary is displayed as a wireframe.(Note that Region 1 is not displayed by default.)

• Click the View/Grid control command and uncheck the Display grid box.

• Choose View/X normal axis or View/Y normal axis.

5

Page 6: HiPhi 4 - ASL

Figure 1: Orthographic views of the WALKTHRU geometry. Left: view normal to y axis. Right:view normal to x axis.

Figure 2: Perspective view of the WALKTHRU geometry. The boundaries of the solution volumehave been shaded.

6

Page 7: HiPhi 4 - ASL

Table 1: Excerpts from file WALKTHRU.MIN, input to MetaMesh

GLOBAL

XMesh

0.00 9.00 N 90

End

YMesh

0.00 3.00 N 30

End

ZMesh

0.00 6.00 N 60

End

RegName 1 Vacuum

RegName 2 Support

RegName 3 Electrode

RegName 4 Boundary

END

PART 1

Type Box

Region Vacuum

Fab 18.0 6.00 12.00

END

PART 2

Type Cylinder

Region Support

Fab 0.80 4.00

Shift 4.00 0.00 0.00

Surface Region Vacuum

END

PART 3

Type Sphere

Region Electrode

Fab 1.5

Shift 4.00 0.00 3.00

Surface Region Vacuum

Surface Region Support

END

...

ENDFILE

7

Page 8: HiPhi 4 - ASL

Figure 3: Three-dimensional view of the completed mesh for the WALKTHRU example,

You can set up 3D views like that of Fig. 2 by clicking the View/Orthogonal/perspectivecommand. The figure illustrates the use of clipping in MetaMesh. Although we define a fullsphere, only the portion of the electrode inside the solution volume is represented. Similarly,MetaMesh clips the cylindrical dielectric support at the solution-volume boundary. Exit orminimize Geometer and run MetaMesh. Choose the command File/Load MIN file and pickWALKTHRU.MIN. Then choose Process mesh to generate the mesh of Fig. 3. Use the commandFile/Save mesh to create the file WALKTHRU.MDF.

We are now ready to useHiPhi. Run the program fromAMaze, choose the Setup commandand pick the file WALKTHRU.MDF. The program displays the dialog of Fig. 4. Note that thegrid contains a row for each mesh region. There are four columns in the grid where you canenter values: Potential (fixed voltage), EpsilonR (relative dielectric constant), Sigma (electricalconductivity in S/m) and Rho (space-charge density in units of coulomb/m3).

The entries in the Control parameter section of the dialog have the following functions:

• DUNIT. Sets a factor to convert coordinate units used in MetaMesh to meters. Themenu sets the value of DUnit, equal to the number of mesh units per meter: 39.37 forinches, 100.0 for cm.

• RESTARGET. Accuracy tolerance for the iterative matrix solution of the finite-elementequations.

• MAXCYCLE. Maximum number of cycles in the iterative solution.

• BOUNDARY and SUPERPOSITION. Advanced program capabilities described in Sect. 3.3.

8

Page 9: HiPhi 4 - ASL

Figure 4: Dialog to set HiPhi control parameters and region properties.

• OMEGA. A parameter in the range 0.0 to 2.0 to control the iterative matrix solution.

The column options in the region grid box determine the material properties of the regionsand the solution type (dielectric or conductive). An entry in the Potential column specifiesthat the region is a fixed-potential electrode in both solution types. The appearance of entriesin the Sigma column indicates a conductive solution, while entries in the EpsilonR and/orRho column signal a dielectric solution. HiPhi issues an error messages if regions have mixedconductive and dielectric properties. If only EpsilonR appears, the program sets Rho = 0.0 bydefault. Similarly, HiPhi assumes that EpsilonR = 1.0 if only Rho is specified. The values inFig. 4 define a dielectric solution with the following region characteristics:

• Region 1. Dielectric (vacuum): ǫr = 1.0.

• Region 2. Dielectric (support): ǫr = 15.7.

• Region 3. Fixed potential (electrode): φ = 2.5× 104 V.

• Region 4. Fixed potential (boundary): φ = 0.0 V.

Set up the dialog with the values shown and click OK. HiPhi uses the information in the dialogto create the script WALKTHRU.HIN shown in Table 2. Chapter 3 reviews the script format andadvanced program capabilities.

Choose Run in the main HiPhi menu and pick WALKTHRU.HIN. The program uses infor-mation in WALKTHRU.MDF and WALKTHRU.HIN to create finite-element equations appropriate forthe conformal mesh and material properties and then solves the equations. The complete pro-cedure takes about 25 seconds. HiPhi creates the binary file WALKTHRU.HOU which containsinformation on the mesh geometry and the electrostatic potential at nodes.

9

Page 10: HiPhi 4 - ASL

Table 2: HiPhi script WALKTHRU.HIN

Mesh = walkthru

DUnit = 1.0000E+02

ResTarget = 1.0000E-07

MaxCycle = 1000

* Region 1: VACUUM

Epsi(1) = 1.0000E+00

* Region 2: SUPPORT

Epsi(2) = 1.5700E+01

* Region 3: ELECTRODE

Potential(3) = 2.5000E+04

* Region 4: BOUNDARY

Potential(4) = 0.0000E+00

EndFile

To analyze the solution, start PhiView from AMaze. Pick File/Load solution file orclick on the tool. Pick the file WALKTHRU.HOU in the dialog. PhiView can generate a widevariety of 2D and 3D plots. Chapters 6, 8 and 9 give detailed information. Here, we shalllook at two examples. To create the 2D equipotential plot of Fig. 5, go to the Slice plot menu.On the Change view popup menu, pick the command Set slice plane properties. Click the XAxis button, move the slider to x = 4.05 and then click OK. Note the slope discontinuity ofequipotential lines at the edge of the dielectric.

To create a 3D plot, return to the main menu and click on Surface plots. On the Plot controlpopup menu choose Surface plot style. The default plot shows the variation of electric field ina plane normal to z. Click the button for the y axis, move the slider to y = 0.0 and click OK.Next, we shall add the spherical electrode to the plot for reference. On the Plot control menuclick on Displayed regions. Activate Region 3 and click OK. To get a better view, we need torotate the plot. Move the mouse into the view area and note the change in cursors as you movearound the screen. When you hold down the left or right mouse buttons, the view orientationbox on the right changes. The main plot is regenerated when you release the button. Withsome experimentation you should be able to create a view like that of Fig. 6. It shows thevariation of |E| over the symmetry plane. (The dielectric support is at the top).

To illustrate the numerical-analysis capabilities of PhiView, return to the main menu, clickFile/Run script and choose WALKTHRU.SCR. PhiView carries out an extended analysis basedon instructions in the file. To view the script, click on Edit script and choose the file. Theinternal program editor loads and shows the following content:

OUTPUT WallThru.DAT

INPUT WalkThru.HOU

VOLUMEINT

SURFACEINT 3 -2 -1

ENDFILE

The first statement ensures that the proper solution file is loaded while the second statementopens a data file to write the results. The command VolumeInt instructs the program to take

10

Page 11: HiPhi 4 - ASL

Figure 5: Slice plot normal to the x axis at position x = 4.05 cm.

11

Page 12: HiPhi 4 - ASL

Figure 6: Working environment of PhiView showing a surface plot of |E| in a normal plane.

volume integrals over all regions of the solution volume. The SurfaceInt command instructsthe program to take a surface integral over the electrode surface (Region 3) adjacent to vacuum(Region 1) and the dielectric support (Region 2). To inspect the output file WALKTHRU.DAT,use the command File/Edit data file. Table 3 summarizes results listed in the file. PhiView

has computed the volume of regions by taking Gaussian integrals over individual hexahedronelements. The computed volume of the spherical electrode (Region 3) is 7.066× 10−6 m3, closeto the theoretical value of the half-sphere of radius 1.5 cm: 7.069 × 10−6 m3. The computedtotal electrostatic field energy is 7.0204× 10−04 J at an applied potential of 2.5× 104 V. Usingthe expression U = CV 2/2, we find that the capacitance of the half-assembly is 2.247 pF. Nextconsider the surface integral values determined in response to the command Region 3. Thecalculated surface area is 1.427× 10−3 m2 while the theoretical prediction is 1.414 × 10−3 m2.We can also double-check the capacitance calculation using the surface charge value determinedby integrating the normal electric field over the surface of the electrode. The calculated resultis 5.658 × 10−8 coulombs. The formula C = Q/V gives the capacitance as 2.263 pF, within0.7% of the volume integral result.

1.3 Theoretical background

This section discusses dielectric and conductive electrostatic solutions and reviews the natureof boundary conditions. To begin, consider a volume with electrodes and ideal dielectrics (i.e.,zero conductivity). If we apply a pulsed voltage, the distribution of charges on electrodes(and hence the fields in the volume) is determined by capacitive coupling. The fields for thedielectric-type solution are given by the Poisson equation

12

Page 13: HiPhi 4 - ASL

Table 3: Contents of WALKTHRU.DAT produced by WALKTHRU.SCR.

---------- Volume Integrals ----------

Global volume: 1.620000E-04

RegNo Region volume

========================

1 1.533153E-04

2 1.618928E-06

3 7.065768E-06

Quantity: Energy

Global value: 7.060260E-04

RegNo Region volume

========================

1 4.304516E-04

2 2.755744E-04

LineNo: 8 SURFACEINT 3

---------- Surface Integrals ----------

Included region set

RegNo Name

=============================

3 SPHERICALELECTRODE

Surface area of region set (m2): 1.427121E-03

Charge: 5.660779E-08

13

Page 14: HiPhi 4 - ASL

Figure 7: Example of a mixed dielectric-conductive electrostatic solution.

∇ · (ǫr ∇φ) = − ρ

ǫ0, (1)

where φ is the electrostatic potential, ǫr is the relative dielectric constant, ρ is the space-chargedensity and ǫ0 = 8.854×10−12 F/m. Next consider a system with imperfect dielectrics with non-zero conductivity. If we apply a rapidly-pulsed voltage, the charge distribution on electrodesearly in time is determined by capacitive coupling. Later the initial charge relaxes by flowthrough the conductors and the distribution is determined entirely by the media conductivities.Therefore, we seek a dielectric-type solution when 1) media in the solution volume have zeroconductivity or 2) the voltage pulse is short. The resistive relaxation time for a material withrelative dielectric constant ǫr and conductivity σ is given by

τRC =ǫrǫoσ

. (2)

As an example, consider water with ǫr = 81.0 and a volume resistivity of 1 MΩ-cm (σ = 10−4

S/m). Equation 2 implies a relaxation time of 7 µs. Therefore the dielectric model would bejustified if we apply a 200 ns voltage pulse to a small volume of water.

Conductive effects always dominate over long time scales. We need to qualify this statementfor the special case of a conductive system that includes regions of ideal dielectrics as in Fig.7.We can determine the static field solution in the conductive regions by treating the dielectricsas perfect insulators (σ = 0.0). On the other hand, the field solution inside the dielectric regiondepends on the spatial variation of dielectric constant. Here the conductive solution determinesa fixed-potential condition along the dielectric boundary. We solve for the fields inside byapplying Eq. 1 with a given potential distribution on the boundary (Dirichlet condition).

For a dielectric-type solution with no space charge, HiPhi solves the Laplace equation:

∇ · (ǫr ∇φ) = 0 (3)

14

Page 15: HiPhi 4 - ASL

Table 4: Material types in dielectric and conductive solutions

Object Dielectric Conductive

Electrode Fixed potential Fixed potentialInsulator σ ≪ 1Floating electrode ǫr ≫ 1 σ ≫ 1

Figure 8: Special Neumann boundaries.

In a conductive medium, the current density is related to the gradient of potential by:

j = σ ∇φ. (4)

Conservation of charge in the medium implies that:

∇ · j = 0, (5)

or

∇ · [σ ∇φ] = 0. (6)

Equation 6 has the same form as Eq. 3 with the substitution ǫr → σ. Table 4 reviews how torepresent materials in the two solution types.. Note that a floating electrode has zero internalelectric field and an initially-unknown potential determined by the dielectric or conductiveproperties of surrounding materials.

The boundary is the outer edge of the solution volume. For electrostatic problems, nodepotentials on the boundary can be set to one of two conditions.

15

Page 16: HiPhi 4 - ASL

• Dirichlet. Boundary points have a fixed potential that is not affected by the poten-tial at neighboring nodes. A region of uniform-potential nodes represents an electrode(equipotential volume). Electric field lines are normal to such a surface.

• Neumann. The normal derivative of the potential is specified. The boundaries in HiPhi

are limited to the special case where ∂φ/∂n = 0. The special Neumann condition impliesthat the electric field is parallel to the boundary. One of the advantages of the finite-element method is that all boundaries that are not fixed automatically satisfy the specialNeumann condition, even if they are slanted or curved. Neumann boundaries are oftenused to reduce computation time for symmetric systems. For example, Fig. 8 shows anequipotential plot for a solution of the fields between two spherical electrodes with adielectric inclusion. By utilizing automatic Neumann boundaries at the top and bottom,we can limit the section to a fraction of the interelectrode volume.

16

Page 17: HiPhi 4 - ASL

2 Organizing HiPhi calculations

2.1 Procedures and files

The HiPhi package consists of the program hiphi.exe that computes the physical solutionand phiview.exe, a post-processor for analyses of the results. The solution program can runin two modes: interactively in a window or autonomously in the background under batchfile control. Similarly, PhiView can run as an interactive application under user control orautonomously under script file control. The autonomous modes allow automatic processing oflarge or repetitive data sets.

Two input files are required for a HiPhi solution:

• A MetaMesh output file (MPrefix.MDF) that describes the conformal hexahedron mesh.The file contains node coordinates and the region numbers of elements and nodes.

• A HiPhi script (FPrefix.HIN) that sets control parameters for the solution program anddescribes the physical properties associated with regions.

The HiPhi file is usually prepared with the dialog described in Sect.1.2. You can use an editorto compose a script or to add advanced features (Chap. 3).

A HiPhi calculation generally consists of the following steps:

1. Use Geometer or an editor to prepare a MetaMesh script with a name of the formMPREFIX.MIN that defines the solution space and describes the division into spatial regions.

2. Run MetaMesh to create a file MPREFIX.MDF of standard mesh information. This filecould be used as input for multiple HiPhi simulations or for other AMaze programs.

3. Use the the Setup dialog of HiPhi to prepare a script (FPREFIX.HIN) that sets controlparameters and the material properties of regions. You can also compose the scriptdirectly with a text editor.

4. Use the HiPhi Process command to create a solution file FPREFIX.HOU. This file containsinformation on node spatial coordinates and electrostatic potential.

5. (Optional) Prepare a standardAMaze analysis script (SPREFIX.SCR) to control aPhiView

analysis session.

6. Use PhiView to create plots or to generate numerical data using the information inFPREFIX.HOU. The analysis may be performed interactively or automatically under thecontrol of a script.

Table 5 summarizes the input and output file used in HiPhi.

17

Page 18: HiPhi 4 - ASL

Table 5: HiPhi file types

Name form Function Status

MPREFIX.MIN Simulation geometry, input toMetaMesh RequiredMPREFIX.MDF Output from MetaMesh, input to HiPhi RequiredFPREFIX.HIN Material properties, input to HiPhi RequiredFPREFIX.HOU Output from HiPhi, input to PhiView RequiredSPREFIX.SCR Analysis control, input to PhiView OptionalPREFIX.DAT Analysis data output, from PhiView Optional

2.2 Script conventions

The HiPhi input script is a text file with data lines containing commands and parameters.The script must end with the EndFile command. The programs make no distinction betweenupper and lower case. Entries on a line may be separated by the following delimiters:

Space, blank

Comma [,]

Tab

Colon [:]

Equal sign [=]

Left parenthesis [(]

Right parenthesis [)]

You may use any number of delimiters in a line. This means that you can add indentationsand customize the appearance of the script. For example, the two lines

Epsi 2 5.56

Epsi(2) = 5.56

are equivalent.HiPhi ignores blank lines and comment lines. Comment lines begin with the symbol [*]

(asterisk). Most parameters are real numbers. The following formats are valid.

1.000

5.67E6

6.8845E+09

5

The final number is interpreted as 5.0.HiPhi accepts commands in any order. The program reads and analyzes all commands

before starting the solution. Generally, it is good practice to put control commands at thebeginning and to group commands that set material properties by region. The following exampleillustrates a complete script for HiPhi:

18

Page 19: HiPhi 4 - ASL

* File XFORM01.HIN

DUnit = 39.37

ResTarget = 5.0E-8

MaxCycle = 1000

NCheck = 1

Omega = 1.80

* Region assignments

* 1: Solution volume, oil

* 2: Casing, ground

* 3: Dielectric coil support

* 4: Oil penetration

* 5: High voltage electrode

Epsi(1) = 2.1

Potential(2) 0.0

Epsi(3) = 5.3

Epsi(4) = 2.1

Potential(5) = 380.0E3

EndFile

You may place any amount of text in any format after the EndFile command. Therefore youcan add extensive documentation that may be helpful when you return to a simulation after along period of time.

19

Page 20: HiPhi 4 - ASL

3 Script commands

3.1 Program control

This chapter reviews the full set of commands that may be included in HiPhi scripts. Thefirst group, discussed in this section, controls program operation. Each command is shownsymbolically and in a form that it might assume in a program.

MESH MPrefixMESH = TriggerConfigThe prefix of the MetaMesh output file (MPrefix.MDF) to use for the definition of the solutiongeometry. If the command does not appear in a script FPrefix.HIN, HiPhi searches for thedefault file FPrefix.MDF.

DUNIT UnitDUNIT = MMDUNIT = 100.0Use this command to set the units used inMetaMesh to create the input mesh. The Unit argu-ment may be one of the following strings for common units: angstrom, nanometer, micrometer,mil, mm, cm, inch, foot, yard, meter, kilometer or mile. For custom units, enter a real num-ber equal to the number of mesh units per meter. For example, if you used dimensions ofcentimeters in the MetaMesh script, set Unit = 100.0. The quantity Unit is recorded in theoutput file and is used in PhiView for the input and output of positions. Default: Unit = 1.0.

RESTARGET ResTargetRESTARGET = 5.0E-6The numerical calculation of electrostatic fields requires the solution of a large set of coupledlinear equations, one for each active node in the solution volume. HiPhi uses an iterative tech-nique based on corrections that reduce the error in electrostatic potential at a point comparedto predictions from values at neighboring nodes. The residual is an average of the relative errorsover all nodes in the solution space during an iteration. This command sets a target value forthe residual. The program stops if the error drops below the value. For good accuracy, therelative residual should be less than 10−6. If the value of ResTarget is too low, the program maynot converge because of roundoff errors. In this case, you can terminate a solution manuallyif you running HiPhi in the interactive mode by using the Stop command. Default value:ResTarget = 5.0× 10−7.

MAXCYCLE MaxCycleMAXCYCLE = 2500The integer parameter MaxCycle is the maximum number of iteration cycles. HiPhi saves the

20

Page 21: HiPhi 4 - ASL

solution and stops when it reaches MaxCycle even if ResTarget has not been attained. Defaultvalue: MaxCycle = 2500.

OMEGA OmegaOmega = 1.92The real-number parameter Omega is the over-relaxation factor used to correct potential errorsduring the solution. This quantity may have a significant effect on the run time. If this commanddoes not appear, HiPhi picks values that vary with the iteration cycle following the Chebyshevprescription. With this command, you can set a value manually. The value must be between0.0 and 2.0 for numerical stability. Higher values generally give faster convergence.

PARALLEL [NProc]PARALLEL = 4This command invokes multithread support for the 64-bit program running on a multi-coremachine. When the command appears with no value of NProc, HiPhi uses the full resourcesof the computer during the matrix inversion, giving a substantial reduction of the run time.Set a value of NProc to assign a specific number of threads. If the command does not appear,the operating system assigns the program to a single thread, leaving the others free for othertasks. Do not employ parallel processing if you are running multiple instances of HiPhi. Thecommand has no effect on the 32-bit program version.

The remaining control commands serve specialized functions and are used infrequently.

NCHECK NCheckNCHECK = 20The operations to calculate ResTarget take time; therefore, HiPhi usually does not make acheck on every iteration cycle. The integer parameter is the number of relaxation cycles betweenconvergence checks. Default value: NCheck = 50.

FORMAT [Text, Binary]Format = TextBy default, HiPhi creates output files FPREFIX.HOU in binary format. This format preservesfull numerical accuracy and minimizes the file size. Use text format if you want to port resultsto your own analysis programs. PhiView can read either format. The string parameter maybe either Binary or Text.

INITVAL FPrefixINITVAL = DistortionSwitchIn some circumstances, you can reduce the solution time for large meshes by using precomputedinitial values of potential. In normal operation, HiPhi initializes the electrostatic potentialto φ = 0.0 at all nodes that do not have a fixed potential. When this command appears,the program sets initial values at variable nodes equal to those in the file FPrefix.HOU. Oneapplication for the command is to run additional relaxation cycles to improve the accuracy

21

Page 22: HiPhi 4 - ASL

of an existing solution. You can also use the command if you make small changes to appliedpotentials or the geometry of electrodes or dielectrics. The solution file FPrefix.HOU shouldbe available in the working directory and must have the same foundation mesh as the inputfile MPrefix.MDF. A necessary condition is that the values of Imax, Jmax, Kmax, xmin, xmax,ymin, ymax, zmin and zmax must match. Within this limitation, there may be small geometricdifferences between objects in the two files. If there are large differences, the procedure maynot significantly reduce the solution time.

INTERP [Linear, Spline]INTERP = SplineSet the interpolation method used when spatial variations of φ, ǫr, σ and/or ρ are defined fromdata tables. Use the Linear interpolation method for noisy or discontinuous data. The defaultis Spline.

3.2 Basic material properties

Material properties in electrostatic solutions are relatively simple so only a few commands arerequired. HiPhi handles either dielectric solutions or conductive solutions (Sect. 1.3). In adielectric solution you can set both the relative dielectric constant and space-charge densityof a filled region. In a conductive solution you can specify the conductivity of a filled region.HiPhi issues an error message if you mix quantities in a script. The basic commands of thissection set properties that are uniform throughout a region. Chapter 4 describes how to definematerial properties that vary according to a mathematical expression over the region volume.

POTENTIAL RegNo PhiPOTENTIAL(5) = 2500.0This command sets all elements or nodes associated with a region number to a fixed potentialcondition. The integer parameter is a region number defined in MetaMesh. The real numberis the value of electrostatic potential in volts (V). The fixed-potential condition may be appliedto both filled and open regions.

EPSI RegNo EpsiRelEPSI(4) = 12.6This command sets a relative dielectric constant for all elements associated with a filled region.The integer parameter is the number of a region defined in MetaMesh. The second parameteris the value of relative dielectric constant ǫr = ǫ/ǫ0 (dimensionless). To model a floatingelectrode (conducting object whose potential is not previously know), assign a relatively largevalue of dielectric constant (i.e., ǫr ∼= 104) to the region. Note that excessive values (ǫr ∼= 108)may slow the solution convergence. The default for all unspecified regions is ǫr = 1.0.

RHO RegNo ChgDensRHO 3 4.5E-10This command assigns a space-charge density to elements within the specified region. The

22

Page 23: HiPhi 4 - ASL

Figure 9: Use of a void to define a slanted Neumann boundary.

real-number parameter is the value of ρ in coulombs/m3. A script may contain both Rho andEpsi commands for the same region. The default for all unspecified regions is ρ = 0.0.

SIGMA RegNo CondSIGMA(5) = 0.682This command assigns a conductivity to elements within the specified filled region. The real-number parameter is the value of σ in siemens/m. To model a floating electrode, assign arelatively high value of conductivity. Do not assign the value σ = 0.0 for a perfect insulator.Instead, use the Void model. The default for all unspecified regions in a conductive solution isσ = 1.0 S/m.

VOID RegNoVOID (4)A void material has the property ǫr = 0.0 or σ = 0.0. Electric field lines in the medium adjacentto a void are parallel to the boundary and equipotential lines are normal. Voids can be usedto define symmetry boundaries that are not parallel to one of the axes. For example, Figure 9shows a simulation of a 3-wire probe array in one sextant of the x-y plane. Internal voids canalso be used to represent ideal insulators of any shape in conductive solutions. As shown in thefigure, PhiView does not calculate or plot electrical quantities inside a void.

3.3 Modeling small details in a large-scale solution

HiPhi incorporates a powerful feature that enables accurate calculations of fields near smallfeatures in a large solution space. Suppose we wanted a precision calculation of the fields ona field emission tip. The radius of the tip is much smaller than the scale size of the electrodesthat create the field and hold the tip. We need to do a large-scale calculation to find themacroscopic fields (Solution 1), but we would need very small elements near the tip to resolve

23

Page 24: HiPhi 4 - ASL

Figure 10: Creating a microscopic solution using the Boundary command.

the curvature. One approach is to use variable mesh resolution to create small elements nearthe tip. A limitation to this technique arises from the structured mesh used in the AMaze

programs - the region of small elements must extend the full length of the solution volume.Figure 10 illustrates an alternate approach. We create a second solution that extends over a

small subregion of the original solution (green outline). The microscopic solution contains anyelectrodes that are located within the subregion. The difference is that the electrode shapesmay be resolved in much greater detail. The question is how to incorporate the macroscopicfields correctly into the microscopic solution. One resolution is to enclose the second solutionin a variable-potential Dirichlet boundary. Values of φ on the boundary are calculated byinterpolation at the corresponding point in the macroscopic solution (dashed red line). Thetotal solution will be approximately correct as long as new features (such as the rounded tip)are well-removed from the variable-potential boundary.

Definition of the variable Dirichlet boundary is controlled by the following command thatappears in the script of Solution 2:

BOUNDARY FPrefix [BScale] [BStatus]BOUNDARY FEmitMacro 1.0 101111The string quantity FPrefix is the prefix of the output file for Solution 1. The real-numberquantity BndScale is an optional scaling factor applied to potential values transferred fromSolution 1 to Solution 2. The default is BndScale = 1.0. The optional parameter BStatusis a string with six characters, either ’0’ or ’1’. It can be used to control whether a specificboundary is assigned the computed Dirichlet condition. The order of boundaries in the string isXDn, XUp, Y Dn, Y Up, ZDn and ZUp. An entry of 1’ indicates that the Dirichlet conditionshould be applied. Use a ’0’ entry for symmetry boundaries that assume the Neumann condition.The default is BStatus = ’111111’.

In response to the Boundary command, HiPhi loads Solution 1 into memory and sets upthe apparatus for making second-order interpolations of potential in the solution. Next, theprogram loops through all nodes of Solution 2. If the node is on the boundary of the solutionbox, HiPhi marks it as a fixed-potential point and sets the potential equal to the interpolated

24

Page 25: HiPhi 4 - ASL

Figure 11: Equipotential lines and element resolution in the large-scale solution BOUNDTEST01.The dashed line shows the boundary of the small-scale solution.

value calculated at the position in Solution 1. HiPhi issues an error message under thefollowing conditions: 1) the output file for Solution 1 is not available in the working directory,2) Solution 2 does not fit completely inside Solution 1 or 3) an interpolation failed. Theprogram makes no further validity checks. You must ensure that the geometry of Solution 2

represents a correct microscopic section of Solution 1.The example library contains files to illustrate the process. The file set BOUNDTEST01.MIN

and BOUNDTEST01.HIN describes a large-scale solution, while BOUNDTEST02.MIN and BOUNDTEST02.HINdescribe a microscopic solution, a subset of the first. Figure 11 shows the large-scale solutionwhich covers a volume extending from -10.0” to 10.0” in x and y and from 0.0” to 15.0” in z.A shaped electrode creates a field on a flat grounded plate. We want to find precise fields neara small protrusion on the plate. The protrusion is smaller than the scale size off elements inthe large-scale mesh (0.5”). The microscopic solution covers a portion of the original solutionvolume extending from -2.5” to 2.5 in x and y and from 10.0” to 15.0” in z. (dashed line inFig. 11). The element scale size is 0.25” in the bulk of the solution and 0.05” in the region ofthe protrusion. The script BOUNDARYTEST02.HIN has the following content:

25

Page 26: HiPhi 4 - ASL

Figure 12: Equipotential lines and element resolution in the small-scale solution BOUNDTEST02.

* File BOUNDARYTEST02.HIN

* NReg RegName

* =============================

* 1 VACUUM

* 2 PROTRUSION

RESTARGET = 5.0E-8

MAXCYCLE = 2500

DUNIT = 39.37

NCHECK = 10

BOUNDARY BOUNDARYTEST01

EPSI(1) = 1.0

POTENTIAL(2) = 0.0

ENDFILE

Figure 12 shows equipotential lines and the element division of the protrusion in the microscopicelectrostatic solution, a subset of the original. The surface of the protrusion is well-resolvedand electric field interpolations in the vicinity will be accurate. The process is valid becausethe presence of the small protrusion does not significantly influence values of potential at theboundary of Solution 2.

In response to the Superposition command, HiPhi adds values from one solution (Solution1) to another (Solution 2). The following statement may appear in the command script forSolution 2.

SUPERPOSITION FPrefix [SScale]SUPERPOSITION UniFieldThe string FPrefix is the prefix of the output file for Solution 1. The restriction is thatSolution 1 must fit inside Solution 2. The real quantity SScale is a scaling factor applied topotential values transferred from Solution 1 to Solution 2. The default is SuperScale = 1.0.

26

Page 27: HiPhi 4 - ASL

In response to the Superposition command, HiPhi opens the solution file FPrefix.HOU

after Solution 2 has been completed. The program performs an interpolation in the space ofSolution 1 to determine the potential φ1 at each node location in Solution 2 and adjustsvalues according to

φ′

2 = φ2 + SScale× φ1, (7)

before writing the output file. You must ensure that the superposition is physically correct.In electrostatic solutions the presence of electrodes and dielectrics in Solution 2 can makesignificant local changes to the macroscopic field of Solution 1, so that a simple superpositionwould be invalid.

27

Page 28: HiPhi 4 - ASL

4 Variations of potential and material quantities from math-

ematical functions and tables

4.1 Program capabilities

Section 3.2 covered commands to define potential values or material properties (ǫr, σ and/orρ) that are uniform throughout a region. This section describes how to represent quantitiesthat vary continuously in space following a mathematical prescription. It is straightforward toassign variable region properties with following commands:

POTENTIAL RegNo > FunctionPOTENTIAL(5) > 1.50E04*cos($x/20.5)*sin($y/15.0) + 1.3E03POTENTIAL(2) > 80.245*(1.0 - 0.0625*$z∧2)Set values of φ (in volts) at the nodes of a fixed-potential region according to a specifiedfunction of space. The keyword Potential followed by the region number and the > symboldesignates that a function string occupies the remainder of the line. The function may be upto 230 characters in length and follows the format described in the next section. The functiondefines a variation in three-dimensional space: f(x, y, z). The parser uses the Perl standard forvariables where $x designates the variable x, $y stands for y, and $z for z. The potential at anode equals the value of the function evaluated at the node position. Note 1: There is no limiton the number of functions – any region may be associated with a function. Note 2: Positionsare passed to the function in units set by DUnit (cm, inches, µm,...). Note 3: You can modeldiscontinuous functions by dividing a volume into two or more regions. Note 4: Variationsmay be assigned to both filled regions and contiguous or disconnected line or surface regions.

POTENTIAL RegNo TABLE [x,y,z,r] TabNamePOTENTIAL(3) = TABLE R ZUpBoundary.DATSet values of φ (in volts) at the nodes of a fixed-potential region according to a spatial variationspecified in a table. A table is a text file available in the current directory with format describedin the following section. The keyword Potential is followed by the region number and thekeyword Table. Because tables are one-dimensional, the command must include a symbol thatdesignates the direction of the variation. The options are x, y, z and r, where

r =√

x2 + y2. (8)

The string TabName is the full file name of the table. The node positions (in units set byDUnit) are passed to the table-interpolation routine. The table should return potential valuesin units of volts. Tables are particularly useful when you want to add small three-dimensionaldetails to a global two-dimensional solution. A scan of potential values in an EStat solutionmay be used to set boundary values in a microscopic HiPhi solution.

28

Page 29: HiPhi 4 - ASL

EPSI RegNo > FunctionEPSI(7) > 1.0 + ($x - 0.25)/5.50EPSI(4) > 1.0 - 0.625*$z∧2Assign values of the relative dielectric constant ǫr to elements of the region according to aspecified spatial variation. The spatial function is evaluated at the center of mass of eachelement. HiPhi issues an error message if the value of the function in any element givesǫr ≤ 0.0.

EPSI RegNo TABLE [x,y,z,r] TabNameEPSI(5) = TABLE Z GradedDielectric.DATSet values of the relative dielectric constant ǫr in elements of the region according to a spatialvariation defined by a table. The position of the element center-of-mass (in units set by DUnit)is passed to the table-interpolation routine. HiPhi issues an error message if the returned valuein any element gives ǫr ≤ 0.0.

SIGMA RegNo > FunctionSIGMA(7) > 0.5 + 2.0*(1.0 - cos(3.14156*$x/15.0))SIGMA(4) > 100.0 - 50*exp(($z/10)∧2)Assign values of electrical conductivity to elements of the region according to a specified spatialvariation. The spatial function is evaluated at the center of mass of each element and shouldreturn values in units of S/m. HiPhi issues an error message if the value of the function inany element is σ < 0.0.

SIGMA RegNo TABLE [x,y,z,r] TabNameSIGMA(5) = TABLE X SwitchBreakdown.DATSet values of the conductivity σ in elements of the region according to a spatial variation definedby a table. The position of the element center-of-mass (in units set by DUnit) is passed to thetable-interpolation routine. The table should return values of σ in units of S/m. HiPhi issuesan error message if the returned value in any element gives σ < 0.0.

RHO RegNo > FunctionRHO(5) > 5.235E-6 + 4.33E-6*($x/2.3E-6)Assign values for the space-charge density in dielectric solutions to elements of the regionaccording to a specified spatial variation. The spatial function is evaluated at the center ofmass of each element and should return values in units of coulomb/m3.

RHO RegNo TABLE [x,y,z,r] TabNameRHO(2) = TABLE Y PulsedBeam.DATSet values of the space-charge density ρ in elements of the region according to a spatial variationdefined by a table. The position of the element center-of-mass (in units set by DUnit) is passedto the table-interpolation routine. The table should return values of ρ in units of coulomb/m3

You can use the plotting and analysis functions of PhiView to check the validity of mathe-matical expressions for spatially-varying φ, ǫr, ρ or σ.

29

Page 30: HiPhi 4 - ASL

4.2 Function syntax and table format

HiPhi features a flexible and robust algebraic function interpreter. A function is a string (upto 230 characters) that may include the following entities:

• Spatial variables, $x, $y or $z.

• Real and/or integer numbers in any valid format (e.g., 3.1415, 476, 1.367E23, 6.25E-02,8.92E+04,... ). Integers are converted to real numbers for evaluation.

• Binary operations: + (addition), - (subtraction), * (multiplication), / (division) and ∧(exponentiation).

• Functions: abs (absolute value), sin (sine), cos (cosine), tan (tangent), ln (normallogarithm), log (base 10 logorithm), exp (normal exponent) and sqt (square root).

• Up to 20 sets of parentheses to any depth.

• Any number of space delimiters.

The parser conforms to the standard algebraic rules and features comprehensive error checking.Errors may include unbalanced parentheses, unrecognized characters and sequential binaryoperations. To illustrate a valid example, the expression

1 - exp(-1.0*(($x^2 + $y^2 + $z^2)/24))

corresponds to

1− exp

[

−(

x2 + y2 + z2

24

)]

. (9)

A table is a text file that contains a set of data lines of the format

IndVar DepVar

followed by the EndFile command. The independent variable may be x, y, z or r in units set byDUnit. In other words, if the mesh dimensions were in centimeters, use the same units for theindependent variable. Note that the intervals between values of the independent variable neednot be uniform – values may be clustered near positions where there are large changes in thedependent variable. The dependent variable may represent the potential (in volts), the relativedielectric constant, the conductivity (in S/m) or the space-charge density (in coulombs/m3).The entries may be in any valid floating point format and may be separated by any of thestandard delimiters listed in Sect. 2.2. You may include comment lines that start with anasterisk and text in any format after the EndFile command.

The table interpolation method may be linear or cubic spline, according to the form of theInterp command. The default is Spline. The cubic spline method requires a good data setwith continuous values of the function and its derivative. Use the Linear option for noisy ordiscontinuous data. The interpolation routine returns a value of zero for out-of-range inputvalues of the independent variable.

30

Page 31: HiPhi 4 - ASL

Figure 13: Geometry for the RHOTEST example showing the element size. Dimensions in cm.

4.3 Benchmark example

The RHOTEST example (Fig. 13) illustrates the procedure to define a continuous variation ofspace-charge density. We choose a simple geometry for comparison with analytic results. Thecalculation determines the electrostatic potential generated by a symmetric charge distributionρ(R) inside a grounded metal sphere of radius R0 = 2.0 cm. In this case, the potential isdetermined by the Poisson equation:

1

R2

d

dRR2 dφ

dR= −ρ(R)

ǫ0. (10)

If the space-charge density has the uniform value ρ0, solution of Eq. 10 gives the followingexpression for the potential at center of the sphere: φ0 = ρ0R

20/6ǫ0. For ρ0 = 1.0× 10−6 C/m3

and R0 = 0.02 m, the potential is φ0 = 7.529 V. If the space-charge density varies with radiusas:

ρ(R) = ρ0

[

1−(

R

R0

)2]

, (11)

then the potential at the center is φ0 = (ρ0R20/ǫ0)(1/6− 1/20) = 5.271 V.

Figure 13 shows the geometry for the numerical solution. The element size is approximately0.10 cm. Region 1 is a volume of fixed-potential nodes with φ = 0.0 V that initially fills thesolution volume. Region 2 is a dielectric with ǫr = 1.0 that carves out the spherical volume. Tocreate a solution with uniform charge density ρ0 = 1.0× 10−6 C/m3, the HiPhi script containsthe following entry:

Rho(1) = 1.0000E-06

31

Page 32: HiPhi 4 - ASL

Figure 14: Variation of potential with R for the RHOTEST example. Red: uniform space-chargedensity. Blue: non-uniform space-charge density.

The red curve in Fig. 14 shows the calculated radial variation of potential. The potential atthe center is φ0 = 7.533 V, within 0.11% of the theoretical value. To introduce the variablespace-charge density of Eq. 11, we simply change the above line to

Rho(2) > 1.0E-6*(1.0 - 0.25*($x^2+$y^2+$z^2))

The resulting variation of φ is plotted as the blue curve in Fig. 14. The calculated centralpotential is φ0 = 5.266 V, within 0.13% of the theoretical value.

32

Page 33: HiPhi 4 - ASL

Figure 15: HiPhi display during a solution.

5 Running the HiPhi program

5.1 Interactive operation

The program hiphi.exe can run interactively in a window. In this mode you can performseveral solutions in a session and temporarily leave the program to work on other tasks. Youcan launch the program fromAMaze or create you own shortcuts. Figure 15 shows the programwindow.

The program menu has four main commands: File, Setup, Run and Help. The followingcommands appear in the File popup menu.

EDIT SCRIPTEDIT LISTING FILEEDIT FILEThe commands call up the internal editor to inspect or to modify text input and output filesfor the solution program. With the Edit script command you can work on files with names ofthe form FPREFIX.HIN. With the Edit listing file command you can pick files with names of theform FPREFIX.HLS. The Edit file command shows all available files. Choosing a file from analternate directory does not change the working directory of the program. Note that the mainprogram will be inactive until you exit the editor.

SETUPIn response to this command, HiPhi prompts for the name of a MetaMesh file and bringsup the dialog of Fig. 4. Fill in values for control parameters and material properties to createa basic script. You can use an editor to modify the script or to add the advanced functionsdescribed in Chap. 3.

The Run menu has three commands.

33

Page 34: HiPhi 4 - ASL

START RUNPick an input file with a name of the form FPREFIX.HIN to start a solution. The workingdirectory changes if you pick a file from an alternate directory. The run begins if the requestedMetaMesh file MPREFIX.MDF is available in the working directory. HiPhi displays informationin the window to show the progress of program operations (Fig. 15).

PAUSE RUNThe intensive calculations of HiPhi make demands on the resources of your computer, possiblycausing other tasks to run slowly. If you need to perform critical work, you can pause thesolution program during the relaxation process and restart it later without loss of data.

STOP RUNThis command terminates the program during the relaxation process and saves output data.For example, you may want to stop a run at a moderate value of convergence to check whetherthe problem has been correctly defined.

The Help menu has a single command.

INSTRUCTION MANUALThe command displays this manual using your default PDF viewer. The file hiphi.pdf mustbe in the same directory as hiphi.exe.

PHYSICAL CONSTANTSThe command displays the file physcons.pdf, a useful list of physical constants included withthe HiPhi distribution.

5.2 Automatic runs under batch file control

Batch file control is a useful option for running large technical programs like HiPhi. You canprepare scripts to organize complex operations. The sequenced programs run automatically inthe background. This feature is particularly attractive on dual-processor machines.

To run a single HiPhi calculation in the background, go to the Command Prompt fromWindows and log to the data directory that contains the required MDF and HIN files. Forexample, suppose the data files SWITCH.MDF and SWITCH.HIN are stored in \AMAZE\BUFFER andthat the program hiphi.exe is in the directory \AMAZE. From \AMAZE\BUFFER type

..\HIPHI SWITCH <Enter>

The program runs silently, writing detailed information in the listing file SWITCH.HLS. If thesolution is successful, the program creates the output file SWITCH.HOU in the data directory.

The main function of the command mode is autonomous operation under batch file control.As an example, suppose you have prepared the input files SWITCH01.MIN,...,SWITCH08.MIN andSWITCH01.HIN,...,SWITCH08.HIN in the directory \AMAZE\BUFFER. Next you create the followingbatch file SWRUN.BAT in the data directory using a text editor:

34

Page 35: HiPhi 4 - ASL

@ECHO OFF

ECHO Main switch data run

START /WAIT ..\METAMESH.EXE SWITCH01

START /WAIT ..\HIPHI.EXE SWITCH01

START /WAIT ..\METAMESH.EXE SWITCH02

START /WAIT ..\HIPHI.EXE SWITCH02

...

START /WAIT ..\METAMESH.EXE SWITCH08

START /WAIT ..\HIPHI.EXE SWITCH08

Type

SWRUN <Enter>

to generate all solutions without the need for further keyboard input.

5.3 Calculations with large meshes

The best strategy for three dimensional calculations is to work with the smallest mesh consistentwith the desired accuracy. There are several ways to minimize the mesh size::

• Avoid representing small details that have a small effect on the field solution.

• Use variable element sizes with a coarse representation of remote objects.

• Exploit symmetries so that only a portion of the system is included in the calculation.

• Use the Boundary command to create detailed microscopic solutions inside a global so-lution.

If a large mesh (> 1 million elements) is unavoidable, you must ensure that the computerhas sufficient resources. The mesh size may be limited by the installed RAM. HiPhi requiresabout 160 bytes/element. Multiply by the number of elements to estimate the required memory.(Note, when using the Boundary command, you must include the number of elements in boththe microscopic and macroscopic meshes.) It is important to recognize that the 32-bit versionof Windows XP will not allocate more than 1.2 GB of RAM to a task, independent of theinstalled memory. The full memory is available when you run the 64-bit version HiPhi under64-bit Windows XP, Vista or 7

35

Page 36: HiPhi 4 - ASL

6 PhiView – file operations and plane plots

The function of thePhiView post-processor is create plots and to calculate numerical quantitiesfrom HiPhi solution files. The program has the following popup menus: File operations,Analysis, Plane plots, Slice plots, Surface plots and Help. Initially, only the File operations andHelp menus are active. You must load a data file in order to create plots or to perform analyses.

6.1 File operations

This section reviews options in the File operations menu.

LOAD SOLUTION FILEPhiView displays a dialog with a list of solution files with names of the form FPREFIX.HOU.Changing the directory in the dialog changes the program working directory. Pick an availablefile and click OK. The program loads the solution and updates the status bar. If data retrievalis successful, the analysis and plot menus become active.

SOLUTION FILE INFORMATIONThe command shows a message box with information on the currently-loaded data file.

LOAD CONFIGURATION FILEConfiguration files determine the plot and analysis quantities of PhiView. The files havenames of the form FPREFIX.CFG. Three files are supplied with the program:

• phiview dielectric.cfg – analysis of dielectric-type solutions.

• phiview conductive.cfg – analysis of conductive-type solutions.

• phiview force.cfg – calculations of electrostatic forces and torques in dielectric-typesolutions.

PhiView loads the configuration phiview dielectric.cfg the first time you run the program.Use this command to change the configuration. The program remembers the last configurationused and reloads it. You can customize PhiView by creating your own configuration file (seeChap. 10).

SAVE REFLECTED SOLUTIONThe use of a symmetry boundary saves considerable time in a large 3D calculation but pro-duces half a solution. There are instances where it is useful to have numerical values for thefull solution volume (e.g., creating plots or tracking orbits in OmniTrak or GamBet). Usethis command to create a data file for the currently-loaded solution that includes values ofelectrostatic potential reflected across a symmetry boundary. To begin, you must set up the

36

Page 37: HiPhi 4 - ASL

Figure 16: Dialog to create a reflected solution

original solution so that the symmetry plane corresponds to the lower solution-volume bound-ary in either x, y or z. Load the solution, click on the command and use the Save dialog tospecify an output file name. The next dialog (Fig. 16) shows a set of options for the reflection.Designate a reflection plane with the radio buttons. The grid field shows the stored quantitiesin the solution file. The Invert check box in the row for electrostatic potential φ determines thereflection symmetry. Leave the box unchecked if the electric field is parallel to the symmetryplane. Check the box if the field is normal to the plane. In electrostatic solutions, the quantityǫr is always a positive number and should not be inverted. You must ensure that the solutionis appropriate for the reflection parameters that you choose. PhiView does not check thephysical consistency of the output values. You can load the modified file and check validitywith the plot functions of PhiView.

RUN SCRIPTSometimes you may want to perform complex or repetitive analyses on a set of similar solutions.Analysis script operation is a powerful feature of PhiView. This command displays a dialogwith a list of analysis scripts (suffix SCR) that you have created. Pick a file and click OK.Changing directories in the dialog changes the working directory of the program. The analysisscript can load data files, open and close history files, and perform any of the numerical functionsdescribed in this manual. Section 7.1 reviews the analysis script language.

CREATE SCRIPTUse this command to create scripts using the internal editor. A box requests a file prefix. Theresulting script file will be saved as FPREFIX.SCR. Next, the program opens the file in the editorand writes the reference list of allowed commands shown in Table 6. Enter commands in thespace above EndFile. After saving the file, you can run it using the Run script command.

37

Page 38: HiPhi 4 - ASL

Table 6: Create script - default file content

* Analysis script

* Insert commands here...

ENDFILE

--- Command summary ----

INPUT InFileName

[Close current solution file and load FileName]

OUTPUT OutFileName

[Close current data file and open OutFileName]

CONFIGURATION ConfigFileName

[Load a new configuration, ConfigFileName]

POINT xp yp zp

[Point field calculation at the given coordinates]

SCAN xp1 yp1 zp1 xp2 yp2 zp2

[Scan along a line between the given coordinates]

GENSCAN

xp1 yp1 zp1

...

xpn ypn zpn

END

[Write field values at listed coordinates]

VOLUMEINT [RegNo]

[Volume integrals, optionally for region RegNo]

SURFACEINT Reg1 Reg2 ... RegN

[Surface integrals around the region set]

MATRIX FileName XMin XMax NX YMin YMax NY ZMin ZMax NZ

[Write a matrix of field values to the file FileName]

NSCAN 100

[Set the number of points in a line scan]

INTERPOLATION [LSQ,Linear]

[Set the interpolation method]

ENDFILE

[Terminate the analysis]

38

Page 39: HiPhi 4 - ASL

EDIT SCRIPTUse this command to change an existing script file. The dialog lists files in the current directorywith the subscript SCR. Changing directories does not change the working directory of theprogram.

OPEN DATA FILESeveral of the analysis commands like Point calculation and Line scan generate quantitativeinformation. You can automatically record the data generated during an analysis session byopening a data file. Supply a file prefix in the dialog or accept the default. The text data filehas a name of the form FPREFIX.DAT and will be stored in the working directory. You canuse an editor to view the file or to extract information for mathematical analysis programs orspreadsheets.

CLOSE DATA FILEUse this command if you want to start a new file to record data. The data file is automaticallyclosed when you exit the postprocessor. Otherwise, you must close the file before using theEdit data file command or loading the file into another program. Failure to close the file mayresult in a Windows Resource Sharing Error.

EDIT DATA FILEView or modify files with names of the form FPREFIX.DAT.

EDIT FILEUse the program editor to view or to modify any text file.

The Help menu shows program information and contains the following commands:

INSTRUCTION MANUALDisplays this document in your default PDF viewer. The file hiphi.pdf must be in the samedirectory as phiview.exe.

6.2 Plane plots

Plane plots (Fig. 17) are two-dimensional plots that show the variation of quantities over planesthat cut the solution volume. There are three differences from the slice plots discussed in thenext section:

• Plane plots are created from a rectangular mesh of values while slice plots built using thecomputational mesh. Slice plots show precise region boundaries and equipotential linesin true scale.

• Because they are simpler to construct, plane plots support a wider variety of plot styles.

• Plane plots are not limited to slice normal to a Cartesian axis.

39

Page 40: HiPhi 4 - ASL

Figure 17: Plane plot of electrostatic potential - type 3D filled contour.

SET PLANEThis command brings up the dialog of Fig. 18 to set the plane for the plot. Set the normal axiswith the radio buttons at the top. For example, for a choice of z the plot will be created inthe x-y plane. You can use the slider bar to set the position along the normal axis or type avalue in the box. The range of the slider bar is automatically set to the limits of the solutionvolume along the normal axis. The field group at the bottom-left determines the plot range inthe normal plane. The default settings are the limits of the solution volume. Note that planeplots are constructed to fill the maximum area. They do not preserve scaling in the normalplane. The final command group at the bottom-right control an optional rotation of the plotplane. The radio buttons set the pivot axis, the quantity Rotate is the rotation angle in degreesand Position is the pivot position along the direction normal to the pivot axis.

The following commands are in the Plot control popup menu:

PLOT STYLEThis command brings up the dialog of Fig. 19 to set the plot style. As an example, Fig. 17shows the Filled contours 3D plot style. The numbers at the bottom give the resolution ofthe mesh used to create the plot. Higher values give more detail but require longer regeneratetimes. The default is a 100× 100 mesh.

PLOT QUANTITYSet the quantity to be plotted. the choice depends on the current configuration file. Forphiview dielectric.cfg, the quantities are Ex, Ey, Ez, |E|, φ, Ue, ǫr and ρ, where Ue is

40

Page 41: HiPhi 4 - ASL

Figure 18: Set plane dialog.

Figure 19: Plot style dialog.

41

Page 42: HiPhi 4 - ASL

the electrostatic field energy density and ρ is the space charge density. The configuration filephiview conductive.cfg does not include ǫr and Ue but adds the quantities jx, jy, jz, |j|, Pand σ. Here, P is the resistive power density and σ is the electrical conductivity. Note thatdiscontinuous quantities like the electric field and current density plots may appear jagged atboundaries because of the limited resolution of the mesh.

PLOT LIMITSSet limits for the plotted quantity. When Autoscale is active, PhiView automatically setslimits based on the range of values in the solution file.

ROTATE PLOTThis command is active only for the Filled contours 3D and Gradient plot 3D styles. You canrotate the plot in 90o increments for the best view.

The commands of the Export plot menu are used to generate hardcopy or to create plotfiles.

DEFAULT PRINTERWith this command, a PhiView plot can be ported to any installed Windows printer (includingnetwork printers, postscript drivers, PDF drivers...). Note that the current screen plot is sentto the default Windows printer. If necessary, change the default in Windows before runningPhiView.

SAVE PLOT FILEUse this command to create a graphics file of the current plot in either Windows Bitmap (BMP)or Portable Network Graphics (PNG) formats. In the dialog, specify the format, the size inpixels and the file prefix. The graphics file is created in the current directory.

COPY TO CLIPBOARDThe current plot is copied to the clipboard in Windows Metafile format. You can then pastethe image into graphics software.

6.3 Saving and loading views

The creation of plots for presentations may involve some effort. With the following two com-mands, you can save all the current view parameters and immediately restore the plot.

SAVE NAMED VIEWSave the view parameters for the current plot. Quantities such as the slice axis, slice positionand zoom limits are saved for two dimensional plots. Parameters for three-dimensional plotsinclude the viewpoint position, displayed regions and cut planes. The information is stored ina text file in the current directory with a name of the form FPREFIX.FPV.

42

Page 43: HiPhi 4 - ASL

LOAD NAMED VIEWLoad a view file and refresh the plot. Note that you must be in the appropriate plot menu toretrieve a view. Views of plane plots must be loaded to the Plane Plot Menu.

The file contains the complete set of plot parameters. This excerpt illustrates the format:

Program: AMaze

2D/3D: 2D

DisplayBy: Regions

Outline: On

NSlice: 40

SliceAxis: YAxis

PlotType: LogElemUp

XPMin: -1.500000E+00

XPMax: 4.250000E+00

...

If a specific solution file is loaded, the plot will be restored exactly. The saved view feature inPhiView has two useful features if a different meshes are loaded:

• Dynamic adaptation to different solutions.

• Option for user control of the view parameter set.

Regarding the first feature, there are situations where you want to create consistent viewsof a set of solutions with different geometries, maintaining a similar appearance. Some plotproperties (like the viewpoint rotation matrix) are applicable to any solution, but others (likeregion cut planes or slice plot limits) depend on the geometry. PhiView checks each plotparameter for validity. If a parameter is outside the allowed range for the currently-loadedsolution, the program computes an alternative. The goal is to preserve as many features of theview as possible.

You can modify view files with an editor. The order of entries is not rigid. On input,PhiView uses a free-form parser. If a parameter is missing, the program simply makes nochange from the value current in the program. The implication is that you can modify a savedview to include only elements essential to your application. For example, you could comparea series of assemblies with different sizes, maintaining an orthographic 3D view from the samepoint in Cartesian space. In this case, the view file would contain only the entries:

DView: 1.000000E+37

R11: 8.660253E-01

R12: -5.000002E-01

R13: 0.000000E+00

R21: 1.669031E-01

R22: 2.890846E-01

R23: 9.426408E-01

R31: -4.713208E-01

R32: -8.163510E-01

R33: 3.338061E-01

43

Page 44: HiPhi 4 - ASL

7 PhiView – numerical analysis

The commands of the Analysis popup menu are used to determine numerical values for thesolution. In the interactive mode, the menu is active only when a data file is open.

7.1 Automatic analyses operations

POINT CALCULATIONThe command brings up a dialog where you enter the x, y and z coordinates of any point inthe solution space. In contrast to the Point calculation command of the Slice plots menu, thepoint is not limited to a slice plane. When you click OK, PhiView displays an informationbox and also writes the results to the data file in the following format:

--- Point Field Analysis ---

Position: [ 3.0000E+00, 1.5000E+00, 7.4205E-01]

Region number: 3

Ex: 5.511018E+00

Ey: 2.770687E+00

Ez: 2.803520E+00

|E|: 6.775526E+00

Jx: 5.511018E+00

Jy: 2.770687E+00

Jz: 2.803520E+00

|J|: 6.775526E+00

Phi: 1.675318E-01

PowerDens: 4.590775E+01

Sigma: 1.000000E+00

The set of values depends on the quantities defined in the INTERPOLATION section of thecurrently-loaded configuration file.

LINE SCANIn the Analysis menu, scans may be performed along arbitrary straight lines between any twopoints in the solution volume. When you click the Line scan command a dialog appears inwhich you can specify the start and end points. Enter values in units set by DUnit. In otherwords, if you used dimensions of cm inMetaMesh and theHiPhi script contains the commandDUnit = 100.0, then enter the dimensions in cm. In the interactive mode, PhiView creates ascreen plot of a selected quantity determined by the Set scan quantity command. Features ofthe scan plot environment are discussed in Sect. 8.3. The following is an example of a listing.

44

Page 45: HiPhi 4 - ASL

------- Field scan between points -------

XStart: 5.0000E-01 YStart: 0.0000E+00 ZStart: 7.4205E-01

XEnd: 3.0000E+00 YEnd: 1.5000E+00 ZEnd: 7.4205E-01

X Y Z NReg

5.000000E-01 0.000000E+00 7.420529E-01 4

5.166667E-01 1.000000E-02 7.420529E-01 4

5.333333E-01 2.000000E-02 7.420529E-01 4

5.500000E-01 3.000000E-02 7.420529E-01 4

5.666667E-01 4.000000E-02 7.420529E-01 4

5.833333E-01 5.000000E-02 7.420529E-01 4

...

Ex Ey Ez

1.149979E+02 1.439398E+00 1.499865E+01

1.063150E+02 4.025448E+00 1.563426E+01

9.868382E+01 6.680476E+00 1.612934E+01

9.173597E+01 8.884391E+00 1.655349E+01

8.575326E+01 1.005728E+01 1.686338E+01

8.055398E+01 1.091353E+01 1.705007E+01

...

VOLUME INTEGRALSIn response to the command, PhiView performs volume integrals of quantities defined in theVOLUME section of the configuration file over all elements of the mesh. The calculations areintensive, so there may be a delay for large meshes. PhiView records results to the data filein the following form:

---------- Volume Integrals ----------

Global volume: 9.474960E-04

RegNo Region volume

========================

1 1.737214E-04

2 2.377571E-04

3 5.161524E-04

4 1.974895E-05

5 5.175411E-08

6 6.440011E-08

Quantity: Power

Global value: 3.158969E-02

RegNo Region volume

========================

3 2.063170E-02

4 1.005183E-02

5 9.061643E-04

The first table always shows the global and region volumes. Additional tables list results forquantities defined in the VOLUME section of the configuration file. In a dielectric analysis, theintegral is taken over the electrostatic field-energy density. You can use the energy values todetermine capacitance in a solution with a single electrode at voltage V0 from the equation:

45

Page 46: HiPhi 4 - ASL

Figure 20: Dialog to pick the region set for surface integrals.

U0 =C V 2

2. (12)

In Eq. 12 the quantity U0 is the global field energy. In a resistive analysis, the calculatedquantity is the resistive power density to yield the regional and global power (P0). You can usethe equation:

P0 =V 20

2R, (13)

for a single-electrode system to find the resistance.

SURFACE INTEGRALSIn response to this command, PhiView takes integrals of defined quantities over the selectedregion surfaces. The program displays the dialog of Fig. 20 which includes a row for eachregion along with the name assigned in MetaMesh and forwarded by HiPhi. Activate thecheck boxes in the Internal column to specify the regions to include in the set. The default isto include the full exterior surface of the region set (i.e., all remaining regions are External).Use the check boxes to specify External regions. For example, to take a surface integral overthe boundary between Regions 2 and 5, set Region 2 as Internal and Region 5 as External.

The calculated quantities are defined in the SURFACE section of the configuration file. For adielectric analysis, the surface integral gives the total charge on the region set:

Q =∫ ∫

Sǫrǫ0 E · n dA. (14)

The induced charge can be used to calculate mutual capacitances of a multi-electrode system.As an example of a region set, suppose we want to find the charge on an electrode with sharpcorners. A useful technique is to enclose the electrode in a vacuum diagnostic region with asimple shape. We then take the integral over the surface of the combined set that includes theelectrode and the diagnostic region. For conductive solutions, the surface integral is the netcurrent out of the region set.

46

Page 47: HiPhi 4 - ASL

Figure 21: Create matrix file dialog.

MATRIX FILEThis command controls a feature that is useful if you want to write your own analysis routinesor port results to mathematical software. In response to the command, PhiView performsinterpolations over a specified box region on a regular grid of values. It is much easier to useresults in this form than to deal with the conformal mesh directly. The command calls up thedialog of Fig. 21. Specify the dimensions of the box along each axis (in units set by DUnit)and the number of calculation intervals. To illustrate, calculations are performed at positionswith x coordinates given by

x = xmin +n (xmax − xmin)

nx

, (15)

where n = 0, 1, 2, ..., nx. For example, if you set xmin = 0.5, xmax = 1.5 and nx = 10, thecalculations are performed at points with x = 0.5, 0.6, ..., 1.4, 1.5. The recorded quantitiesdepend on definitions in the configuration file and the setting specified in the Recoded quantitiescommand. The interpolation routine returns zero if a portion of the box is outside the solutionvolume or inside an electrode. You can also specify an output file name. The format of thetext file is described in Chap. 13.

SCAN QUANTITYWith this command you can pick the quantity that will be displayed in screen and exportedplots of line scans. Pick the quantity from the list box and click OK. The listed quantitiesdepend on the entries in the INTERPOLATION section of the configuration file. This setting hasno effect on the data file listing which includes all values specified by the RECORDED QUANTITIES

command.

47

Page 48: HiPhi 4 - ASL

SET NUMBER OF SCAN POINTSThis command sets the number of line scan points in the screen plot and data file listing. Thedefault value is 150 and the maximum number is 500.

LSQ/LINEAR INTERPOLATIONSet the interpolation method for analysis and plots. The default is a second-order least-squares-fit procedure that uses data collected from nearby elements. Under the Linear option, onlynode values from the target element are included. This option is useful in tight spaces nearmaterial boundaries.

RECORDED QUANTITIESThis command determines the calculated quantities included in scan listings and matrix files.Under the option Field quantities, PhiView records the first three quantities defined in theINTERPOLATION section of the configuration file. The quantities are Ex, Ey and Ez in thestandard configurations. Use this option to export field tables to OmniTrak. Under the Fullset option, PhiView records all quantities defined in the configuration file.

7.2 PhiView analysis scripts

PhiView scripts are useful for automating complex or repetitive analysis procedures. Forexample, you may want to compare a line scan of values between two points in a set of similarsolutions. In the interactive mode, it would be necessary to type in the same coordinatesfor each scan. An analysis script can load each solution file, perform the scan and record allinformation in a single data file. In the PhiView main menu, the following commands in theFile popup menu (Sect. 6.1) apply to analysis scripts.

RUN SCRIPTPick and run a script file with a name of the form FPREFIX.SCR. The script can operate on thecurrently-loaded solution file or load a different file. The last solution file loaded by the scriptbecomes the current file for plots and interactive analysis.

CREATE SCRIPTUse this command to create an analysis script using the internal program editor.

EDIT SCRIPTUse this command to change an existing script with the internal program editor.

PhiView may be called as a command line task. The calling syntax is

[progpath\]PHIVIEW [scriptpath\]SPREFIX

where the script has the file name SPREFIX.SCR. You should supply the full path [scriptpath]

if the script is not in the current directory.Command line operation opens several possibilities.

48

Page 49: HiPhi 4 - ASL

• PhiView runs quickly and silently in the background when laucnhed from the CommandPrompt in a terminal window. To minimize typing, open the terminal in the workingdirectory. Use the DOS CHDIR command to change directories.

• The program may be called by DOS batch files with commands of the form

START /w [progpath]\PhiView [scriptpath\]SPREFIX

START [progpath]\PhiView [scriptpath\]SPREFIX

Use batch files to organize calculations that run autonomously. The option /w in the firstexample signals that the batch file waits for completion of the program to continue. Thisform is useful if data from PhiView is required for the next operation. Omit the optionif you want to launch several instances of PhiView to take advantage of a multiple-coremachine. Use the CHDIR command to set the working directory.

• Run PhiView as a subtask from your own compiled or interpreted programs. Oneapplication is to integrate finite element solutions and analysis into an optimization loop.

7.3 Script commands

Entries on a command line may be separated by the following set of delimiters: space, tab,equal sign [=], colon [:], left parenthesis [(] or right parenthesis [)]. Each command listed belowis shown in symbolic form along with an example of how they might appear in a script.

INPUT [datapath\] FileNameINPUT = E:\FEData\AprilRuns\HVCross.HOUClose the currently-opened solution file and load a solution file from the current directory. If[datapath] is not specified, the solution file must be in the working directory.

OUTPUT [datapath\] FileNameOUTPUT: WGUIDE1.DATClose the current data record file and open a new one. If a [datapath] is not specified, thefile will be written in the working directory. A data file must be opened to use the followinganalysis commands.

CONFIGURATION [datapath\] FileNameCONFIGURATION = C:\FieldP\AMaze30\PHIVIEW FORCE.CFGLoad a new PhiView configuration file to change the analysis characteristics. If a [datapath] isnot specified, the configuration file must be available in the working directory. If this commanddoes not appear, the program uses the current configuration or the one in force in the last run.

POINT xp yp zpPOINT = (0.00, 0.05, 4.67)Perform a point calculation and write values of the quantities defined in the INTERPOLATION

49

Page 50: HiPhi 4 - ASL

section of the configuration file to the data record file. Enter coordinates in the units set byDUnit.

SCAN xp1 yp1 zp1 xp2 yp2 zp2SCAN = (0.00, 0.00, 15.00) (12.00, 0.00, 15.00) Perform (NScan+1) calculations along aline in space. At each point, write the first NRecord quantities defined in the INTERPOLATIONsection of the configuration file to the data record file. Enter coordinates in units set by DUnit.

GENSCANPerform any number of calculations along an arbitrary path in space. At each point, write thefirst NRecord quantities defined in the INTERPOLATION section of the configuration file to thedata record file. The command must be part of a structure with the following form:

GENSCAN

xp1 yp1 zp1

xp2 yp2 zp2

...

xpn ypn zpn

END

Each data line contains three real numbers separated by spaces to define a point in the solutionvolume. Enter coordinates in units set by DUnit.

VOLUMEINT [NReg]VOLUMEINTVOLUMEINT 8Perform a volume integral of quantities defined in the VOLUME section of the configuration fileand write the results to the data record file. If a region number does not appear, the integral istaken over the full solution volume. Otherwise, the integral extends over elements with regionnumber NReg. Volume integrals may take a long time, so use the region-number option if thereare several regions that are not of interest.

SURFACEINT Reg1 Reg2 ... RegNSURFACEINT 5 7 9 12Perform a surface integral of quantities defined in the SURFACE section of the configurationfile and write the results to the data record file. Positive integer values correspond to Internalregions and negative to External regions. With no specification, all regions that are not Internalare taken as External. The integral is taken over the surface facets between any Internal andExternal elements. The command may include any number of regions. The regions in theInternal set may or may not be contiguous. Note that PhiView does not include facets on theboundary of the solution volume in surface integrals.

50

Page 51: HiPhi 4 - ASL

MATRIX FileName XMin XMax NX YMin YMax NY ZMin ZMax NZMATRIX WGUIDE.MAT 1.00 1.00 10 10.00 2.00 10 2.00 12.00 20Write values calculated at an array of location to a data file in text format. The file is namedFileName and is created in the current directory. The real-number values xmin and xmax arethe limits of the listing volume along the x direction. The parameter Nx is an integer. Listingsare made at (Nx + 1) evenly spaced positions along x.

NSCAN NScanNSCAN = 100Set the number of intervals for line scans. The default is NScan = 150 and the maximum valueis NScan = 500.

RECORD [Field, Full]RECORD = FullSet the number of quantities to include in data files in response to the Scan and Matrix com-mands. The Field set (default) consists of Ex, Ey and Ez. Use this option to create data tablesfor OmniTrak. The Full set includes all quantities defined in the INTERPOLATION section ofthe configuration file.

INTERPOLATION [LSQ,Linear]INTERPOLATION = LinearSet the interpolation type to a multi-element least-squares fit or a single-element linear fit.

PLOT FSaveView FOutput Nx NyPLOT (XAxis3D VIEW001 800 600)Write a plot file based on data in the currently loaded solution. The string FSaveView is theprefix of the file FSaveView.FPV, a set of view parameters created with the Save view command(Sect. 6.3). The view file must be available in the working directory. The plot is saved in theworking directory. It is in Windows Bitmap format and has the name FOutput.BMP. Theintegers Nx and Ny give the width and height of the image in pixels. To optimize compatibilitywith graphics format converters, pick values that are multiples of 16 (e.g., 1024× 768).

ENDFILETerminate the analysis

51

Page 52: HiPhi 4 - ASL

Figure 22: Slice plot – filled-contour plot style.

8 PhiView – slice plots

8.1 Setting the slice view

Slice plots are two-dimensional plots that show the variation of quantities over a plane normalto one of the Cartesian axes. In contrast to plane plots, slice plots are based on the structureof the mesh projected to a slice plane. This structure may be complex for a conformal mesh.To facilitate the process, slices are constructed at discrete locations along the normal axiscorresponding roughly to the planes of the foundation mesh. The precise rendering of meshinformation enables point-and-click analysis operations (point calculation, line scan, ...) in theslice.

The Change view popup menu contains commands to set the slice plane and to adjust thedimensions of the plot.

SET SLICE PLANE PROPERTIESThis command calls a dialog similar to that of the Set plane command in the plane plot menu(Fig. 18). You can change the normal axis, change the position along the normal axis, and setplot limits in the normal plane.

52

Page 53: HiPhi 4 - ASL

SLICE NORMAL TO XSLICE NORMAL TO YSLICE NORMAL TO ZQuick commands to change the normal axis.

JUMP FORWARDSTEP FORWARDSTEP BACKWARDJUMP BACKWARDMove along the slice axis by small or large steps. The small step is approximately one layer ofthe foundation mesh and the large step is 5 layers. The term forward implies motion towardhigher indices of the normal axis. The slider bar in the orientation area to the right of the plot(Fig. 22) shows the current location.

ZOOM WINDOWAs an alternative to the entries in the Set slice plane dialog, you can interactively change plotlimits in the normal plane using the mouse. Choose the command and move the mouse pointerinto the plot area. The status bar enters coordinate mode. It shows the current mouse positionin the plot. Use the left button to pick one corner and then move the mouse to create a viewbox. Click the left button again, and the plot regenerates. On any coordinate operation, pressthe F1 key if want to enter values from the keyboard. Note that the normal plane box in theorientation area to the right of the plot (Fig. 22) shows the dimensions of the slice plane andthe outline of the current zoomed view.

ZOOM INEnlarge the plot about the current view center.

EXPAND VIEWExpand the plot about the current view center.

GLOBAL VIEWEnlarge the plot boundaries to show the entire normal plane.

PANWhen the plot is zoomed, you can use this operation to shift the current view center. Use themouse to define relative start and end points for the shift.

8.2 Setting slice plot properties

The commands in the Plot control popup menu are used to set the plot style and mouse options.

SET SLICE PLOT STYLEThis command brings up the dialog of Fig. 23. The Region plot style is a cross-section view

53

Page 54: HiPhi 4 - ASL

Figure 23: Slice plot style dialog.

of the mesh element divisions color-coded by region. In contrast to the logical plane plot ofMetaMesh, PhiView attempts to resolve the exact mesh structure in the plane. In the Filledcontour style, the program determines discrete bands of color coding according to values of thecurrent plot quantity. The Contour style shows lines of constant values of the plot quantity.Finally, an Element plot has color coding by the average value of the plot quantity in theelement volume. When the Element outline box is checked, PhiView includes facets in theRegion and Element modes. In comparing relative advantages, the Filled contour plot providesthe most attractive and accurate display in extended field regions. Use the Element plot forthe best view of discrete field changes at the boundaries of electrodes and dielectric materials.The Contour plot is useful for checking field uniformity over a volume.

PLOT QUANTITYUse this command to set the quantity for color-coding in Filled contour and Element plots andline values in Contour plots. The choices depend on entries in the currently-loaded configurationfile.

PLOT LIMITSIn the Autoscale mode, PhiView chooses defaults for the minimum and maximum values forcolors and contours based on the range of values of the current plot quantity in the current slice.Deactivate Autoscale to set the values manually. The manual mode is useful for comparing fielddistributions between different slices.

RESET PLOTS TO DEFAULTReturn to the default view that applied when the solution was loaded

TOGGLE GRIDA set of dashed grid lines can be superimposed on slice plots. PhiView automatically choosesintervals and positions so that the lines occur at convenient values along the horizontal and

54

Page 55: HiPhi 4 - ASL

vertical directions (for example, 0.01 rather than 0.01153). Listings of the grid intervals areincluded in the axis labels. Grids corresponding to the normal plane axes are plotted as solidlines.

GRID INTERVALSThis command brings up a dialog to set intervals for grid lines in the horizontal and verticaldirections. Deactivate the AutoGrid box and enter real numbers in the boxes. The valuesshould be specified in the length units set by the DUnit parameter.

NUMBER OF CONTOUR LINESChange the number of lines for Filled contour and Contour plots.

TOGGLE SNAP MODEMouse coordinates for commands such as Zoom window, Pan, and Scan in slice may be enteredin two modes. In the normal mode, the returned position corresponds to the mouse position onthe screen. In the snap mode, the program picks a point at an even interval close to the mouseposition. The returned point depends on the value of the parameter DSnap. For example ifDSnap = 0.1 and the mouse is at position (6.2345,-5.6113), the returned position is (6.2000,-5.6000). The status bar displays the actual or snapped position of the mouse.

SNAP DISTANCEChange the value of DSnap from the default value determined by the program.

8.3 Analyses in a slice

You can determine field values at points and along scan lines with the commands of the Analysispopup menu.

POINT CALCULATIONThis command is useful to make quick checks of fields in the solution volume. After you click thePoint calculation command, move the mouse into the plot area. The mouse pointer changes toa cross-hair pattern and the status bar enters coordinate mode. Click the left button to specifya point or press the F1 key to enter the coordinates from the keyboard. Note that mousecoordinates will shift between discrete values if snap mode is active. PhiView calculatespotential and field values at the point in the normal plane given by the coordinates. Theincluded quantities depend on the crrently-loaded configuration file. The results are recordedif a data file is open.

LINE SCANLine scans are one of the most useful PhiView capabilities. After clicking on the command,supply two points with the mouse to define a scan line (or press the F1 key to enter coordinatesmanually). The snap mode is useful in this application (for example, you may want the scan

55

Page 56: HiPhi 4 - ASL

Figure 24: Scan plot display.

to extend from 0.000 to 5.000 rather than 0.067 to 4.985.) The program computes a seriesof values of field quantities in the normal plane at equal intervals along the line. Completeinformation is recorded if a data file is open. The program also makes a screen plot of thecurrently-selected quantity versus distance along the scan and activates the Scan plot display(Fig. 24). PhiView adds fiducial lines to the plot using intelligent grid selection. This meansthat the plot is adjusted to fill the screen and grids are drawn at useful intervals (i.e., 0.05 or2.00).

SET SCAN QUANTITYWith this command you can pick the quantity that will be displayed in screen and exportedplots of line scans. Pick the quantity from the list box and click OK. The listed quantitiesdepend on the entries in the INTERPOLATION section of the configuration file. This setting hasno effect on the data file listing which includes all requested field quantities.

SET NUMBER OF SCAN POINTSThis command sets the number of line scan points in the screen plot and data file listing. Thedefault value is 150 and the maximum number is 500.

8.4 Scan menu

As shown in Fig. 24, the current scan quantity is plotted as a function of distance from the startpoint. The coordinates of the start and end points are listed above the graph. Coordinates are

56

Page 57: HiPhi 4 - ASL

plotted in units set by the DUnit parameter. In the default mode, PhiView sets limits so thatthe plot fills the screen. The program includes grid lines at even intervals. The status bar atthe bottom lists the solution file, the data file (if open) and the grid intervals. The Export plotmenu includes that standard set of commands described in the previous chapter. The Settingsmenu contains the following commands.

SYMBOL DISPLAYToggle the plot display to either a thick line or a set of symbols at calculated points connectedby a thin line.

VERTICAL LIMITSOverride automatic selection and set vertical limits for the current quantity. To set manuallimits, uncheck the AutoScale box and enter real-numbers values for the lower and upper limitsof the plotted quantity. Check the Autoscale box to return to the default mode.

TOGGLE GRIDSuppress or activate the display of grid lines.

GRID INTERVALSOverride automatic selection of grid intervals. To set values for the horizontal and verticalgrid intervals, uncheck the AutoGrid box and enter real-number values. For the horizontaldirection, enter the interval in length units set by the DUnit parameter. Check the Autogridbox to return to the default mode.

OPEN DATA FILEIn the oscilloscope mode, you can record a variety of numerical values for the scan. Theinformation will be written to a data file if already opened. Use this command to open a newdata file.

CLOSE DATA FILEClose the current data file. This command should be invoked before attempting to use the filein another program.

OSCILLOSCOPE MODEIn response to this command, the scan plot becomes interactive with many of the featuresof a digital oscilloscope. The commands and tools of the Scan plot menu are deactivatedand PhiView displays the red cross-hair lines shown in Fig. 24. Values of the distance andplot quantity at the cross-hair intersection are displayed in the red box below the plot. Theintersection point follows the mouse when the cursor is inside the plot area. Note that theintersection moves discontinuously between the data points. To check points at the end of theinterval, move the mouse slowly toward the left or right-hand boundaries.

If a data file is open, PhiView records values at the current intersection point when youclick the left mouse button:

57

Page 58: HiPhi 4 - ASL

Scan point calculation

Distance: 9.506666E-01 (cm)

Phi: 0.384693E+04

Clicking the right button activates the pop-up menu shown in Fig. 24. The menu contains thefollowing commands:

Y VALUE TO CLIPBOARDCopy the value of the plotted quantity at the cross-hair intersection to the Windows clipboard.You can then past the number into a text document, spreadsheet or calculator program.

X VALUE TO CLIPBOARDCopy the value of the distance (in units set by DUnit) at the cross-hair intersection to Windowsclipboard.

XY VALUES TO CLIPBOARDCopy the values of the distance and plotted quantity to the clipboard. The x value is on thefirst line and the y value on the second.

DERIVATIVECalculate and record the numerical derivative at the intersection point. The dimensions aredetermined by the DUnit parameter. For example, if the scan quantity is potential in V andthe distance is shown in centimeters, the derivative has units V/cm. PhiView writes the valueto the clipboard and also displays the results in a dialog. If a data file is open, the programmakes a record like the following one:

Derivative

Location: 1.694667E+00 (cm)

Phi/(cm): 3.654382E+05

INTEGRALCalculate and record the definite integral of the plotted quantity from the start point of the scanto the cross-hair intersection point. The dimensions are determined by the DUnit parameter.For example, if the scan quantity is the electric field in V/cm and the distance is shown incentimeters, the integral has units (V/cm)-cm = V. PhiView writes the value to the clipboardand also displays the results in a dialog. If a data file is open, the program makes a record likethe following one:

Definite integral

Location: 1.908000E+00 (cm)

Phi-(cm): 9.679801E+03

EXIT OSCILLOSCOPE MODEActivate commands and tools and return to the standard Scan plot mode. You can also pressthe Esc key to exit the oscilloscope mode.

58

Page 59: HiPhi 4 - ASL

Figure 25: Tools to display vector information in the slice plot menu.

8.5 Slice vector tools

PhiView has useful tools to display the direction of the vector quantities E and j in slice plots.Figure 25 shows the corresponding entries on the toolbar.

E PROBEThis feature was inspired by the familiar Magnaprobe illustrated in Fig. 25. When you clickon the tool and move the cursor into the slice-plot area, it changes to a semi-transparent probethat rotates about a pivot point to show the direction of the electric field. The direction alsoapplies to the current density which is parallel to E in isotropic media. The probe functionsin all plot styles and may be combined with field-line traces and scatter plots. The status barshows the coordinates and |E| at the pivot point.

FIELD LINES AT POINTSUse this command to add lines of |E| projected to the slice plane. The program enters coordinateentry mode when you click the command. Move the mouse to a point in the solution volumeand click the left button. PhiView calculates the three-dimensional path of an electric fieldline that passes through the point and plots the projection in the slice plane. You can continueto add any number of lines. Click the right mouse button or press ECS to exit coordinate mode.The lines are not included in hardcopy or plot file exports and disappear if you change the sliceview. Use a screen capture utility to record them. It is important to recognize the nature ofthe plots. The lines are three-dimensional curves projected to the slice plane. They may bedifficult to interpret if the line does not lie close to the slice plane. For full three-dimensionalfield line plots, see the Field line plot file command in Chap. 9.

VECTOR SCATTER PLOTSuperimpose a uniform distribution of vector arrows pointing in the direction of B and H inthe slice plane (Fig. 26). Arrows may be added to any of the plot types, including Region.They are included in hardcopy and plot file export. The arrows are preserved and adjusted ifyou change the slice view.

59

Page 60: HiPhi 4 - ASL

Figure 26: Element plot with electric field vectors.

REMOVE VECTORSUse this command to turn off the vector scatter plot mode and to remove vector tool displaysfrom the current plot.

60

Page 61: HiPhi 4 - ASL

Figure 27: Three-dimensional surface view of region boundaries with color coding by electricfield magnitude.

9 PhiView – surface plots

Surface plots are three-dimensional views of the solution space (Fig. 27). Three types of infor-mation may be displayed: 1) boundaries of regions color coded by region number and shadedwith distance from the view, 2) region boundaries color coded by the values of computed quan-tities on the surface and 3) computed quantities in a slice plane normal to one of the Cartesianaxes. Slice plane plots may be superimposed on either of the region boundary plot types.Surface plots are created from the conformal mesh and preserve true spatial scaling.

The method to control the three-dimensional display with the mouse is the same as thatin MetaMesh. Figure 28 shows the active areas of the screen. The cursor changes as youmove between zones. The central zone (A) is used for zooming in (left button) and out (rightbutton). Hold down the left mouse button in zones B,C,D and E to walk around the object.Hold down the right mouse button in zones B,C,D and E to move the viewpoint to the right,upward, to the left and downward. Note that changes are reflected in the orientation box inthe upper-right portion of the screen. The plot is updated when you release the mouse button.You can control additional aspects of the three-dimensional view with the commands of theAdjust view popup menu.

SET VIEW DIALOGThis command brings up a dialog (Fig. 29) where you can set specific view angles, displacementsand the relative distance to the viewpoint, DV iew. The parameter DView controls perspective.Set it to a large value (DV iew ≫ 1.0) for an orthographic view. The minimum value is 1.5.

61

Page 62: HiPhi 4 - ASL

Figure 28: Active areas for mouse control of the 3D view.

Figure 29: Surface plot control dialog.

62

Page 63: HiPhi 4 - ASL

RESTORE DEFAULT VIEWThis command is useful if you loose your orientation after several rotations and translations.The view is returned to the default: θx = −30o, θy = 0o and θz = 45o with the origin at thecenter.

+X VIEW+Y VIEW+Z VIEWRotate to views from the +x, +y or +z directions. Origin shifts are not affected

CENTER VIEWRemove shifts by setting the origin to the center of the solution volume.

ORTHOGONAL/PERSPECTIVE VIEWBy default, PhiView includes perspective correction in surface plots. Click on this commandto move the view point to infinity. Click the command a second time to restore the view point.

The commands of the Plot control popup menu control the appearance of the plot.

SURFACE PLOT CONTROLThis command brings up the dialog of Fig. 30. The group of commands on the left-hand sidecontrols the plot style. A three-dimensional plot is constructed from color-coded facets. Thereare two types of facets: 1) element facets on the boundary of a region with color coding byregion number or the selected computed quantity and 2) rectangular facets comprising a sliceplane with color-coding by the values of the computed field quantity. Slice plane and regionboundary information may be superimposed. The Facet style radio buttons control whether thefacets of region boundaries are plotted as solid plates (hidden surface) or wireframe outlines.The Include facet boundaries check box determines whether the boundaries of region facetsare plotted in the hidden-surface mode. (Note that the facets of the slice plane are alwaysplotted as solids with no outline). PhiView plots a reference grid along the boundaries of thesolution volume when the Include reference grid box is checked. The group of commands onthe right-hand side controls the slice plane. The Include slice plane box determines whether aslice plot is included. The radio buttons determine the axis normal to the slice plane. You maymove the plane along the chosen axis by entering values in the box or moving the slider.

DISPLAYED REGIONSThe command brings up the dialog of Fig. 31 where you can pick region boundaries to includein the plot. Check a box in the Region column to activate a region. The buttons in the columnmarked Quantity determine the presentation style for boundary facets. If the box is unchecked,PhiView colors facets by region number. If a box is checked in the Quantity column, colorcoding is by the computed field quantity. The information window shows the correspondencebetween color and the quantity. Note that the field quantity is always calculated at a point near

63

Page 64: HiPhi 4 - ASL

Figure 30: Dialog to set the three-dimensional view.

Figure 31: Region display dialog.

64

Page 65: HiPhi 4 - ASL

the facet outside the chosen region. If a boundary separates regions with different materialsproperties, the displayed quantity values may depend on which region is chosen for display.

SET CUT PLANESIn a hidden surface plot, internal details may be obscured by surrounding parts or regions.This command brings up a dialog that allows you to adjust the displayed area along the x, yand z axes. PhiView does not display facets that lie outside the limits. With this feature youcan create cutaway views. The default is that cut limits are set equal to the dimensions of thesolution volume so that all facets are included.

SET SURFACE PLOT QUANTITYSet the quantity to be plotted on a slice plane or region facets. The choices depend on thethose defined in the currently-loaded configuration file.

SET PLOT LIMITSBy default the limits of the plotted quantity are automatically computed by PhiView. Withthis command you can set limits manually. Facets where the quantity is outside the set rangeare plotted in gray. The feature is useful for emphasizing a certain range of values (i.e., portionsof an electrode surface where |E| exceeds a value). The command is essential on occasions whena distorted element on a region surface leads to a inaccurate field interpolation, skewing theplot range.

FIELD LINE PLOT FILEYou can add three-dimensional electric field lines to three-dimensional plots with this command.To use it, you must prepare a text file that contains any number of point coordinates. PhiView

reads the file an adds field lines that pass through each point. The file consists of data lines,where each line contains three real numbers (x, y, z) separated by any of the standard delimiters.Enter the coordinates in units set by DUnit. The file may contain comment lines that startwith an asterisk and should end with the EndFile command. Lines are not plotted for targetpoints within fixed-potential regions or outside the solution volume.

RECORD FIELD LINE PLOTUse this command to record coordinates of calculated field lines. PhiView prompts for thename of an output file with a name of the form FNAME.FLP. A file extract is shown below. Thecommand functions only if a file of starting points has been opened with the Field line plot filecommand.

65

Page 66: HiPhi 4 - ASL

Electric field line plots for file: walkthru.HOU

DUnit(unit conversion factor): 1.00000E+02

Start point

X: 8.00000E+00

Y: 2.50000E-01

Z: 3.00000E+00

Forward

8.00000E+00 2.50000E-01 3.00000E+00

8.00599E+00 2.50385E-01 3.00003E+00

8.01197E+00 2.50768E-01 3.00006E+00

8.01796E+00 2.51151E-01 3.00009E+00

8.02395E+00 2.51532E-01 3.00011E+00

8.02994E+00 2.51912E-01 3.00014E+00

CLOSE FIELD LINE PLOTClose the field line plot file and remove field lines from the current plot.

66

Page 67: HiPhi 4 - ASL

10 Customizing PhiView

You can create configuration files to customize the operation of PhiView for your application.You can then switch between configurations for different types of analyses. PhiView is suppliedwith two default configuration files in the same directory as the executable program:

• phiview dielectric.cfg (analysis of dielectric solutions)

• phiview conductive.cfg (analysis of conductive solutions)

• phiview force.cfg (force and torque in dielectric solutions)

We recommend that you do not change these files. Instead, make a copy to use as a templateand rename it. You can put your new configuration file anywhere, but we suggest you store allconfigurations in the same directory as phiview.exe. Note that PhiView remembers the lastconfiguration used and attempts to reload it at the next run.

When you have created a template file, open it in an editor. Note that it is divided intothe ten sections shown in Table 10. With few exceptions, do not make changes to the sec-tions HEADER, STOREDQUANT REGIONQUANT, PROGPARAM, RUNPARAM and REALTIMEPARAM. Entriesin these sections coordinate the operation of HiPhi and PhiView. Modifications may causefile load errors.

10.1 Defining calculated quantities

You can define custom quantities for display and analysis in the last four sections of the con-figuration file:

• Interpolation. Scalar quantities for multiple uses: 1) displays in slice, plane and surfaceplots, 2) results of point and scan calculations and 3) values written to matrix outputfiles.

• Vector. Vector quantities for the display of field or flux lines in slice and surface plots.

• Volume. Scalar quantities for volume integrals over regions.

• Surface. Vector quantities for surface integrals over the boundaries of region sets.

Run speed is a critical issue in PhiView. The generation of a single slice plot may requireover 50,000 interpolations. To ensure fast operation, expressions for calculated quantities in theconfiguration file are written in reverse Polish notation (RPN). PhiView parses the functionstrings once while loading the configuration file and saves them in a coded form. Thereafter,operations are performed at the speed of compiled code. The following section reviews thebasics of RPN notation. Section 10.3 covers parameters and variables that may appear inexpressions. Section 10.4 reviews the form of the data sections.

67

Page 68: HiPhi 4 - ASL

Table 7: General organization of the PhiView configuration file

HEADER

Control parameters (Required)

END

STOREDQUANT

Stored quantities in the solution file (Required)

END

REGIONQUANT

Physical properties of regions (Optional)

END

PROGPARAM

Program parameters (Optional)

END

RUNPARAM

Parameters set by the solution program (Optional)

END

REALTIMEPARAM

Parameters set by the user (Optional)

END

INTERPOLATION

Calculated quantities for plots and data output (Required)

END

VECTOR

Calculated quantities for vector display (Optional)

END

VOLUME

Calculated quantities for volume integrals (Optional)

END

SURFACE

Calculated quantities for surface integrals (Optional)

END

ENDFILE

68

Page 69: HiPhi 4 - ASL

Figure 32:

10.2 Introduction to RPN

Consider the expression

5.0× 4.53 +[

9.2 + 0.6× 0.9(2+0.67)]

. (16)

Equation 16 could be represented in algebraic notation by the string:

5.0 * 4.5^3 + (9.2 + 0.6 * 0.9 ^ (2 + 0.67))

The rules for parsing such a string are involved, requiring an interpreter with recursive logic.The equation has the following form in RPN:

0.9 0.67 2 + ^ 0.6 * 9.2 + 4.5 3 ^ 5.0 * +

The string is parsed in strict order from left to right for expressions of any degree of complexity.A calculator with RPN logic uses the stack shown in Fig. 32. Numbers are pushed and poppedat the bottom. The first two stack registers have the special names X and Y . Three simplerules govern the evaluation of RPN expressions:

• If the entry is a number, push it on the stack.

• If the entry is a unary operator (exp, ln, sin,...), apply it to the number in the X register.

• If the entry is a binary operator (+,*,ˆ,...) combine the numbers in the X and Y registersand move the stack down.

The final result is given by the number remaining in the X register. By convention, the binaryoperators act in the following way:

• Addition(+): Y +X

69

Page 70: HiPhi 4 - ASL

• Subtraction (-): Y −X

• Multiplication (*): Y ×X

• Division (/): Y/X

• Exponentiation (ˆ): Y X

Reverse Polish notation eliminates all issues with regard to parsing order. Furthermore, it issimple to compile expressions. Entries are represented either by variables or operator codes.

10.3 Variables, operations and parameters

Expressions to define quantities in PhiView may contain numbers, unary and binary op-erations, standard variables, standard calculated quantities and parameters. The standardvariables are

$X, $Y, $Z, $NREG, $DUNIT

Note that the name of variables and parameters must start with a dollar sign. Calls to definedfunctions for plots, line scans and other operations are always made at a specific location inthe solution space. PhiView sets the current position [$X,$Y,$Z] before any calls are made.To illustrate, the following expression gives the distance from the origin in meters:

RDIST = $X 2 ^ $Y 2 ^ $Z ^ 2 + + @SQRT

The standard variable $DUNIT is a dimension conversion factor passed from the solution pro-gram. For example, suppose dimensions in MetaMesh were defined in centimeters and con-verted to meters for use in the solution program. In this case, an entry in the header of thesolution file would set $DUNIT = 100.0. The following expression returns the distance from theorigin in centimeters:

RDIST = $X 2 ^ $Y 2 ^ $Z ^ 2 + + @SQRT $DUNIT *

Unary operators have names that begin with ’@’. Table 8 lists the available set. The followingconsiderations apply with respect to the @CHS operator:

• You may include negative numbers (such as -3.1456 and -8.9E-09) in expressions. Thenumber -22.56 is equivalent to 22.56 @CHS.

• Expressions like -$Epsi0 and -&grady[3] that mix the binary operator with a variableare invalid. Instead, use forms like $Epsi0 @CHS.

The following quantities represent values from the electrostatic solution calculated at thecurrent position:

&Phi

&Ex

&Ey

&Ez

&EMag

&Q[N]

70

Page 71: HiPhi 4 - ASL

Table 8: Unary operators

Name Operation Comments

@SIN sin(X) Angle in radians@COS cos(X) Angle in radians@TAN tan(X) Angle in radians@ASIN sin−1(X) Returns angle in radians@ACOS cos−1(X) Returns angle in radians@ATAN tan−1(X) Returns angle in radians@EXP eX

@LN lnX@LOG log10(X)

@SQRT√X

@ABS |X|@EXCH X Y@OVERX 1/X@XSQ X2

@ENTER X ⇒ X, Y Copy X and push on stack@CHS X = −X

The names must begin with an ampersand. They are always followed by an integer in boxbrackets giving the number of the stored quantity. The quantity &Q[n] is the interpolatedvalue of stored quantity n at the current position [$X,$Y,$Z]. For a dielectric solution, &Q[1] isthe same as &phi, &Q[2] equals the relative dielectric constant ǫr and &Q[3] is the space-chargedensity ρ in coulombs/m3. For a conductive solution, &Q[2] is the conductivity σ in S/m and&Q[3] is undefined. The program performs the interpolation and replaces the symbol with itsnumerical value before evaluating the expression. The interpolation method depends on whetherthe stored quantity is of type Node or Element. PhiView performs detailed interpolations ofNode quantities. In the LIN mode, the program interpolates within the target element usingshape functions and values of the stored quantity at the eight nodes. In the LSQmode, PhiView

collects data from surrounding elements of the same region type and makes a least-squares fitto a three-dimensional, second-order function.

Expressions may also include parameters defined in the PROGRARAM section. The section inthe file phivie3w dielectric.cfg has this form:

PROGRARAM

$EPSI0 = 8.85E-12

END

The following expression for the electrostatic field energy in the interpolation section uses theparameter:

EngDens = &EMag 2 ^ $Epsi0 * &Q[2] * 0.5 *

You can define up to nine additional parameters in the PROGRARAM section. The name mustbegin with a dollar sign and may include up to 12 characters. A value in any valid real-numberformat follows the equal sign.

71

Page 72: HiPhi 4 - ASL

10.4 Setting up the calculated-quantity sections

The final sections of the configuration file define quantities for plots and calculations. Thereare four sections:

INTERPOLATION

QuantityName = Definition

END

VECTOR

QuantityName = Definition1;Definition2;Definition3

END

VOLUME

QuantityName = Definition

END

SURFACE

QuantityName = Definition1;Definition2;Definition3

END

The INTERPOLATION section may contain from zero to 50 quantity definitions. The VECTOR,VOLUME and SURFACE sections may contain a maximum of 20 quantity definitions each.

A definition line for a scalar quantity in the Interpolation section consists of a variable name,an equal sign and an RPN expression using the components discussed in the previous section.The following rules apply to quantity names in all sections:

• A name has a maximum length of 12 characters (the length is limited so that quantitynames will fit in plots and formatted output lists).

• Names may include characters, numbers and the underscore symbol. Names may notinclude spaces and other punctuation marks.

The RPN expression is a string (maximum length of 300 characters) with entries separatedby spaces. Here are some examples of quantity definitions:

EPERP = &EY @XSQ &EY @XSQ + @SQRT

LOGEXVCM = &EX 100.0 / @LOG

DX = &EX $Epsi0 * &Q[2] *

FIELDANGLE = &EY &EX / @ATAN $RADTODEG *

The last expression requires that the parameter

$RADTODEG = 57.2958

was defined in the PROGPARAM section. Note that the result of the division operator in theexpression is 0.0 if &EX = 0.0.

The order in which quantities appear in the INTERPOLATION section affects some operationsin PhiView.

• The first listed quantity is the default choice for Slice plots You can change the choice byentering a value in the SliceDisplay command in the HEADER. The integer is the order ofthe default plot quantity as listed in the INTERPOLATION section.

72

Page 73: HiPhi 4 - ASL

Table 9: Naming conventions in RPN expressions

Name form Functions

$NAME Program parameters$NAME Standard variables (e.g., $X)&NAME Special quantities calculated from the solution (e.g.,

&Ex)@NAME Unary operators in RPN expressions

• In dialogs for picking a plot quantity, the options are listed in the same order that theyappear in the configuration file. Therefore, you should put important quantities near thebeginning and specialized quantities near the end.

• The same order is followed in listings created by the Matrix file command. If you areexporting tables for use in OmniTrak, be sure that the first three quantities are Ex, Ey

and Ez.

Each quantity in the Vector section requires three expressions for the x, y and z components.The format for a definition line is

Name = (Expression x);(Expression y);(Expression z)

The line may contain a maximum of 500 characters. The component expressions are sepa-rated by semicolons. The following example defines the current-density vector in a conductivesolution:

JVector = &Ex &Q[2] *;&Ey &Q[2] *;&Ez &Q[2] *

The volume integral of a quantity Q over a region NR is given by∫

dx∫

dy∫

dz Q(x, y, z), (17)

where only those elements with region number equal to NR are included. You can define upto 20 quantities in the Volume section for integrals. The expressions should define quantitieswith dimensions of the form (quant/m3). For example, the power dissipated in a conductivesolution in units of W/cm3 is is

Power = &EMag 2 ^ &Q[2] * $DUnit 3 ^ /

Volume integrals use internal program coordinates in units of meters. Note that the quantity$DUNIT is used in PhiView only for display labels.

The surface integral of a vector quantity S over a region or a set of regions is given by∫ ∫

dA S · n, (18)

where dA is an element of area on the surface of the region set and n is a unit vector normalto the surface pointing out of the region set. You can define up to 20 quantities in the SURFACE

73

Page 74: HiPhi 4 - ASL

section for integrals. The data line for each quantity should contain the name, an equal sign,and three RPN expressions separated by semicolons for the vector components. The expressionsshould define quantities with dimensions of the form (quant/m2). As an example, a surfaceintegral of the following quantity would give the induced charge on the surface of a regionrepresenting an electrode in an electrostatic solution:

Charge = &Ex $Epsi0 * &Q[2] *;&Ey $Epsi0 * &Q[2] *;&Ez $Epsi0 * &Q[2] *

Note that quantity names must begin with special symbols if they are used in RPN expres-sions. Symbols for different quantity types are listed in Table 9. Therefore, quantity namesin the PROGPARAM section must include the dollar sign. Quantity names that are defined onlyfor display purposes need not include a special symbol. The includes quantities defined in theINTERPOLATION, VECTOR, VOLUME and SURFACE sections.

74

Page 75: HiPhi 4 - ASL

11 Force calculations in PhiView

11.1 Surface integrals for force and torque

If we knew the distribution of space-charge density ρ(x, y, z) and electric field E(x, y, z) overan object, we could find the force on the object from the expression:

F =∫ ∫ ∫

dV ρE. (19)

Volume integrals are not practical for calculating forces on electrodes and dielectric bodies.Here, the charge distribution is concentrated in an infinitely thin surface layer (compared to theelement size) and the electric field changes discontinuously at the surface. For this situation, thebest approach is to perform an integral of the Maxwell stress tensor over a surface that enclosesthe body. This process yields good numerical accuracy and can be performed automaticallyusing the surface-integral capabilities of PhiView.

The reference S. Humphries, Field Solutions on Computers (CRC Press, Boca Raton,1998), Sect. 10.5 discusses the physical basis of electromagnetic force calculations. The integralof force density over a volume can be converted to the following integral over the boundingsurface to give the total force F;

F =∫ ∫

S · n dA. (20)

where the quantity S is the tensor:

S =

S11 S12 S13

S21 S22 S23

S31 S32 S33

. (21)

The integral of Eq. 20 can be implemented in PhiView by adding the following vector defini-tions to the SURFACE section of the configuration file:

Fxs = [S11, S12, S13],

Fys = [S21, S22, S23],

Fzs = [S31, S32, S33]. (22)

Expressions for torque are more complex. A differential element of torque is defined by

dt = r× dF. (23)

Here, the vector r points from a torque origin [xt, yt, zt] to the current position:

r = [rx, ry, rz] = [(x− xt), (y − yt), (z − zt)]. (24)

The total torque corresponding to the force on a body may be written in terms of the Maxwellstress tensor as:

75

Page 76: HiPhi 4 - ASL

t =∫ ∫

r× (S · n) dA. (25)

To add torque calculations in the PhiView configuration file, we need to determine a torquetensor T such that the torque vector is given by a surface integral,

t =∫ ∫

T · n dA. (26)

We can compute T by expanding the right-hand side of Eq. 25 in component form and collectingterms with factors of nx, ny and nz. The procedure gives the following results:

T =

ryS31 − rzS21 ryS32 − rzS22 ryS33 − rzS23

rzS11 − rxS31 rzS12 − rxS32 rzS13 − rxS33

rxS21 − ryS11 rxS22 − ryS12 rxS23 − ryS13

. (27)

11.2 Expressions for electrostatic forces

The configuration file PHIVIEW FORCE.CFG includes definitions for force and torque calculationsusing both volume and surface integral methods. Volume integrals are useful for regions withnon-zero space charge ρ. The routines return zero values for dielectric bodies and electrodes.For reference, the volume-integral expressions for torque are:

τxv =∫ ∫ ∫

dV ρ(ryEz − rzEy),

τyv =∫ ∫ ∫

dV ρ(rzEx − rxEz),

τzv =∫ ∫ ∫

dV ρ(rxEy − ryEx). (28)

The Maxwell stress tensor has the following form for electrostatic forces:

S = ǫ0

ǫ0(E2x − E2/2) ǫ0(ExEy) ǫ0(ExEz)

ǫ0(EyEx) ǫ0(E2y − E2/2) ǫ0(EyEz)

ǫ0(EzEx) ǫ0(EzEy) ǫ0(E2z − E2/2)

. (29)

The quantity E2 in Eq. 29 is the field magnitude:

E2 = E2x + E2

y + E2z . (30)

Note that all field values are evaluated on the air/vacuum side of the object surface. Surfaceintegrals of force are calculated with the vector expressions of Eq. 22 while torque componentsare determined using the expressions of Eq. 27.

Figure 33 illustrates the logic of surface integrals in PhiView. If we have an assembly ofdielectrics and electrodes surrounded by an air volume, then we can take the integral of Eq. 20over any enclosing surface. One choice is the outer boundary of the assembly components(designated surface A in Fig. 33a). In this case, we evaluate electric field values in the airelements near the surface to ensure that the integral encloses all material charge ρm. We couldalso define an arbitrary surface by enclosing the assembly inside a special diagnostic air region(ǫ = ǫ0). The integral over the surface marked B in Fig. 33a gives the same result (to within

76

Page 77: HiPhi 4 - ASL

Figure 33: Surface integral of the electric stress tensor. a) Valid surfaces for an integral ofelectrically-active materials. A: region surfaces bounded by air elements. B: surface of an airregion that encloses the electric materials. b) Invalid surface for an integral. The enclosedmaterial current is undefined on the common boundary.

the numerical accuracy of field interpolations). The B surface (where the fields vary smoothly)is the better choice when the object has sharp edges. Figure 33b shows a case where the stresstensor integral does not give the correct result. In this case the integral extends over the surfaceof a dielectric/electrode region A that is in contract with another dielectric/electrode region (B).The field values inside region B along the common boundary include the effects of the surfacecharge of both regions. The calculation gives the force on region A plus an indeterminate portionof the force on region B. In summary, the following rules apply to electric force calculations:

• Electric forces act on electrodes and dielectric objects with ǫ 6= ǫ0.

• The surface integral of Eq. 20 over a region boundary gives the correct forces only if theregion is surrounded by air/vacuum elements (ǫ = ǫ0).

• Any integration surface in air/vacuum that encloses the region (or assembly of regions)yields the same net force.

11.3 Commands for force calculations

For a force calculation, load the configuration file PHIVIEW FORCE.CFG and click on the commandSurface integral of the Analysis menu. In the dialog, choose the region or set of regions ofinterest. Note that if one region is inside another, you must pick both regions so that theintegral is performed only over the outer surface. PhiView employs the following procedureto find the force on a single region. The program locates all elements within the target regionnumber and checks the six bounding facets. If the element on the opposite side of facet hasa different region number, then the facet lies on the region surface. (Facets on the boundaryof the solution volume or adjacent to an element with region number 0 are excluded.) Foreach facet, PhiView performs a 3× 3 Gaussian-quadrature integral using normal coordinates.At each point, the program calculates electric field values at a nearby location (x, y, z) in theadjacent element and determines the components of S. The program sets an error flag if anyadjacent element has ǫ 6= ǫ0. PhiView constructs a unit vector normal to the facet that pointsout of the target region. The program then forms the dot product for Eq. 20. Each segment

77

Page 78: HiPhi 4 - ASL

Figure 34: Geometry of example FORCETEST. The diagnostic region is not shown.

of the integral gives an increment of force dF. The sum of dF over the segments of each facetand over all facets of the region surface gives the total force. PhiView can also find the netforce on assemblies of adjacent electrically-active regions. In this case, the program identifiesall elements of the region set. Surface integrals are performed only over facets that border onelements with region numbers that are not part of the set. If the assembly is surrounded byair elements, the procedure gives the total force. To calculate force from an analysis script, besure that the proper configuration file is loaded and use the SurfaceInt command describedin Sect. 7.3.

11.4 Example

Figure 33 shows an example to illustrate an electrostatic force calculation. We want to find theforce between the four electrodes and the dielectric block (ǫr = 3.1) The dielectric has width inx of 70.0 µm and height in y of 60.0 µm. The electrodes have width 10.0 µm and height 6.0 µm.The gap in y between the electrodes and dielectric is 10.0 µm. All objects have length 100.0µm along z. A special diagnostic region (not shown in Fig. 33) has been included. It surroundsthe electrodes and has the properties of vacuum (ǫr = 1.0). The function of the region is toprovide a surface removed from the electrodes to perform the integral of the stress tensor (seepath B in Fig. 33a).

The input files for the example are FORCETEST.MIN, FORCETEST.HIN and FORCETEST.SCR.Figure35 shows the calculated equipotentials in a plane normal to z at the midplane of the

78

Page 79: HiPhi 4 - ASL

Figure 35: Calculated equipotential lines for the FORCETEST example in a plane normal to z atz = 0.0 µm. Dielectric: tan. Diagnostic region: cyan.

assembly (z = 0.0 µm). The analysis script is listed in Table 10. The command SURFACEINT

3 signals a stress tensor integral over the surface of the dielectric body. In response to thecommand SURFACEINT 2 4 5 6 7, the stress tensor integral is taken over the outer boundaryof the diagnostic region (Reg 2), excluding the internal boundaries with the electrodes (Reg 4,5, 6 and 7).

The results are recorded in the file FORCETEST.DAT. The surface integral over the dielectricregion yields Fy = −2.199 × 10−8 and the diagnostic region is Fy = 2.308 × 10−8 newton.As expected, forces in the x and z directions are effectively zero while the forces along y onthe dielectric and electrode have approximately equal magnitude and opposite directions. Thesecond calculation is more accurate because field values are continuous through the surface ofthe diagnostic region.

79

Page 80: HiPhi 4 - ASL

Table 10: File FORCETEST.SCR

* File FORCETEST.SCR

* NReg RegName

* =============================

* 1 VACUUM

* 2 DIAGNOSTIC

* 3 DIELECTRIC

* 4 ELECT01

* 5 ELECT02

* 6 ELECT03

* 7 ELECT04

* 8 BOUNDARY

CONFIGURATION = C:\FIELDP\AMAZE\PhiView_Force.CFG

INPUT = FORCETEST.HOU

OUTPUT = FORCETEST.DAT

* Dielectric

SURFACEINT = 3

* Electrodes and diagnostic region

SURFACEINT = (2 4 5 6 7)

ENDFILE

80

Page 81: HiPhi 4 - ASL

Figure 36: Benchmark example – geometry and definition of quantities (system is uniform in zwith a length Lz = 0.02 m).

12 Calculating mutual capacitance

Finite-element programs for electrostatics are useful for calculating mutual capacitance in amulti-electrode system. PhiView has several automatic calculation routines to facilitate theprocess. Because the user must exercise some care to ensure accuracy and physical validity, weshall review available methods in this chapter and work through an example. Figure 36 showsa benchmark calculation that gives good accuracy and runs quickly (input files MUTUALCAP.MINand MUTUALCAP.HIN). The geometry consists of two circular wires inside a grounded outerconductor with a circular inner radius. The enclosed volume is divided into two dielectricregions with ǫr = 4.0 and ǫr = 1.0. In this case, there are three unknown capacitance quantities:C10 (capacitance between Wire 1 and ground, C20 (capacitance between Wire 2 and ground)and C12 (mutual capacitance between Wires 1 and 2). The assembly is uniform along the zdirection with length Lz = 0.02 m.

One approach is to use the automatic surface integral routines in PhiView to find inducedcharge. To perform an integral, make sure the configuration file PHIVIEW DIELECTRIC.CFG isloaded and open a data file in the main menu. Then click on the command Surface integral

is the Analysis menu. Specify the region set over which integrals will be performed. PhiView

lists results on the screen and writes a record in the data file.To illustrate, consider the capacitance quantities in the example of Fig. 36. We create

Solution 1 with Wire 1 set to V1 = 1.0 V and Wire 2 to V2 = 0.0 V (Fig. 37). In PhiView

81

Page 82: HiPhi 4 - ASL

Table 11: Calculated quantities for example MUTUALCAP.

Sol V1 V2 Q1 Q2 Q0 U

1 1.0 0.0 2.13× 10−12 6.09× 10−13 1.53× 10−12 1.05× 10−12

2 0.0 1.0 6.09× 10−13 1.27× 10−12 6.67× 10−13 6.27× 10−13

3 1.0 1.0 1.52× 10−12 6.64× 10−13 2.20× 10−12 1.08× 10−12

Figure 37: Calculated equipotential lines for Solution 1.

we use the Surface integral command for Regions 1 (ground electrode), 4 (Wire 1) and 5 (Wire2). Table 11 shows the calculated surface charge values in coulombs. In the table, Q1 is thesurface charge on Wire 1, Q2 is the charge on Wire 2, and Q0 is the charge on the inside of theground electrode. Because we applied a 1.0 V drive, the numbers also equal the capacitance infarads. From the table, we can determine that C12 = 6.09 × 10−13 F and C10 = 1.05 × 10−12

F. To check accuracy, we can verify that Q1∼= Q2 + Q0. We next generate Solution 02 with

V1 = 0.0 V and V2 = 1.0 V. The results (shown in the second data row of Table 11) imply thatC12 = 6.09× 10−13 F and C20 = 6.65× 10−13 F.

The surface integral method works well in the example because we have used a fine meshfor good resolution of the curved electrode surfaces. The accuracy of the method declinessignificantly when electrodes have sharp corners where the electric field is effectively undefined.For these situations we can get better results with volume integral methods that are less sensitiveto local field interpolation errors.

For a simple two-electrode system, the volume integral of field energy is related to thecapacitance by

82

Page 83: HiPhi 4 - ASL

Table 12: Applied voltages for a three-electrode system with ground.

Solution V1 V2 V3

1 1.0 0.0 0.02 0.0 1.0 0.03 0.0 0.0 1.04 1.0 1.0 0.05 1.0 0.0 1.06 0.0 1.0 1.0

Ue =CV 2

2. (31)

We can use the Volume integral command in the Analysis menu of to perform a field energyintegral. In response, PhiView lists the global energy and components associated with differentregions. It is not difficult to extend this concept to multiple electrodes. For an applied voltageof 1.0 V, the global electrostatic energy U1 for Solution 1 is related to the capacitance valuesby

U1 =1

2(C12 + C01) . (32)

Similarly, the field energy for Solution 02 is

U2 =1

2(C12 + C02) . (33)

We perform a third solution where a 1.0 V potential is applied to both Wires 1 and 2. Here,the field energy is related to capacitance values by

U3 =1

2(C10 + C30) . (34)

Using the three equations, we can solve for the capacitance values in terms of the calculatedvalues of field energy:

C12 = U1 + U2 − U3, (35)

C10 = U1 − U2 + U3, (36)

C20 = −U1 + U2 + U3. (37)

Table 11 shows field energy values for the three solutions. The calculated values of capacitanceare C12 = 5.98 × 10−13 F, C10 = 1.51 × 10−12 F and C20 = 6.65 × 10−13 F. These values areclose to those determined by the surface integral method.

There are six unknown quantities for a system with three electrodes and a ground reference:C12, C23, C31, C10, C20 and C30. We can generate a set of six equations similar to Eqs. 37 withthe set of voltages shown in Table 12.

83

Page 84: HiPhi 4 - ASL

13 HiPhi file formats

HiPhi creates output files in binary or text format. The mode is controlled by the Formatcommand (Sect. 3.1).

• The default binary mode should be used for most applications. It gives the minimum filesize and preserves the full accuracy of the double precision numbers used in HiPhi.

• Use the text mode to port information to your own programs or if you want to inspectresults with an editor.

As in MetaMesh, nodes are referenced with the indices [I,J ,K] where I (the index alongthe x axis) extends from 0 to Imax, J (y axis) from 0 to Jmax, and K (z axis) from 0 to Kmax.The number of elements is approximately equal to the number of nodes. A single element(in the direction of positive x, y and z) is associated with each node for storage. Nodes andelements have integer region numbers to associate them with structures in the solution space.

The format of the HiPhi binary output file is simple and compact. The FORTRAN codeextract shown in Table 13 comprises the entire output algorithm. The header contains thefollowing elements:

• The 6-character string BINARY.

• The number of regions in the solution space, NReg (4-byte integer).

• A total of NReg 20-character strings giving the names of regions obtained from theMetaMesh input file.

• A total of NReg single-character strings, either I or E. The character I designates astandard material region that should be included in a PhiView analysis and E indicatesa fixed-potential that should be excluded.

• The mesh size parameters Imax, Jmax and Kmax (4-byte integers).

• The quantity DUnit, the unit conversion factor associated with the solution (doubleprecision, 8-byte real).

The next step is to record information for each node. The quantities RegNo (the region numberof the node) and RegUp (the region number of the adjacent element in the direction of increasingI, J andK) are 4-byte integers. The coordinatesX,Y and Z (in meters) are 8-byte real numbersas are the following stored quantities:

• The electrostatic potential φ at the node in units of volts.

• The relative dielectric constant ǫr associated with the upper element.

• The space charge density ρ (in coulombs/m3) associated with the upper element.

84

Page 85: HiPhi 4 - ASL

Table 13: Code to create the HiPhi binary output file

! File type

Character6 = ’BINARY’

WRITE (OutField) Character6

! NReg

WRITE (OutField) NRegMax

! Region names

DO N=1,NRegMax

WRITE (OutField) Reg(N).RName

END DO

! Region status

DO N=1,NRegMax

IF (Reg(N).Fixed) THEN

Character1 = ’E’

ELSE

Character1 = ’I’

ENDIF

WRITE (OutField) Character1

END DO

! Mesh size

WRITE (OutField) IMax,JMax,KMax

! DUnit

WRITE (OutField) DUnit

! Node quantities

DO K=0,KMax

DO J=0,JMax

DO I=0,IMax

IF (.NOT.ElementEpsi(I+1,J+1,K+1,EpsiWrite)) &

EpsiWrite = DZero

IF (.NOT.ElementRho(I+1,J+1,K+1,RhoWrite)) &

RhoWrite = DZero

MC = M(I,J,K)

RegNoWrite = C(MC).RegNo

RegUpWrite = C(MC).RegUp

WRITE (OutField) &

RegNoWrite,RegUpWrite,C(MC).x,C(MC).y,C(MC).z, &

C(MC).Phi,EpsiWrite,RhoWrite

END DO

END DO

END DO

ENDIF

85

Page 86: HiPhi 4 - ASL

Table 14 shows the header and initial node data lines from an output file in text format(note that the node data lines have been broken for readability). Three region names are shownin the example. The names are strings up to 20 characters in length with no spaces. Each nameis followed by the character I (included) or E (excluded). The order of nodes is the same asthat of Table tab:outputcode. Real numbers are recorded in format (1P,E14.6).

Files created in response to the PhiView Matrix file are in text format and have a structuresimilar to that of Table 14. The files are useful to transfer information to your own analysisprograms and they are compatible with OmniTrak and FEVision. There are two differencesfrom the HOU file in text format. First, calculations are performed over a regular mesh atlocations

X(I) = Xmin + I∆x, (38)

Y (J) = Ymin + J∆y, (39)

Z(K) = Zmin +K∆z. (40)

where

∆x = (Xmax −Xmin)/Imax, (41)

∆y = (Ymax − Ymin)/Jmax, (42)

∆z = (Zmax − Zmin)/Kmax. (43)

Second, the set of calculated quantities depends on the choice in the the Recorded quantitiescommand. The set is [Ex, Ey, Ez] for the Field components option, where the electric field is inV/m. The quantities included under the Full set option depend on the PhiView configurationfile. The following quantities are included when operating under phiview dielectric.cfg:[Ex, Ey, E − z, |E|, φ, Ue, ǫr, ρ]. The units are volts for electrostatic potential φ, J/m3 for fieldenergy density and coulombs/m3 for space-charge density.

86

Page 87: HiPhi 4 - ASL

Table 14: Header and data extract showing the form of the HiPhi HOU file under the Text

option and the PhiView matrix file

TEXT

NReg: 4

OUTERBOUND E

OUTERDIELECTRIC I

INNERDIELECTRIC I

INNERCONDUCTOR E

IMax: 102

JMax: 102

KMax: 102

DUnit: 1.000000E+02

RegNo RegUp X Y Z

======================================================

1 1 -5.100000E-02 -5.100000E-02 -5.100000E-02

1 1 -5.000000E-02 -5.100000E-02 -5.100000E-02

1 1 -4.900000E-02 -5.100000E-02 -5.100000E-02

...

Phi EpsiR Rho

==========================================

0.000000E+00 0.000000E+00 0.000000E+00

0.000000E+00 0.000000E+00 0.000000E+00

0.000000E+00 0.000000E+00 0.000000E+00

...

87

Page 88: HiPhi 4 - ASL

Index

batch file, 49binary file format, 84

calculated quantitiesspecial, 71standard variables, 70

capacitance, 45, 81charge conservation, 15command line, 48conductive solution

criterion, 14conductivity, 23conductors and ideal dielectrics, 14configuration file, 67

calculated quantities, 67order of quantities, 72sections, 67surface section, 74volume section, 73

current density, 15cutaway view, 65

derivative of scan, 58dielectric solution, 12

criterion, 14Dirichlet boundary condition, 14, 16, 24

electric force, 76electric stress tensor, 76

valid surface integrals, 77Eprobe, 59equipotential plot, 10

field energy, 45floating electrode, 15

Geometer, 5, 17grid control, 55

HiPhibatch file control, 34features, 4file format, 21, 84file types, 17large meshes, 35

learning, 4memory use, 35output file, 17reducing mesh size, 35running in background, 34running the program, 33script, 17, 18script dialog, 17setup dialog, 8

HiPhi commandsBoundary, 8, 24DUnit, 8Edit file, 33Edit listing file, 33Edit script, 33Epsi, 22, 29Format, 21InitVal, 21Interp, 22Manual, 34MaxCycle, 8, 20Mesh, 20NCheck, 21Omega, 9, 21Parallel, 21Pause run, 34Physical constants, 34Potential, 22, 28ResTarget, 20Restarget, 8Rho, 22, 29Setup, 33Sigma, 23, 29Start run, 34Stop run, 34Superposition, 8, 26Void, 23

insulator, perfect, 23integral of scan, 58

Laplace equation, 14

mathematical functions, 30

88

Page 89: HiPhi 4 - ASL

MetaMeshclipping, 8index conventions, 84output file, 17, 20script, 5, 17

names of quantities, rules, 72, 74Neumann boundary condition, 5, 16, 23

oscilloscope mode, 57

PhiViewanalysis script, 10, 17, 37batch file control, 49configuration file, 67data file, 39, 44, 45force calculations, 76interpolation methods, 44line scans, 44making plot files, 42matrix file, 47numerical analysis, 10, 44, 55plane plot type, 39plot types, 10printing plots, 42script control, 48slice plot type, 52surface plot controls, 61surface plot type, 61

PhiView commandSave reflected solution, 36

PhiView commandsClose data file, 39Copy to clipboard, 42Create script, 37Default printer, 42Derivative, 58Displayed regions, 63Edit data file, 39Edit file, 39Edit script, 39Eprobe, 59Expand view, 53Field line plot file, 65Field lines at points, 59Global view, 53Grid intervals, 55, 57

Instruction manual, 39Integral, 58Jump, 53Line scan, 44, 55Load named view, 43Load solution file, 36LSQ/LIN interpolation, 48Matrix file, 47Number of contour lines, 55Open data files, 39Orthogonal/perspective, 63Pan, 53Plot file, 42plot limit, 54Plot limits, 42Plot quantity, 40, 54Plot style, 40Point calculation, 44, 55Record field line plot, 65Recorded quantities, 48Remove vectors, 60Reset to default, 54Restore default view, 63Rotate plot, 42Run script, 37Save named view, 42Scan quantity, 47, 56Set cut plane, 65Set number of scan points, 48, 56Set plane, 40Set plot limits, 65Set slice plane properties, 52Set slice plot style, 53Set surface plot quantity, 65Set view dialog, 61Slice normal, 53Snap distance, 55Solution file information, 36Step, 53Surface plot control, 63Symbol display, 57Toggle grid, 54, 57Toggle snap mode, 55Values to clipboard, 58Vector scatter plot, 59Vertical limits, 57

89

Page 90: HiPhi 4 - ASL

Zoom in, 53Zoom window, 53

PhiView file commandCreate script, 48Edit script, 48Run script, 48

PhiView script commandConfiguration, 49GenScan, 50Input, 49Interpolation, 51Matrix, 51NScan, 51Output, 49Plot, 51Point, 49Record, 51Scan, 50SurfaceInt, 50VolumeInt, 50

Plot views, saving, 42Poisson equation, 12, 31

quantitiesorder, 72vector, 73

region, 5material properties, 22spatial variations, 28

relative dielectric constant, 12, 22resistance, 46resistive relaxation time, 14reverse Polish notation, 69rpn

binary operators, 69parsing rules, 69

script control, 48small-scale solutions, 23space-charge density, 12, 22spatial variations, 28

functions, 30tables, 30

special material types, 15surface integral, 73symmetry boundary, 36

text file format, 84

vector tools, 59volume integral, 73

90