Magnetostatic solutions: permanent magnets

As the final topic in two-dimensional magnetostatics, we’ll consider solutions with permanent magnets. To start, it’s useful to review how permanent magnets work. Introductory electromagnetic texts often don’t treat the topic, and the explanations in many specialized references are overly complex.

The electrons of many atoms carry a circulating current, like a small current loop. Such an atom has a magnetic moment , a vector pointing from the center of the loop normal to the current. The vector lies in the the direction of the magnetic flux density B created by the loop. The distinguishing feature of ferromagnetic materials is that the atoms prefer to orient their currents in the same direction (a quantum mechanical effect). A region where all atoms are aligned is called a domain. Figure 1:top shows the summation of aligned atomic currents in a domain. Currents on the inside cancel each other, so the net result is a surface current in the direction normal to the magnetic moment.

Domains and atomic currents

Figure 1. Top: alignment of atomic currents in a domain. Bottom: alignment of domains in unmagnetized material.

In the natural state of a ferromagnetic material, the orientation of domains is randomized so that there is no macroscopic field outside the material (Fig. 1:bottom). External fields would require energy to generate. Let’s say that we supplied that energy by placing the material inside a strong magnet coil. In this case, the domains line up and the current of all domains sum up as in Fig. 1:top. The domain currents cancel inside, but there is a net surface current on the object. If we turn off the coil, the domains of a soft magnetic material return to a random distribution. On the other hand, suppose we could physically lock the domains in position before we turned off the coil. In such a hard material, the object retains its surface current and can generate external fields. The energy for the field was supplied by the magnetizing coil and it was bound in the material. Such a object is called a permanent magnet.

The distinguishing feature of modern permanent-magnet materials like neodymium-iron and samarium-cobalt is that domain locking is extremely strong. The domains remain lined up, independent of external processes. This property makes it simple to model the materials. Let’s review some definitions and facts. The direction of the magnetic moments of the aligned atoms (and domains) is called the magnetization direction. Suppose we have a permanent magnet that is long along the direction of magnetization and self-connected (e.g. a large torus). In this case, there is no external field and the flux density inside the material is generated entirely by the surface currents. This intrinsic flux density is called the remanence flux, Br. A typical value for neodymium iron is Br = 1.6 tesla.

We can express the surface current density in terms of the remanence flux. Take Br as a vector pointing along the direction of magnetization and let ns be a vector normal to the surface of the permanent magnet. The surface current density is given by

Js = (Br × ns)/μ0 (A/m).  [1]

We can use PerMag to confirm this physical interpretation. Figure 2:top shows a calculation in cylindrical geometry for an annular permanent magnet in space (i.e., no iron, coils or other permanent magnets). The remenance field is Br = 1.5 tesla and the direction of magnetization is along z. The plot shows lines of B. According to Eq. 1, we would get the same results by replacing the permanent magnet with thin surface current layers. By the properties of the cross product in Eq. 1, there should be no current on the ends and uniform current density Js = 1.193 Ma/m on the inner and outer radial surfaces. In the second model (Fig. 2:bottom), the permanent magnet is replaced by two thin solenoid coils (length = 0.08 m, thickness = 0.00125 m). The total current of the outer coil is 1.193E6*0.08 = 95470.0 A and the current on the inner coil is -95470.0, Figure 2:bottom shows that the calculated lines of B are indistinguishable from the permanent magnet calculation. For a quantitative check, we can compare scans of Bz along the axis. Figure 3 shows the results. The small difference is a result of the finite thickness of the layers.

Lines of magnetic flux density for an annular permanent magnet (top) versus equivalent surface current layers (bottom).

Figure 2. Lines of magnetic flux density for an annular permanent magnet (top) versus equivalent surface current layers (bottom).

Scans of By(x,0) for an annular permanent magnet versus equivalent surface current layers.

Figure 3. Scans of By(x,0) for an annular permanent magnet (line) versus equivalent surface current layers (red symbols).

If permanent magnets are that simple, where could confusion arise? Unfortunately, things are more challenging when we talk about older materials like Alnico. Such materials are characterized by a demagnetization curve. The curve is usually a plot of B inside the permanent magnet versus H, where H is the applied magnetic field that arises from coils and other permanent magnets. It is easier to see the meaning of the curve if we make the plot in terms of the applied magnetic flux density, B0 = μ0*H. Applied fields have no effect on a modern materials. Therefore, the total flux density inside the material is simply

B = Br – B0.  [2]

Figure 4a shows a plot. The value of applied magnetic field where B = 0.0 is called the coercive force Hc. For modern materials, the coercive force is

Hc = -Br/μ0.  [3]

Demagnetization curves for modern (a) and older (b) permanent magnet materials.

Figure 4. Demagnetization curves for modern (a) and older (b) permanent magnet materials.

It is clear that neither the demagnetization curve or the coercive force are particularly meaningful for materials like NdFeB. On the other hand, the concepts are useful for older materials. Here, the domains are not tightly locked. Putting such a magnet in a device with an air gap causes degradation of the alignment so that the total flux density falls below the ideal curve (Fig. 4b). PerMag can solve such problems, but it is important to clarify what such solutions mean. Suppose you bought an Alnico magnet that was magnetized at the factory and shipped with an iron flux return clamp (i.e., B = Br). If you could move it instantaneously to the application device, then the operating point calculated by PerMag would apply. On the other hand, if you removed the clamp during assembly so the permanent magnet was exposed to an air gap and possibly dropped it on the floor, then the material would have undergone an irreversible degradation and the fields generated would be lower than the numerical prediction. The only way to get the theoretical performance based on the demagnetization curve is to magnetize the material in situ. One big advantage of modern materials (beside their strength) is that they achieve the predicted performance, even if they are magnetized at the factory, shipped from China and moved to the assembly.

We’ll conclude with an application calculation, a bending magnet for an ion spectrometer. This is a long assembly, and we will do a preliminary 2D calculation in a cross section. Figure 5:top shows half the geometry (there is a symmetry plane with a Neumann boundary at y = 0.0 cm). The goal is to create a dipole field By in the air gap to bend ions moving in z in the x-direction. The arrow shows the magnetization direction of the permanent magnet (NdFeB with Br = 1.6 tesla). Two features ensure the maximum air-gap field for the given magnet surface currents:

The figure shows the calculated lines of B. Figure 6 shows a scan of By along x across the air gap. The field is strong but non-uniform, probably of little use in a spectrometer. Here, where we can take advantage of one of the properties of soft steel, field shaping. Consider the effect of adding a steel layer adjacent to the gap. Figure 5:bottom shows the change in lines of B. The steel shifts flux away from the center out to the edges of the gap. Figure 6 shows the effect on the field scan. With some sacrifice in the magnitude of the flux, the steel insert gives a working volume of approximately uniform field.

Application example, permanent-magnet ion spectrometer

Figure 5. Application example, permanent-magnet ion spectrometer. Top: bare magnet. Bottom: magnet with steel insert for field shaping.

Spectrometer application, scan of By(x,0)

Figure 6. Spectrometer application, scan of By(x,0) with and without the steel insert.

Footnotes

[1] Contact us : techinfo@fieldp.com.

[2] Field Precision home page: www.fieldp.com.

 

Magnetostatic solutions: when steel gets complicated

Material properties are the reason why magnetostatic solutions are generally more involved than electrostatic solutions. Dielectrics can usually be characterized by a single value of relative dielectric constant εr up to the point where they break down. On the other hand, magnetic materials do interesting things even at normal values of flux density B:

  • Magnet steels may exhibit variations of μr, with a drop to μr ≈ 1 at high field levels (saturation).
  • In permanent magnets, the domains are locked in place, almost independent of the applied field.

We’ll talk about how to model permanent magnets in the next article. Here, we’ll concentrate of non-linear magnetic materials.

First, some definitions. The quantity B0 is the magnetic flux density created by coils or permanent magnets. We’ll call B0 the applied flux density. In the absence of steel, the total flux density is B = B0. In the PerMag program, the relative magnetic permeability is defined as μr = B/B0. Therefore, μr = 1.0 in air or vacuum. In steel, the alignment of domains creates a material flux density that adds to the applied flux density, so that μr is greater than 1.0. As we saw in the previous article, the utility of steel follows from that fact that μr » 1.

Magnetic materials are characterized by curves of the form B versus B0 (or B versus H, where H = B0/μ0). If the variation is a straight line, then μr has a constant value and we say that the material is linear. Magnetic materials may exhibit linear behavior at low fields, but they always become non-linear at high fields (a few tesla). Equivalently, we can characterize materials with a plot of B versus μr. Figure 1 shows such a plot for Steel 1020, a common material for magnet cores. At low B, the value of μr is much greater than unity and varies considerably (i.e., the B-B0 curve is not a straight line). Physically, the curve implies that it takes some pushing to start aligning domains but things get easier when they begin to come around.

Plot of relative magnetic permeability versus B for Steel 1020

Figure 1. Plot of relative magnetic permeability versus B for Steel 1020.

A notable feature of the curve is that μr approaches 1.0 when all the domains are aligned. In this case, the material contribution to B does not increase as B0 gets larger, so that the slope B/B0 approaches unity. The flux density at which all domains are aligned is called the saturation flux density. For Steel 1020, the value is Bs = 1.75 tesla. PerMag can perform self-consistent calculations for non-linear materials using B-μr data. The program simultaneously adjusts the value of μr in elements based on the present value of B as it performs the iterative matrix solution of the finite-element equations.

Let’s begin a calculation. The first issue is whether the variations of μr below saturation will make a significant difference in the results. In other words, do we need to worry about getting the B-μr curve exactly right at low field values? To illustrate, we’ll use the example of the H magnet illustrated in Fig. 2. It has a planar rather than cylindrical geometry. Here, there are variations in x-y but the steel core and coils extend an infinite distance in z. Such a calculation is often a good approximation to the central section of a long dipole magnet for bending particle beams. Both sets of coils produce a upward-directed flux that is conducted by the steel to the air gap, the working volume.

Geometry and calculated lines of B in the cross section of an H magnet

Figure 2. Geometry and calculated lines of B in the cross section of an H magnet.

To start, we’ll address the question: how does the value of μr in the core affect the field distribution? We’ll use the command-line parameter method discussed in a previous article, assigning fixed μr values over the range 5.0 to 10,000 and comparing values |B| in the air gap. Before beginning, its useful to recognize that the solution of Fig 2 involves more work than is necessary. The solutions in each of the four quadrants are mirror images. Alternatively, we could seek a solution only in the first quadrant by applying appropriate symmetry conditions along the boundaries x = 0.0 and y = 0.0. Lines of B are normal to the boundary at y = 0.0. Here, we could apply the Neumann condition (the natural condition for a finite-element solution). Lines of B are parallel to the other three boundaries, implemented by the Dirichlet condition Az = 0.0.

Figure 3 shows a plot of By in the magnet air gap at the midplane (0.0,0.0) and edge (2.0,0.0) of the magnet as a function of μr. The relative magnetic permeability has a strong influence at low values but little effect for large values. We can understand what’s happening by inspecting Fig. 4, a plot of lines of B. The top illustration shows a solution with high μr. In this case, the low-reluctance core carries most of the flux. It flows up between the coils and returns across the air gap. A small fraction takes a short-cut around the outside of the outer coil (leakage flux). The reluctance of the air gap cause the flux to spread out to increase the cross-section area (fringing flux). Note that the lines of B entering and exiting the core are almost normal to the surface. In contrast, the lower illustration shows the case with low μr. In this case, the core has a high reluctance, increasing the leakage flux. A reduced fraction of the flux is transported to the air gap, hence the reduced value of By(0,0). Finally, we’ll consider why there is little change in the solution when μr changes by a factor of 10 between 1000 and 100000. The important quantity in finite-element magnetic field calculations is not μr, but γ = 1.0/μr. A value γ = 1.0 represents air, and a value γ ≈ 0.0 is characteristic of unsaturated steel or iron. Both 1/1000 and 1/10000 are close to zero, so the change in μr makes little change in the solution.

Variation of By as a function of relative magnetic permeability

Figure 3. Variation of By(0,0) [blue] and By(2,0) [red} in the H magnet as a function of relative magnetic permeability in the steel core.

Lines of B at high and low values of relative magnetic permeability

Figure 4. Lines of B at high and low values of relative magnetic permeability.

We’ll conclude with a full non-linear calculation for the H magnet. This is the script HMagnet.PIN that controls the PerMag calculation:

Mesh = HMagnet
Geometry = Rect
DUnit = 1.0000E+02
ResTarget = 1.0000E-09
MaxCycle = 8000
Avg = 0.05
Update = 20 500
* Region 1: AIR
  Mu(1) =   1.0000E+00
* Region 2: COREUPRT
  Mu(2,Table) = steel1020_permag.dat
* Region 3: COILUPRTIN
  Mu(3) =   1.0000E+00
* Low current
* Current(3) =   1000.0
* High current
  Current(3) =   10000.0
* Region 4: COILUPRTOUT
  Mu(4) =   1.0000E+00
* Low current
* Current(4) =  -1000.0
* High current
  Current(4) =  -10000.0
* Region 5: BOUNDARY
  VecPot(5) =   0.0000E+00
EndFile

Region 2 is the steel core. Instead of assigning a fixed value, the code reads the table of information plotted in Fig. 1. The coils are set up for two calculations at high and low current. The values of drive current were chosen to give solutions where the core steel is well below and well above saturation.

Because two iterative processes are adjusted simultaneously, program parameters must be adjusted to ensure solution convergence. Some experimentation may be necessary. Consider the following commands:

MaxCycle = 8000
Avg = 0.05
Update = 20 500

The quantity MaxCycle is the maximum number of iterations, set to a fairly high value. The quantity Avg controls averaging of μr values between cycles. The low value is used to avoid oscillations. Finally, the Update command states that μr should be recalculated every 20 iteration cycles and that the program should wait 500 cycles before applying corrections to ensure a good starting solution.

Figure 5 shows the variation of μr at low and high current. At low current (upper solution), the relative permeability exceeds 1000 over most of the core volume. The low values at the top reflect the fact that |B| is small and the elements are on the left-hand side of the curve of Fig. 1. An inspection of lines of B in Fig. 6(top) shows that they are contained mainly in the core. Lines outside the core are normal to the surface. The midplane field is By(0,0) = 0.2459 tesla. At high current (Fig. 6 bottom), many regions of the core are driven into saturation, particularly the vertical piece adjacent to the air gap. The figure shows enhanced fringing flux near the air gap. The central field value is By(0.0) = 1.484, only 6.03 times the field at one tenth the drive current. Note that the field lines near the air gap are not normal to the core surfaces, affecting the profile of B across the gap.

Figure Spatial variation of relative magnetic permeability in the H magnet solution

Figure 5. Spatial variation of relative magnetic permeability in the H magnet solution for low (top) and high (bottom) drive currents.

Lines of B in the H magnet solution

Figure 6. Lines of B in the H magnet solution for low (top) and high (bottom) drive currents.

 

In summary, this article addressed the following topics:

  • Typical variations of μr for soft magnetic materials.
  • Physical implications of the magnitude of μr, particularly as affects the reluctance of steel structures in magnets.
  • Reducing the run time of a solution using symmetry boundaries.
  • How to set up and to interpret non-linear solutions in PerMag.

The next article will discuss how permanent magnets work and how to build solutions for 2D permanent magnet devices.

Footnotes

[1] Contact us : techinfo@fieldp.com.

[2] Field Precision home page: www.fieldp.com.

 

Orphan elements issue resolved

Both our 2D and 3D mesh generators (Mesh and MetaMesh) must perform a critical task: identifying whether a point is inside complex closed boundaries defined by sets of line and arc vectors. The process is the core for assignment of elements to regions in Mesh. It is used in MetaMesh to assign elements to turnings and extrusions. Over the years, we have made considerable effort to ensure that the procedure is 100% accurate, an essential requirement when processing meshes of several million elements.

Nonetheless, we have observed an intermittent error that causes orphan elements — isolated elements with an incorrectly-assigned region number. Figure 1 illustrates the phenomenon in a 2D mesh. The problem is not fatal in this case because orphan elements are easily identified and the Mesh program has mechanisms to correct such errors. On the other hand, orphan elements are a major issue in 3D meshes (Figure 2). It is impractical to seek out all errors in a large mesh and to correct them manually. Isolated elements corrupt the surface-fitting procedures in MetaMesh. The program interprets them as a part of the region surface, resulting in highly distorted meshes.

 

Orphan elements in a 2D mesh

Figure 1. Orphan elements in a 2D mesh.

Orphan elements in a 3D mesh

Figure 2. Orphan elements in a 3D mesh.

It is always difficult to identify the causes of rare, isolated events. Fortunately, a recent consulting project gave us the lead we needed to eliminate the error. Figures 1 and 2 illustrate the geometry, a complex acceleration cavity defined by a large set of boundary vectors with a shaped vacuum insulator. We were able to identify the two features of the calculation that lead to orphan elements:

  • The boundary vectors were abstracted from a DXF file supplied by the customer.
  • The meshes required a large number of small elements (3.6 million for the 3D case)

We checked mesh generation for each region of the solution volume. Surprisingly, there was no problem with the main cavity, although it had a complex boundary defined by 33 line and arc vectors. The errors occurred when the vacuum insulator was included. The region had the following specification:

PART
 Region: VInsulator
 Name: VInsulator
 Type: Turning
  L     -2.38830    5.79000   -2.51603    5.64304
  L     -2.51603    5.64304   -2.51603    6.63104<<
  L     -2.51603    6.63504<< -0.93003    7.21754
  L     -0.93003    7.21754   -0.93003    6.32654
  A     -0.93003    6.32654   -2.38830    5.79000   -0.93003    4.07654
 End
END

I have added marks << to show the culprit — inconsistent dimensions between the end point of one vector and the start point of another. The DXF file we received had an error. The difference is so small that it would be difficult to recognize in a graphical editor.

This insight explains the existence of orphan elements. MetaMesh determines if an element is inside a turning or extrusion by sighting outward and counting intersections with the boundary vectors. If there is a hole in the outline, the sight line may pass through without intersecting a vector. In this case, the element is assumed to be outside. Even though the hole may be very small, with millions of elements there is a good chance that some will be in position such that their sight lines intersect it. This explains the geometric regularity for the occurrence of orphan elements in Fig. 2. The reason we did not observe the error in many tests is because we normally use the Drawing Editor of Mesh or the Boundary Editor of MetaMesh in Snap mode to construct outlines, ensuring perfect connections.

2D and 3D mesh generation is flawless when the boundary vectors of the vacuum insulator are changed to:

  L     -2.51603    5.64304   -2.51603    6.63104
  L     -2.51603    6.63104   -0.93003    7.21754

We have made the following changes to Mesh, Geometer and MetaMesh to prevent errors:

  • The tolerance for taking two floating-point numbers as equal has been tightened to 1/1000 of the width of the smallest element in the mesh.
  • In the past, the programs checked only the beginning and end points of a closed set of boundary vectors for a match. Now, the programs check every connection and stop with an error message if there is a mismatch. The error message reports which vectors do not connect to help the user correct the values.

The good news is that our previous efforts to improve element identification have been worthwhile. With a perfectly-connected boundary, the process is highly reliable.

Footnotes

[1] Contact us : techinfo@fieldp.com.

[2] Field Precision home page: www.fieldp.com.

 

Test magnetostatic solution: the role of steel in magnet design

To complete our study of the solenoid coil, we’ll proceed to a practical design by adding a magnet-steel shield. Here, the term magnet-steel designates a soft material with high relative permeability. The term soft means that the steel has a narrow hysteresis curve and with little permanent magnetization. In this article, we’ll concentrate on numerical methods rather than the physics of the materials. Chapter 9 of Finite-element Methods for Electromagnetics (available for download at http://www.fieldp.com/femethods.html) reviews the properties of ferromagnetic materials and how they influence numerical solutions. In summary, magnet-steel serves three functions in an electromagnet:

  1. High-μr materials act as conductors of magnetic flux with little expenditure of energy. The use of material atomic currents to carry the return flux of a magnet means that the real currents in the drive coil may be reduced.
  2. Ferromagnetic materials act as shields. Return flux prefers to flow through the steel, reducing the fringing fields of the magnet.
  3. The magnetic flux density B is constrained to lie almost normal to the surface of a material with μr » 1. Control may be exerted over field variations by shaping the surfaces of the steel.

The example will demonstrate these effects. The underlying assumption is that the fields generated by drive coils are low enough so that the ferromagnetic material is not driven into saturation. The next article discusses the nature of saturation effects and how to model them.

We’ll start with the magnetic solution for the bare cylindrical coil discussed in a previous article Test magnetostatic solution: simple coil with boundaries. The solution boundaries are zmin = -6.0 cm, zmax = 6.0 cm and rmax = 9.0 cm. To review, here is the corresponding Mesh input script BareCoil.MIN:

*  -------------------------------------------------------
GLOBAL
 ZMESH
  -6.00000   -4.50000    0.20000
  -4.50000    4.50000    0.10000
   4.50000    6.00000    0.20000
 END
 RMESH
   0.00000    5.50000    0.10000
   5.50000    9.00000    0.20000
 END
END
*  -------------------------------------------------------
REGION  FILL AIR
L     -6.00000    0.00000    6.00000    0.00000
L      6.00000    0.00000    6.00000    9.00000
L      6.00000    9.00000   -6.00000    9.00000
L     -6.00000    9.00000   -6.00000    0.00000
END
*  -------------------------------------------------------
REGION  FILL COIL
L     -3.00000    2.00000    3.00000    2.00000
L      3.00000    2.00000    3.00000    4.00000
L      3.00000    4.00000   -3.00000    4.00000
L     -3.00000    4.00000   -3.00000    2.00000
END
*  -------------------------------------------------------
REGION BOUNDARY
L      6.00000    9.00000   -6.00000    9.00000
L     -6.00000    9.00000   -6.00000    0.00000
L     -6.00000    0.00000    6.00000    0.00000
L      6.00000    0.00000    6.00000    9.00000
END
*  -------------------------------------------------------
ENDFILE

We’ll add an additional region to represent the external steel shield using the Drawing Editor of Mesh. Run tc.exe, set the Data folder to the location where you are working and launch Mesh. Use the tool or the command File/Load/Load script (MIN) and choose BareCoil.MIN. Then, use the tool or command Edit script/Edit script (graphics) to open the drawing editor. The vectors for the three regions are displayed and the current region is set to 3. Click the Start next region tool. We will add vectors representing the outline of the shield as Region 4. Click the Set snap mode tool to open the dialog of Fig. 1. For convenience, entered points will snap to the drawing coordinate system with a resolution of 0.5 cm.

Set snap mode dialog of the Mesh drawing editor

Figure 1. Set snap mode dialog of the Mesh drawing editor.

Click on the Line tool to enter a series of vectors to outline the shape shown in Fig. 2:top (brown lines). In the line entry mode, move the cursor to snapped locations and left-click on the start and end point of each of the ten vectors. Take care that they all connect and define a closed shape. Snap mode helps to ensure that the end point of one vector connects exactly to the start point of the next. When you have finished the last  vector, right-click the mouse to exit the line entry mode.

Top: adding a region in the Mesh Drawing Editor

Figure 2. Top: adding a region in the Mesh Drawing Editor. Bottom: checking the fill status.

Choose the command Settings/Region properties. Give the new region the name STEEL and check the Filled box (we want to assign a high value of μr to all the enclosed elements). Exit the dialog. To confirm that the vectors of the new region constitute a connected and closed set, click the Toggle fill display tool. The display of Fig. 2:bottom indicates valid filled regions.

Region properties dialog in the Mesh Drawing Editor

Figure 3. Region properties dialog in the Mesh Drawing Editor.

Finally, it is a good practice in electrostatic and magnetostatic solutions to group regions with fixed boundary conditions (electrostatic or vector potential) at the end of the Mesh script. Choose the command Settings/Region order. Check the box for STEEL and then click the Move UP button. Finally, click the Export MIN tool and save the revised data in the file SteelShield.MIN. Exit the drawing editor. Click the Load script (MIN) tool and load the new script. Process the mesh and then click the Save mesh (MOU) tool to create the file SteelShield.MOU.

Run PerMag, click the “1” tool and choose the new mesh file. The dialog is similar to that of the previous example, except for the new region. Fill in the values as shown in Fig. 4. Save the file as SteelShield.PIN and then generate a solution. To make a comparison, we need a solution without the steel. Here’s a quick way to create it. Choose the command File/Edit files and pick SteelShield.PIN. Comment out the specification for high μr (put an asterisk at the beginning of the line) and replace it with the value for air:

* Mu(3) =   5.0000E+02
Mu(3) =   1.00

Save the result as NoShield.PIN and exit the editor. Then generate a PerMag solution.

 

Set up PerMag solution dialog

Figure 4. Set up PerMag solution dialog.

We can find out a lot about the effect of steel by looking at a plot of lines of magnetic flux density B (Fig. 5). With no steel shield, the lines spread out over the entire external region and the solution is strongly influenced by the boundaries. With the shield, the return flux lines are conducted through the steel. In this case, fringing fields are small and the boundaries have almost no effect on the solution. As expected, B lines entering and exiting the steel are normal to the surface. The shield also contains lines axially and B is more uniform within the coil.

Lines of magnetic flux density B

Figure 5. Lines of magnetic flux density B. Top: No shield. Bottom: With shield.

Scans of magnetic flux density along the axis, Bz(z,0), give a quantitative comparison . Prepare and run the following analysis script:

NScan = 100
Output Shield_Analysis.DAT
Input NoShield.POU
Scan -6.0  0.0  6.0  0.0
Input SteelShield.POU
Scan -6.0  0.0  6.0  0.0
ENDFILE

Fig. 6 shows plots of computed values for solutions with the same coil area and NI product. The shield clearly improves axial containment of magnetic flux. A significant result is that field magnitude inside the coil (i.e., the working volume) is 38% higher. Alternatively, suppose the goal is to achieve a given central value Bz(0,0). The result of Fig. 6 indicates that the required NI product with the shield is only 73% that for the air coil, so the drive power would be cut almost in half. This effect reflects the fact that the coil need not supply field energy to support the return flux.

Scans of Bz(z,0) with and without the shield

Figure 6. Scans of Bz(z,0) with and without the shield.

The condition of a fixed value of μr applies if the atomic currents in the iron are proportional to the drive currents in the coil (i.e., the hysteresis curve is a straight line). Sometimes, the hysteresis curve may have a more complex variation. Even more important, there is a maximum value of atomic current in the material equivalent to alignment of all magnetic domains. At some value of coil current, the proportionality can no longer hold. The effect is called saturation of the magnetic material. The next article discusses how these non-linear effects are represented in PerMag. In particular, want to see when we should worry about details in the variation of μr and the affects of saturation on field distributions.

Footnotes

[1] Contact us : techinfo@fieldp.com.

[2] Field Precision home page: www.fieldp.com.

Test magnetostatic solution: boundary effects and automatic operation

The previous article emphasized that finite-element calculations are performed in a finite volume and that conditions on the the boundaries must be specified. We use a Neumann condition (field lines normal to the boundary) along a symmetry plane. An example is one half of a magnetic mirror split at the midplane. Otherwise, the most common boundary is a Dirichlet condition (i.e., fixed vector potential), equivalent to a perfectly-conducting wall. Although the boundary would affect modeling a coil in infinite space, this does not represent a serious limitation on the finite-element method because practical magnets are designed to limit fringing fields.

This article has has three learning goals:

  • Quantify the effect of the Dirichlet boundaries in magnetostatic solutions.
  • Introduce the use of a variable-resolution mesh.
  • Set up an automatic calculation to do a parameter search.

We’ll continue with the cylindrical coil from the previous article. It carries a total current of 2500 A-turns uniformly distributed over the cross section, -3.0 cm ≤ z ≤ 3.0 cm, 2.0 cm ≤ r ≤ 4.0 cm. We start with close boundaries (-5.0 cm ≤ z ≤ 5.0 cm, 0.0 cm ≤ r ≤ 7.5 cm) and then expand them to see how the fields approach the infinite-space result. The element size should be relatively small near the coil, but we can use larger elements in the surrounding volume to minimize computational work. For the smallest solution, the foundation mesh definitions in the Mesh input script look like this:

GLOBAL
 ZMESH
  -5.0 -3.5  0.2
  -3.5  3.5  0.1
   3.5  5.0  0.2
 END
 RMESH
   0.0  4.5  0.1
   4.5  7.5  0.2
 END
END

The axial specification states that the initial triangular element base (before smoothing and fitting) is 0.2 cm in the zones -5.0 cm ≤ ≤ -3.5 cm and 3.5 cm ≤ ≤ 5.0 and 0.1 cm near the coil. Figure 1 shows the result. Note that Mesh has fitted the coil boundaries exactly and made smooth transitions between regions of different element sizes.

Variable resolution mesh for the magnet coil solution

Figure 1. Variable resolution mesh for the magnet coil solution.

To make useful comparisons of the numerical results, we need a baseline. A theoretical expression for the on-axis field at the midplane of a solenoid (z = 0.0 cm, r = 0.0 cm) with finite length and radial thickness is available on this website:

http://www.netdenizen.com/emagnet/solenoids/solenoidonaxis.htm

For the values Ni = 2500.0, r1 = 0.02 m, r2 = 0.04 and l = 0.06 m, the formula of Figure 2 gives the value Bz(0,0) = 0.037186 tesla.

On-axis, midplane field in the thick solenoid of finite length

Figure 2. On-axis, midplane field in the thick solenoid of finite length.

For the study, we will expand the boundaries (keeping rmax = 1.5 zmax) and compare the value of Bz(0,0) to the infinite-space result. We will use the following nine values for zmax: 5.0 cm, 6.0 cm, 7.0 cm, 8.0 cm, 9.0 cm, 10.0 cm, 12.50 cm, 15.0 cm and 20.0 cm. We could each do calculation interactively: create nine mesh scripts, run and analyze nine PerMag solutions. That’s the hard way. Field Precision programs offer a useful option for extended calculations. Batch files and external programs (e.g. python scripts) can not only run the technical programs, but they can also control how the program interprets variable quantities in the input script. The current application demonstrates how this works. The Mesh input script BatchControl.MIN is modified to the following form:

*  -------------------------------------------------------
GLOBAL
 ZMESH
   %1  -3.5  0.2
  -3.5  3.5  0.1
   3.5  %2   0.2
 END
 RMESH
   0.0  4.5  0.1
   4.5  %3   0.2
 END
END
*  -------------------------------------------------------
REGION  FILL AIR
L     %1    0.00000    %2    0.00000
L     %2    0.00000    %2    %3
L     %2    %3         %1    %3
L     %1    %3         %1    0.00000
END
*  -------------------------------------------------------
REGION  FILL COIL
L     -3.00000    2.00000    3.00000    2.00000
L      3.00000    2.00000    3.00000    4.00000
L      3.00000    4.00000   -3.00000    4.00000
L     -3.00000    4.00000   -3.00000    2.00000
END
*  -------------------------------------------------------
REGION BOUNDARY
L     %1    0.00000    %2    0.00000
L     %2    0.00000    %2    %3
L     %2    %3         %1    %3
L     %1    %3         %1    0.00000
END
*  -------------------------------------------------------
ENDFILE

Note the symbolic representation of the boundary limits, a convention familiar to users of Windows batch files. The symbol %1 represents zmin, %2 represents zmax and %3 represents rmax.

We prepare a Windows batch file with the following content:

START /B /WAIT C:\fieldp_pro\tricomp\mesh.exe C:\Simulations\BatchControl  -5.00   5.00   7.50
START /B /WAIT C:\fieldp_pro\tricomp\permag.exe C:\Simulations\BatchControl.PIN
START /B /WAIT C:\fieldp_pro\tricomp\permag.exe C:\Simulations\BatchControl.SCR
START /B /WAIT C:\fieldp_pro\tricomp\mesh.exe C:\Simulations\BatchControl  -6.00   6.00   9.00
START /B /WAIT C:\fieldp_pro\tricomp\permag.exe C:\Simulations\BatchControl.PIN
START /B /WAIT C:\fieldp_pro\tricomp\permag.exe C:\Simulations\BatchControl.SCR
START /B /WAIT C:\fieldp_pro\tricomp\mesh.exe C:\Simulations\BatchControl  -7.00   7.00  10.50
START /B /WAIT C:\fieldp_pro\tricomp\permag.exe C:\Simulations\BatchControl.PIN
START /B /WAIT C:\fieldp_pro\tricomp\permag.exe C:\Simulations\BatchControl.SCR
START /B /WAIT C:\fieldp_pro\tricomp\mesh.exe C:\Simulations\BatchControl  -8.00   8.00  12.00
START /B /WAIT C:\fieldp_pro\tricomp\permag.exe C:\Simulations\BatchControl.PIN
START /B /WAIT C:\fieldp_pro\tricomp\permag.exe C:\Simulations\BatchControl.SCR
...

The file seems verbose, but it is mainly copy-and-paste from a template prepared with the Create task button of the TriComp program launcher. The interesting lines are those that call Mesh. The first pass parameter is the input script name listed above. The three additional string parameters give numerical values for the variables %1, %2 and &3, multiple solutions with expanding boundaries. The two commands that follow call PerMag with the modified mesh and then execute the analysis script BATCHCONTROL.SCR. This file has the following content:

INPUT BatchControl.POU
OUTPUT BatchControl.DAT Append
POINT 0.0 0.0
ENDFILE

The Append specification in the second command ensures that all the data will be added in sequence to a single output file.

The full data set is generated in about two seconds by executing the batch file. The data are available as text entries in BATCHCONTROL.DAT. Figure 3 shows a plot of the results, exporting the numerical values to PsiPlot. The dashed line is the theoretical result from the equation of Fig. 2. The difference from the infinite space is about 10.4% for the close boundaries (zmax = 5.0 cm) and about 0.4% for the large boundaries (zmax = 20.0 cm). The next article discusses the role of steel in magnet design. In particular, we will improve the example solenoid, providing external shielding and minimizing the drive power needed to achieve a given internal field.

Results of the solution set

Figure 3. Results of the solution set.

Footnotes

[1] Contact us : techinfo@fieldp.com.

[2] Field Precision home page: www.fieldp.com.