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

Math1 Compur. Model/kg, Vol. 1 I. pp. 192-196, 1988 0895-7 177188 $3.00 + 0.

00
Printed in Great Britain Pergamon Press plc

Mesh Generation for


Modelling in Magnetics
Zoltan J. Cendes
Electrical and Computer Engineering
Carnegie Mellon University, Pittsburgh, PA 15213

Edward C. Smetak and David Shenton


Ansoft Corporation, University Technology Development Center
4516 Henry Street, Pittsburgh, PA 15213

The Ideal CAED System


The ideal CAED system would provide the fol-
lowing capabilities:
Knowledge of electric fields and magnetic
fluxes is a prerequisite for the design of such 1. Both arbitrary and customized input. The in-
electromagnetic devices as motors, inductors, put requirements of the ideal CAED system
power converters, and permanent magnet ma- contain an apparent contradiction. On the
chines. The finite element method provides one hand, with one-of-a-kind applications, the
an ideal vehicle to solve the appropriate elec- CAED system must be completely flexible so
tromagnetic field equations in two and three that it can accommodate the many different
dimensions and provide detailed and accurate shapes and configurations employed in electric
simulations of the device performance. Au- machine design. On the other hand, in pro-
tomatic generation of optimal finite element duction situations, certain geometric configura-
meshes is a vital necessity for finite element tions are repeatedly employed to arrive at spe-
analysis packages. This paper presents an cific designs. In the first case, the ideal CAED
overview of the application of state-of-the-art system will accept arbitrary input; in the sec-
mesh generation techniques in computer-aided ond, it must be customized to fit the user’s ge-
design packages for electric machine design. ometry.

2. Invisible mesh generation. Whatever the geom-


etry and properties of the design problem, the
CAED system should be able to create a good
finite element mesh for it without user inter-
Introduction
vention. Further, the distribution of this mesh
The finite element method has long provided an
should be optimized so that the solution will
accurate and reliable simulation technique for elec-
be as accurate as possible. In fact, in the ideal
tric machine design. However, in the past, the com-
case, the program will automatically refine the
plexity of the procedure has limited the application
mesh until the solution is within acceptable er-
this sophisticated design tool to use by a few ded-
ror bounds and then inform the user of the ac-
icated specialists. To generate a usable design, an
curacy of the solution, all without necessarily
engineer would have to repeatedly input, analyze,
showing him details of the finite element mesh.
evaluate and modify the finite element model that
represents the design problem. Further, with tra- 3. Fast and accurate field solution. Speed and
ditional analysis procedures, considerable effort was accuracy are obvious attributes of any good
required to determine the performance characteris- CAED system. One may also add that flexi-
tics of a device from the field data calculated in the bility and robustness are essential.
finite element method at hundreds of mesh points.
4. Easy results interpretation. To evaluate de-
Thus while complicated finite element design proce-
signs, engineers often need to compute global
dures have been performed in the past at consider-
performance parameters such as inductance,
able expense, the future of computer-aided electro-
energy, force and efficiency. Simple methods
magnetics design (CAED) belongs to software tech-
for obtaining these derived quantities from com-
niques by which the complex requirements of finite
puted fields must be available. As is the case
element modeling can be made to appear to be sim-
with data input, many applications involve re-
ple to the user.
peated calculations with established formulas;
This paper presents a new methodology for
in other cases, flexibility is required to evaluate
CAED that greatly simplifies the design and analy-
one of a kind expressions.
sis process. It introduces new procedures for CAED
that takes the complexity out of finite element analy- These are ambitious requirements for a working
sis. By using these new procedures, the complicated CAED system, but ones that can greatly increase
aspects of finite element modeling are made invisible the productivity and effectiveness of electromagnetic
to the user. In using the new software, engineers are design engineers. As described below, to a great
free to concentrate their development efforts on the extent these requirements have been met by a com-
performance characteristics of the device that they prehensive electromagnetics design software package
are designing rather than on the details of the finite called Maxwell TM. Maxwell is based on the finite
element analysis procedure. element method and may be used to solve problems

192
Proc. 6th Int. Conf. on Mathematical Modelling 193

in electrostatics, magnetostatics, eddy currents, and


high-frequency em wave propagation. It is being
used presently in over one hundred fifty industrial
organizations and government laboratories to de-
sign electric machines, power converters, magnetic
recording heads, high voltage insulators, induction
heating equipment, electrical connectors, and other
electromagnetic devices.
Problem Definition
Flexible Innut
As noted earlier, in one-of-a-kind applications,
the input to the ideal CAED system would be like
drawing a sketch: the user defines the device ge-
ometry by drawing an outline of the device on the Figure 1- Preliminary input of the transformer con-
computer graphics screen using a mouse and sim- sists of entry of the core, keeper and a single primary
ple drafting commands. Mesh generation is then winding.
performed automatically regardless of the shape en-
tered. secondary winding by using the Enter command on
Maxwell accomplishes this sketchpad input in a the magnified screen. This winding is then selected
relatively straightforward way. Simple menu com- by using the Name Select command and five copies
mands are available for drawing straight line seg- created. The complete transformer cross section is
ments, circles, arcs, and compound curves. In the shown in Figure (2). Input for this problem on an
most common form of input, an equispaced grid is IBM PC required less than five minutes.
displayed on the graphics screen and the points en-
tered toggle to the grid points. This ensures that a
crisp drawing is produced: parallel lines are parallel,
matching objects match exactly, etc., when objects
are entered using the grid toggle mode. Fine detail
is most easily entered by zooming in at the appropri-
ate location and drawing the detail on the magnified
screen. Of course, to input exact coordinates one
may select the keyboard entry mode or, at times,
one may wish to use the free mode. However, it is
often easiest to enter the geometry completely in the
grid mode and then to subsequently alter point lo-
cations by using the Adjust Point command or to
use the constraint procedure described below.
It should be noted that in the design of rotat-
ing electric machines, it is convenient to replace the Figure 2 - Using the editing commands, the rest of
the transformer is easily entered using multiple copies.
common x-y grid by a polar or r,B grid. Also, electro-
magnetic devices often exhibit repeated structures The geometry input for a second, more compli-
such as teeth or windings placed at regular intervals; cated problem is shown in Figure (3). This figure
these structures may be translated along a straight shows the cross section of a permanent magnet ac
line or rotated about an axis. To easily input such motor. In this case, the input time required by an
repeated structures, Maxwell provides object edit- accomplished user was approximately 90 minutes.
ing capabilities. One may select an object or group
of objects by specifying its name or by placing the
object(s) in a box. Copies of the selected objects
may then be produced by using the Copy or the Ro-
tate commands. The number of copies created is
specified by the user.
As an example of geometry input, consider the
design of a high frequency transformer for dc/dc
converter applications. In this case, the problem ge-
ometry is axisymmetric, so that we need to enter
only one-half of the transformer cross section. We
do this by selecting the Enter command and draw-
ing the cross section of the core and keeper and of
the single primary winding as shown in Figure (1).

In this application, the windings are fabricated


by using a planar technology so that they are rela-
tively thin. To get the correct thickness, we zoom
in on each end of the winding in turn and use the Figure 3 - A more complicated problem is entered
Move Point command to reduce its dimension to the by combining the entry procedures in Maxwell .
proper value. At the same time, we create a single
194 Proc. 6th Int. Co@ on Mathematical Modelling

Custom Input is essential to understand that an arbitrary point


While the approach described above is ideal for set can be triangulated in enumerable ways. Some
one-of-a-kind solutions, it is often required to solve a of these triangulations contain well formed nearly
problem repeatedly by making changes in the geom- equiangular triangles while others contain very poor,
etry. In the past, this was sometimes accomplished thin triangles. The Russian mathematician Delau-
by creating a special purpose mesh generator for the nay proved in 1934 that of all possible triangulations,
particular structure to be studied; this custom mesh only one was optimal in the sense that it maximized
generator then allowed component dimensions to be the sum of the minimum angles of all the triangles.
modified relatively easily. As noted earlier, however, It is this optimal triangulation that we have em-
this approach requires a large programming effort ployed in finite element work’. Without getting into
with every design problem and is therefore extremely the mathematical details, it can be shown that this
expensive. approach will generally result in more accurate fi-
Fortunately, it is possible to create custom de- nite element solutions than is obtained by using ad
signed software in Maxwell by performing rela- hoc methods. More importantly still, the Delaunay
tively simple operations. First, Maxwell contains algorithm is robust in the sense that mathematical
a filing system by which objects and groups of ob- instabilities due to the presenc.e of extremely narrow
jects may be stored. Thus, once entered and saved, triangles is avoided. Thus, the use of the Delaunay
the transformer cross section in Figure (2) is avail- algorithm leads to stable and accurate solutions.
able for future use. Second, it is possible to add
dimension parameters to the geometry by which it
is possible to change the dimensions of the device.
Each of these parameters may be changed if de-
sired by specifying a new value for the parameter.
Third, it is possible to modify objects by means of
Maxwell ‘s Edit and File capabilities. For example,
it is usual to solve rotating electric machine prob-
lems several times to determine its operating char-
acteristics throughout a tooth pitch. The rotor and
rotor components are easily rotated to any angle in
Maxwell by selecting these components in the edi-
tor and by using the Rotate command.

Mesh Generation
Figure 4 - Parts of the refined mesh for the motor
Item 2 on our list of required features for the ideal shown in (3).
CAED system is invisible mesh generation. This is a
tall order. Not only is it required to produce a valid With regard to error evaluation, the procedure
finite element mesh for an arbitrary input geometry, used in Maxwell to compute the element by ele-
but this mesh must be automatically refined where ment error in the finite element solution is based
required to provide a correct and accurate field solu- on the underlying assumptions of finite element
tion. In the literature, a mesh generation procedure analysis’. Briefly, the idea is the following: In each
that is automatically refined to minimize the error in finite element used in Maxwell , the solution is ap-
the solution is known as adaptive mesh generation. proximated by a set of quadratic polynomials. The
The mesh generation strategy employed in values of these quadratics are determined by mini-
Maxwell is based on the following procedure: mizing a corresponding variational expression; once
evaluated, the approximate solution is plugged back
1. Take the arbitrary input geometry and extract
into the original partial differential equation. Since
from this geometry a minimal set of points that
this partial differential equation is second order, and
accurately reflects the essential problem char-
since the second derivative of each quadratic polyno-
acteristics.
mial is a different constant, the residual function ob-
2. Triangulate the points by using the Delaunay tained by this process is a constant in each element.
algorithm. It can be shown that in elements where this residual
is large, the error in the solution is large, while ele-
3. Solve the field problem using the existing trian-
ments with a small residual contain relatively small
gulation.
errors. By successively refining those elements hav-
4. Compute the error in each triangular finite ele- ing large errors, Maxwell is able to produce a mesh
ment. and corresponding finite element solution that is op-
timized to the particular problem being solved: the
5. If the error in each element is within acceptable
error in each element in the final mesh is very nearly
bounds stop; otherwise add a point in each fi- the same and is within acceptable limits regardless
nite element in which the error is too large and
of the problem geometry.
go to step 2.
The point to observe in the above adaptive mesh-
There are two aspects of this adaptive mesh gen- ing process is that it requires absolutely no user in-
eration strategy that bear further explaination. The put other than specifying the device geometry and
first is to explain the reason for using the Delaunay structure. Futher, the method is robust in the sence
algorithm; the second is to describe the procedure that it will always provide an accurate solution pro-
used to compute the error in the finite element so- vided that the memory in the computer is sufficient
lution. With regard to the Delaunay algorithm, it to permit the required mesh density. For these rea-
Proc. 6th Int. Conf on Mathematical Modelling 195

sons, it is ideal for design purposes because it allows element added to the mesh, this algorithm results in
engineers to concentrate on design issues. nearly linear solution times with respect to matrix
An example of a mesh produced by this process size.
is shown in (4). Here the transformer in Figure (1) Field solutions of the transformer in Figure (1)
has been meshed by using the Delaunay algorithm and of the motor in Figure (3) are shown in Figures
and the adaptive procedure described above. Notice (5) and (6) respectively.
that the mesh has been automatically refined around Notice that since we are using second order finite
corners and other critical regions. elements, plots of the flux lines are smooth. The
analysis of the transformer in Figure 5 required the
Field Solution assembly and solution of a complex matrix of order
Although all finite element methods share some 3675; this requires approximately ten minutes to do
common principles, many different methods for ap- on a Sun 3/50 computer. The magnetostatic analy-
plying these principles exist. For example, one may sis of the motor took about the same time.
use triangular, quadrilateral or isoparametric ele-
ments, use first order, second order or higher order r
polynomials to approximate the solution, evaluate
open boundaries by using integral equations or by
using modal basis functions, solve the resulting ma-
trix equation by using a sparse elimination proce-
dure or by using the pre-conditioned conjugate gra-
dient algorithm, and so on. In each case, the choice
to be made in the computer implementation will af-
fect the speed, accuracy and reliability of the CAED
program.
The finite element implementation in Maxwell
has been structured to give the best performance in
each case. The elements employed in Maxwell are
second order triangles since these elements have been
Figure 5 - The solution for the transformer.
found to give the best trade-off in terms of speed
and accuracy. Second order triangles are approx-
imately forty times more accurate than first order
triangles3 so that, in terms of accuracy, 500 second
order triangles are equivalent to roughly 20,000 first
order elements; yet the number of variables result-
ing from second order elements is only four times
that required for first order. The net result is a
ten-fold increase in accuracy for a given matrix size.
Further improvements in accuracy result by going
to third or fourth order elements, but the trade-off
here is not appealing: third order elements result in
a nine times the number of variables and thus pro-
duce large matrices even with small mesh sizes. Fur-
ther, with first and second order elements, the ex-
pressions required for finite element modelling can
Figure 6 - The solution for Figure (3).
3 .
be integrated analytically ; m the case of nonlin-
ear magnetostatics, third and higher order elements Results Evaluation
must be integrated numerically and this requires ad-
Although computing field solutions is an essential
ditional computation time. Overall, the use of sec-
step in modeling electric machines, it is by no means
ond order elements in Maxwell provides an excel-
the ultimate step in the CAED process. Most design
lent performance enhancement over standard first
issues revolve around secondary quantities derived
order programs.
from the field such as force, torque, heating and en-
A second major consideration affecting the effi-
ergy rather than the fields themselves. For this rea-
ciency of CAED programs is the approach used to
son, it is essential to be able to compute such derived
solve the sparse matrix equation that results in the
quantities in a simple and effective manner.
analysis. The traditional approach is to use the
The evaluation of derived or secondary quanti-
Gaussian elimination algorithm, either by storing
ties from field solutions is generally called post-
the profile of the matrix or by employing a frontal
processing in CAED. As is the case with data in-
technique. However, in this approach, the zero ele-
put, there are two conflicting requirements in post-
ments embedded within the profile of the matrix are
processing. On the one hand, the great range of
used in the computation; since the number of such
applications in electromagnetics implies that a very
zero elements grows quadratically with increasing
general system must be created to accomodate the
mesh size, this procedure is relatively inefficient. A
broad diversity of engineering calculations. On the
better procedure is to use the pre-conditioned congu-
other hand, certain types of calculations are often
jate gradient algorithm which requires only the non-
used repeatedly in specific product design evalua-
zero elements in the matrix to compute the solution.
tions; in these cases, it is best to employ simple menu
Since the number of non-zero elements in a finite el-
commands for their execution.
ement matrix is the same on average for every finite
196 Proc. 6th Int. Conf. on Mathematical Modelling

To accomodate these conflicting re-


quirements, post-processing in Maxwell is accom-
plished through two different mechanisms. An all
purpose calculator is used for problem-specific calcu-
lations while custom post-processing macros provide
facilities for calculations applicable to more general
classes of problems.
The All Purpose Calculator
The all purpose calculator built into Maxwell al-
lows any algebraic, differential or integral quantity
to be calculated from the field. In many ways, this
capability works like a pocket calculator except that
the quantities in the registers are complex field dis-
tributions instead of simple numbers. To get an idea
of how the Maxwell calculator works, let us eval- Figure 7 - The solution for the motor after an addi-
uate the the torque on the rotor of the permanent tional rotation of 10 degrees.
magnet ac motor shown in Figure (3). The torque
will be computed using the method of virtual work calculator commands in a macro. These macros can
as follows: be called directly from the main menu allowing the
Compute the coenergy for the solution pre- engineer to select the user defined commands induc-
sented in Figure (6) using tance, energy, etc.
Conclusion
This paper has demonstrated the use of an ad-
Coenergy = l?.gdn-- $I’. I?dn
J / vanced CAED tool which combines advanced engi-
neering analysis techniques with a usable interface.
Rotate the current distributions in the stator a
By combining automatic mesh generation with so-
small amount around the center of the motor.
lution error analysis, an adaptive system has been
Solve the new problem and compute the coen- developed which removes the engineer from most of
ergy. The flux solution for the new problem is the tedious steps involved in numerical analysis.
shown in Figure (7). These techniques, when placed within a usable
Compute the torque on the rotor as the differ- user interface, can now provide the engineer with an
ence in coenergies divided by the angle of cur- extrememely powerful analysis tool.
rent rotation. References
The complex integrals required to compute the
coenergies for the two solutions are easily obtained 1. B. Delaunay, Sur la sphLre uide, Bull. Acad.
using the powerful Maxwell calculator. The de- sci. USSR(VII), Classe Sci. Mat. Nat., (1934),
tailed operations required to compute the coenergies Pages 793-800
are as follows:
2. David Shenton and Zoltan Cendes, MAX -
1. Load B’ and g into the calculator. This is ac-
An Ezpert System for Automatic Adaptive Magnet-
complished by entering the commands B and
its Modeling, I.E.E.E. Transactions on Magnetics,
H, successively, into the calculator. These com-
Vol. Mag-22, No. 5, Pages 805-807
mands will cause the calculator to compute the
required derivative expressions from the vector P. P. Silvester and R. L. Ferrari, Finite Ele-
3.
potential A that has been evaluated in the finite
ments for Electrical Engineers, Cambridge Univer-
element solution process. These vector fields sity Press, (1983)
are stored in the four top registers in the stack.

2. Take the dot product of B’ and I?. This is ac-


complished by typing the command d. The re-
sulting scalar is stored in the top register in the
stack.

3. Employ a similar procedure to compute i& .


I?.
4. Subtract the two quantities. The resulting
scalar is now stored in the top register in the
calculator stack.

5. Integrate over all space by typing i. The re-


sulting intergral value displayed on the screen
is the coenergy.

Custo
m
The flexibility of the calculator is designed for
advanced calculations which are done infrequently.
Maxwell has the capability of storing sequences of

You might also like