Finite Element Method Magnetics
Introduction to FEA with FEMM
Source: Ian Stokes-Rees tutorial article with FEMM 3.3 as updated August 15, 2002 by Dr. David Meeker
Finite Element Method Magnetics (FEMM) is a freeware software package for 2D FEA of EM systems, including dynamic systems (with fixed frequency field or current variations). It is powerful and simple and therefore makes and excellent starting point for learning FEA. This discussion provides a three part introduction to FEA, using FEMM as the basis.
FEMM is a freeware package written by David Meeker. The homepage for the FEMM is located at: http://femm.berlios.de/
There is a mailing list related to FEMM with a homepage at: http://groups.yahoo.com/group/femm
Installation requires Windows 95, 98, NT, 2000, or XP and approximately 4 megs of hard drive space. It also works quite well on Linux using Wine but requires the MFC42.DLL. Computation time is reasonable for most problems, even on older Pentium systems. The number of elements is not limited, although the number of elements used affects the computation time. Finally, the 2D model to be analyzed can be designed in a CAD program and imported to FEMM in DXF format, but only 2D lines, arcs, and points will be translated.
Example 1: Basic Introduction
This will take you through a step-by-step process to analyze a block of iron sitting in a magnetic field. The following sections will develop some additional concepts. Users should first refer to the FEMM user's manual regarding the general interface (i.e. keyboard and mouse controls).
Select "nodes" from the tool bar (this is the farthest button on the left with a small black box: ) and place 4 nodes for the corner of a box (at, for example, (0,0), (0,1.5), (1.5,0) and (1.5,1.5) ). Then, create 4 nodes for the corners of a smaller box inside the large box (at, for instance, (0.5,0.5), (1,1), (0.5,1) and (1,0.5) ). One can place nodes either by moving the mouse pointer to the desired location and pressing the left mouse button, or by pressing the <TAB> key and manually entering the point coordinates via a popup dialog.
Select "lines" from the tool bar (second button from the left with a blue line: ). To select a node to be the endpoint of a line, click near the desired endpoint with the left mouse button. By selecting the nodes for the larger box in sequence, one obtains lines between each of the nodes and result in a large connected box surrounding the 4 internal nodes. Repeat the process for the internal nodes to create a small box inside a large box.
Add materials to the model
Select "Properties|Materials Library" off of the main menu. In the "Materials in Library" drop box that appears, select "Air" then click on "Add selected material to model". Repeat for "M-19 Steel". Click on "OK".
Define materials for each region
Now click on "Block Labels" (the tool bar button with green circles ), and place a block label in the inner box and one in the outer box. Like node points, block labels can be placed either by a click on the left mouse button, or via the <TAB> dialog. NOTE: If snap-to-grid is enabled then it may be difficult to place the block label in the empty space. If this is the case, disable snap-to-grid by de-selecting the tool bar button with the point and arrow.
Right click on the block label node for the outer box so that the node turns red, denoting that it is selected. Press space to "open" the selected block label. A dialog will pop up containing the properties assigned to the selected label. Set the "Block type" to "Air". Uncheck the "Let Triangle choose Mesh Size" checkbox and enter "0.1" for the "Mesh size". The mesh size parameter defines a constraint on the largest possible elements size allowed in the associated section. The mesher attempts to fill the region with nearly equilateral triangles in which the sides are approximately the same length as the specified "Mesh size" parameter. When the "Let Triangle choose Mesh Size" box is checked, the mesher is free to pick its own element size, usually resulting in a somewhat coarse mesh. Repeat the same for the inner block label node and set the "Block type" to "M-19 Steel".
Create Boundary Conditions
Select "Properties|Boundary" from the menu bar, then click on the "Add Property" button. Replace the name "New Boundary" with "Magnetic Field Source", and enter "1" (one) for the A_0 parameter. Make sure the other fields are all zero, and the BC Type (Boundary Condition type) is set to "Prescribed A". This means you have just defined a boundary condition of 1 Wb/m, but you have yet to assign this condition to a particular part of the model.
Repeat the above process but instead name the new boundary condition "Zero" which is a zero magnetic flux plane, and set A_0 to "0" (zero). Select "lines" from the toolbar then right click on the left side of the large box. When it turns red you have selected it. Now press space bar and the "Segment Properties" window will appear. From the top drop box change the segment type from "<None>" to "Magnetic Field Source". Repeat this process for the right side of the outer box, but set the segment type to "Zero".
Set Problem Characteristics
Select "Problem" from the menu bar and make sure the frequency is set to zero, the problem type is planar, and the length unit is set to meters. You may also add a comment to the file.
Generate Mesh and Run FEA
Now save the file and click on the toolbar button with yellow mesh: . This action generates a triangluar mesh for your problem. If the mesh spacing seems to fine or too coarse you can select block labels or line segments and adjust the mesh size defined in the properties of each object. Once the mesh has been generated, click on the "turn the crank" button to run the FEA algorithm over your model. Processing status information will be displayed. If the progress bars do not seem to be moving then you should probably cancel the calculation. This can occur if insufficient boundary conditions have been specified. For this particular problem, the calculations should be completed within a few seconds. There is no confirmation for when the calculations are complete, the status window just disappears when the processing is finished.
Click on the glasses icon to start FEMMView. In FEMMView, you can click on the purple shaded button to generate a color field intensity plot. When the dialog box comes up, select the "Show flux density" box, and accept the other default values. Click on "OK".
From this basic introduction you should have gained the following principles: • How to create your model space using nodes and lines. • How to add material types to your model and how to assign them to regions. • How to specify the finite element mesh size. • How to define a boundary for your model. • How to define and apply boundary conditions. • How to calculate and plot your results.
Example 2: Additional Concepts in FEMM
You will now create a model of a current carrying coil wire in an axisymmetric system with a better boundary condition. Imagine a 5 cm radius cylinder with a 1cm copper wire wound around it. We are going to model the field produced by this single turn of the coil using a better approximation of an infinite boundary condition (i.e. ideally, the field goes to zero at infinity, not at some relatively near artificial boundary).
1. First set the "Problem" properties to 0 Hz, axisymmetric, and units of centimeters. In this case, the vertical axis is the radial axis of the problem (or imagine it as a line of symmetry).
2. Change the "Grid Size" to 1, meaning each dot represents 1cm, and select snap-to-grid by pushing in the toolbar icon. Snap-to-grid allows points and block labels to be placed exactly on grid points using clicks of the left mouse button.
3. Find the r = 0, z = 0 point (the system origin). This may require zooming out. Place a node at the origin.
4. Place a nodes at (r,z) = (0,15), (0,-15), and (5,0), (6,0) (refer to the left side of the status bar at the bottom of the screen for a read-out of the current mouse pointer position).
5. Connect lines between (0,0) and (0,15) and (0,-15). This is the axis of rotation for this axisymmetric problem.
6. Select the arc toolbar button . Select the (0,-15) point (bottom point), then select the (0,15) point (top point). When the dialog box comes up, enter "180" for "Arc Angle". Arcs are drawn counter clockwise, so this will draw the right side arc between the two points and the arc will cover 180 degrees (half a circle).
7. Now select the (5,0) point followed by the (6,0) point, and enter "180" for "Arc Angle". Repeat in the opposite order to complete the top half of the circle.
8. Zoom in on the circle section by selecting "Zoom" then "Window" and draw a box around the circle.
9. Deselect "snap-to-grid" and place a block label (green node) inside the circle, and one outside the circle.
10. Add "Air" and "Copper" to the model materials using the "Properties-Materials Library" dialog box from the menu bar.
11. Select "Properties" then "Materials" from the menu bar and modify Copper. Change the "J_re, MA/m^2" box from "0" to "5", which corresponds to 5,000,000 amps per square meter current density, or 5 A/mm2, or approximately 390 A along a 1cm diameter wire.
12. Select the block label inside the circle by right clicking with the mouse near the green node. Change the "Block type" to Copper, and the "Mesh size" to 0.1 (since 0.1 of 1cm (remember base units are cm) equals 1mm, this is mesh size). Do the same for the outer block label node but assign it to "Air" and "Mesh size" to 1 (0.1 is too fine a scale for such a large region).
13. Click on the blank page toolbar button . This button causes the view to zoom out so that the whole page is visible.
Create Boundary Conditions
14. Select "Properties | Boundary" and then "Add Property". Rename your new boundary "Infinite Estimate" and change the "BC Type" to "Mixed". Given that the system under analysis is close to the center of an arc (usually either a full or half circle), "c0 coefficient" can be set to 1/(4 π r * 10-7) where r is the radius of the arc in meters. In this case, r = 0.15 m, so c0 = 5305165. All the other values should be zero (including c1 coefficient).
15. Select the half circle by right clicking on or near it (the "Arc" toolbar button must also be depressed). Press space and assign "Infinite Estimate" to "Boundary cond.".
Generate Mesh and Run FEA
16. Now perform the calculation and activate FEMMView to display the magnetic field produced by the current in the wire.
Note that the vertical side of the semi-circle boundary (along the radial axis) does not have any boundary condition assigned--a zero potential boundary condition is defined to the axis of rotation in axisymmetric problems by default. Also note how the magnetic field lines radiate through the outer arc boundary as if heading to infinity. This is due to the use of an impedance boundary condition on the outer boundary, which closely mimics the behavior of the coil in unbounded free space. More information on so-called "open" boundary conditions is available in the FEMM User Manual appendices. For comparison purposes, define a boundary condition with "Prescribed A" and set the A_x coefficients to zero. Name this "Zero" and change the arc properties from "Infinite Estimate" to "Zero" and compare the results. With a "Zero" outer boundary, no field crosses the outer boundary.
Two remaining areas that have not been covered in this tutorial are permanent magnets and bulk models of laminates. Both of these issues are addressed in the FEMM User Manual Appendices.