|
|
The magnetic force on a vector current element dl carrying current I in a magnetic field with flux density B is
dF = I dl × B (1)
In Magnum applied currents are represented by a collection of filamentary elements, so you might think that it would be straightforward to implement automatic routines to find forces on drive coils. The problem is one of accuracy when the drive coils are the primary source of the field. The field varies rapidly around the filamentary elements so a simple integral using Eq. 1 may give misleading values.
On the other hand, there are situations where such an integral would be very useful. I recently had a consulting project where a strong permanent-magnet assembly exerts a force on a current loop. The loop carries less than an ampere and makes only a small contribution to the field. Accordingly, I recently added a routine for automatic coil-force integrals to MagView. The new command Coil force is in the File operations menu. Here’s how it works:
 Figure 1. Magnet assembly with diagnostic coil paths
1) Suppose you have a solution for a permanent-magnet assembly or an electromagnet and want to find the force on a coil inserted in the magnet volume. Load the solution into MagView with the File operations/Load solution file command.
2) Use Magwinder to define the sensor coil. It may be a simple rectangle (as in Fig. 1) or multi-turn shape of any complexity like a coil box. Assign a coil current of 1.0 A.
3) If you want to check the force at multiple positions, define multiple Coils in the CDF file with different values for the Shift and Rotate operations, as in Fig. 1.
4) Export an element file (WND).
5) Load the element file into MagView with the File operations/Load coils command.
6) Click on the Coil force command (note that the command functions only when both a solution and coil file have been loaded). The command shows a dialog with force components for each coil in the WND file and also write values to a data file if one is open. Here is an example listing:
--- Coil forces ---
NCoil Fx Fy Fz
===========================================
1 9.4794E-03 1.2813E-09 -3.9264E-06
2 8.9958E-03 -2.5137E-04 9.6336E-07
3 8.9808E-03 3.3423E-04 -2.9572E-06
If the diagnostic coils carry 1.0 A, the units of force are newtons/A.
My original intent was to write an article to show when it is necessary to use an eddy-current code to find time-varying magnetic fields and when a static field code like Magnum is sufficient. As a preliminary, I thought it would be useful to review how eddy currents affect magnetic fields in single wires. This tutorial has two purposes:
- Document useful general results on the effective resistance and ohmic losses in wires at high frequency.
- Show how to set up calculations of magnetic field distributions in wires with the two-dimensional code Nelson.
To start, let’s review some basic equations for a long wire with cross-section area Aw (m2) and conductivity σ (S/m). At low frequency, the current density is uniformly distributed across the wire and the resistance per length given by Eq. 1. If the wire carries an alternating current I0 cos(2πf t) at frequency f, Eq. 2 gives the time-averaged power dissipation.At high values of f, the magnetic field associated with the current flow is inhibited from penetrating the metal wire, concentrating the current density near the wire surface. The effective effective cross-section area of the wire is therefore smaller than Aw, increasing the resistance per length and the ohmic power loss for a given current. The penetration distance for magnetic fields, called the skin depth, is given Eq. 3. The quantity μ is the magnetic permeability, given by μ = (1.257E-6) μr, where μr is the relative magnetic permeability. The relative permeability equals 1.0 for most wire metals.

The skin depth allows us to define the high and low-frequency regimes. For a circular wire of radius rw, Eq. 4 gives the condition for enhanced ohmic losses. In the following calculation, we’ll use the example of a circular copper wire 1.0 mm in radius. The conductivity of copper is σ = 5.814E7 S/m. Using Eq. 3, the frequency corresponding to δ = 0.5 mm is 17.4 kHz. For a wire area Aw = 3.142E-6 m2, Eq. 1 gives the steady-state resistance R = 5.474E-3 Ω/m. For a drive current amplitude I0 = 1.0 A, the low-frequency power loss is P = 2.738E-3 W/m.
The program Nelson finds field magnetic distributions in the frequency domain — all quantities (including drive currents) vary harmonically at the same frequency. The input files to define the mesh and to control the calculation are circular.min and circular.nin. Figure 1 shows the mesh with dimensions in millimeters. The wire extends an infinite distance out of the page. The large air region was included so that the calculation could easily be modified for non-circular wires — the distant boundary has little effect on the magnetic fields inside a wire.
 Figure 1. Mesh for the Nelson circular wire calculation.
In the Nelson control script circular.nin, the boundary is a surface of fixed vector potential (flux conserving boundary) and the air region has μr = 1.0 and σ = 0.0 S/m. The copper wire has μr = 1.0, σ = 5.814E7 S/m and a drive current I0 = 1.0 A at a phase of 0.0°. The calculation of eddy currents in the wire uses the multistage, self-consistent method described in Chap. 4 of the Nelson manual. Figure 2 shows lines of B. At low frequency, |B| inside the wire increases linearly with distance from the axis, consistent with uniform current density. At high frequency, the magnetic flux density is concentrated on the surface.
 Figure 2. Lines of magnetic flux density in and around a circular copper wire at low and high frequency.
To make a quantitative comparison, we can use the automatic volume integral in the Nelson Analysis menu to find the total power dissipation per length along z. Results of calculations at several frequencies are plotted in Fig. 3. The theoretical steady-state value is shown as a dashed line. As expected, power losses increase significantly in the range 10-20 kHz. At high frequency, the current is confined to a thin layer on the wire surface. In this case. the power loss increases approximately as √f, proportional to 1/δ.
 Figure 3. Power dissipation per meter in a copper wire of radius 1.0 mm as a function of frequency with a drive current amplitude of 1.0 A.
It is important to recognize that the numerical results for the 1.0 mm copper wire may be applied to circular wires of any diameter or composition. It is not necessary to repeat the calculation for each special case. The strategy is to recognize scaling laws and to incorporate them into a universal curve. As an example, the green line of Fig. 4 plots the power level relative to the steady-state value as a function of the ratio of the wire dimension to the skin depth. There are two advantages to applying scaling laws:
- Generality – the graphed data may used to determine the effective resistance of any circular wire.
- Identification of trends – it’s evident that the power loss is proportional to 1/δ at high frequency.
 Figure 4. Universal curve for high-frequency wire resistance, power relative to the steady-state value plotted as a function of the wire dimension normalized by the skin depth. Circular and square wire cross sections.
As an example, suppose we have a 1/8″‘ diameter stainless steel rod and we want to find the frequency limit such that the power loss is no more than 50% of the low-frequency value. An inspection of Fig. 4 shows that δ must be greater than rw/2.5. With σ = 1.240E6 S/m and rw = 1.59 mm, the frequency corresponding to δ = 0.636 mm is f = 503.7 kHz. To check the result, I set up another Nelson calculation with modified wire radius and conductivity. For I0 = 1.0 A, the predicted steady-state power dissipation is 50.77 mW/m. The Nelson calculation gives 50.77 mW/m at f = 1.0 Hz and 76.28 mW/m at 503.7 kHz. The ratio of the two power levels is 1.50.
The results for circular wires could have been derived analytically with some effort. The true advantage of a numerical approach is that complex shapes are no more difficult to handle than simple shapes. To illustrate, I set up a run for square copper wires by changing the shape of the wire region in the Mesh input file. I used a wire with side lengths D = 2.0 mm. Figure 5 shows lines of B at high frequency. The universal power dissipation curve for square wires is plotted as the blue line in Fig. 4.
 Figure 5. Lines of magnetic flux density in and around a square copper wire at 40 kHz.
My consulting projects involve beam optics studies for a variety of devices: electron guns, transport solenoids, beam collectors,….. Typically, I develop optimal shapes for cathodes and internal electrodes and then send the information to the customer’s engineers who worry about external matters (power supplies, vacuum seals, high-voltage insulation, cooling,…). This process involves communicating dimensions.
In principle, all dimensions for calculations with EStat, PerMag and Trak are contained in the Mesh input script (MIN). On the other hand, it’s an imposition to expect the engineers to figure out the format. You could create a mechanical drawing, but there’s a quicker way to send full dimensional information: the DXF export function in the Mesh Drawing Editor. It’s documented in the Mesh manual, but people (including myself) tend to forget about it.
To create a DXF file, first load your MIN file into Mesh. Next, choose the Edit script (graphics) command to open the Drawing Editor. Then use the Export DXF command. It produces a standard DXF file that can be opened with the engineer’s favorite CAD program (AutoCAD, DraftSight,…). In a familiar environment, it’s easy to find dimensions.
The vectors for mesh regions are organized in layers with the names “0″, “1″, “2″,…. The “0″ layer is for reference lines. You can omit writing information from the region (or any other region) to the DXF file. Before exporting the file, click on Settings/Region properties and turn off the visibility of the regions to be excluded.
GamBet, our Monte Carlo code for X-ray science and technology, has always been ahead of competitors with regard to special features (I’ll mention some later). In the past other packages may have had more raw computing power. We advanced the number-crunching capability of GamBet last year when we introduced parallel processing (http://fieldp.com/myblog/2011/multicore-gambet/). With this feature, GamBet runs could utilize the full power of a single, multi-core machine.
We’ve taken another step forward to make GamBet the best program for power users. We now support distributed computing. Runs may be divided between an unlimited number of machines. Here’s how it works:
- The new GamBet Distributed-computing Extension (GDE) is an add-on package for GamBet or Xenos Pro. The package includes two programs, GB_SOW and GB_REAP.
- GB_SOW includes all technical features of GamBet. The program may be installed on any number of computers without a license requirement. GB_REAP is installed on a master computer with a GamBet license.
- The user sets up and tests a GamBet run using the standard programs. Then, the required input files (GamBet control script, mesh definition, electric or magnetic field files,…) are sent to the worker computers.
- GB_SOW is launched on each worker computer, either from a window or from the command line. Multiple instances of GB_SOW may run on multiprocessor machines.
- The GB_SOW run produces a single binary file with a unique identifying name that contains all information from the GamBet calculation (escape particles, dose, statistics,…). The user moves output files from the worker computers to a data folder on the master computer.
- GB_REAP identifies all binary input files in the specified directory and combines them to produce GamBet output files in standard format. These files may be analyzed with GBView2, GBView3 or GenDist. Escape particles are combined in a single escape file with appropriate weightings. Statistical and dose information is averaged.
In the procedure, the user’s only role is to transfer files to and from the worker computers. This leaves complete flexibility for configuring the distributed network and automating file transfers. Despite its simplicity, the GDE concept has several advantages:
- Calculations are independent and need not be synchronized.
- There is no overhead for parallel processing. Five quad-core computers can reduce the time to generate a required number of showers by a factor of 20.
- If one machine fails during the computation, data from the other computers is still valid and useful.
- It is easy to improve the accuracy of a calculation by adding more showers without starting from scratch. The user simply creates more worker-computer files. They are added to the master folder and the total collection is recombined with GB_REAP.
- Communication between computers is solely through file transfers. Therefore, it is easy to carry out extended calculations at any locations via a company network or the Internet.
While we’re on the topic of GamBet, it’s useful to review some other features that differentiate it from other Monte Carlo codes:
- 2D and 3D geometries are defined with powerful finite-element mesh generators rather than idiosyncratic solid-modeling algorithms. Advantages include the direct input of complex shapes from SolidWorks, ProE and other packages as well as extensive visualization options. The conformal meshes provide close fits to material surfaces.
- 2D or 3D calculated electric and magnetic field solutions may be imported for detailed electron dynamics.
- GamBet incorporates the Penelope 2006 physics engine for high-accuracy interaction calculations, from GeV energies down to less than 100 eV.
- Calculations of fields, electron beam dynamics and target heating are integrated with Monte Carlo simulations in Xenos, a comprehensive software suite for X-ray source development.
- GamBet features extensive graphical and quantitative post-processing capabilities for dose distributions and particle statistics.
The GDE package will listed in our catalog and available for purchase on March 30, 2012.
Many designs for electromagnets include a coil of the shape shown in Figure 1 wrapped around an iron mandrel with a rectangular cross section. The utility program Magwinder is used to define drive current elements for three dimension magnetic field calculations with the Field Precision Magnum program. In Magwinder, a coil box like Fig. 1 is constructed of four BAR type parts connected by four ELBOWR (elbow with a rectangular cross section) parts. The boxes must be rotated and translated from the their standard configurations to generate current in the correct position and direction, and the elbows must be shifted to the connecting positions. This involves some concentration and much busy work. Furthermore, the chances of error increase when there are multiple operations. In this article, I’ll describe resources that I created to automate the process and review the plotting capabilities in Magwinder to check the results.
 Figure 1. Definition of coil box parameters
Figure 1 defines the geometric parameters of the coil box:
- The coil cross section has width W1 in the x-y plane and W2 in z.
- The coil is approximated by N1 current filaments in the x-y plane and N2 filaments in z.
- The BAR models have length D1 in x and D2 in y.
- The ELBOWR models have inner radius R1 and outer radius R2 and extend 90°.
- I is the total current carried by the filaments.
In the standard position, the current flows in the x-y plane in the direction of positive θ (counterclockwise) when view from the +z direction. You can download the Magwinder sample input file coilbox_example.cdf which creates the structure for a specific set of parameters. The equations for the model parameters are listed as comment lines.
 Figure 2. Spreadsheet for automatic calculation of coil box parameters
I have also set up the spreadsheet shown in Fig. 2. To use it, fill in the parameter values and then copy and paste the cells starting at GLOBAL as text into a MagWinder script (CDF). Here is a link for a file for the OpenOffice spreadhsheet (coil_box.ods). If you enjoy purchasing office software, here is a link to an Excel file (coil_box.xls).
 Figure 3. Resulting current elements with polarity indicators projected to the x-y plane (N1 = 3)
Figure 3 shows the resulting assembly projected in the x-y plane. The plot illustrates the new Magwinder capability to display the polarity of current elements. They are represented as sperm cells swimming in the direction of the head. There are two ways to reverse the current direction.
- Use a negative coil current, I → -I.
- Rotate the COIL 90° about the x or y axis.
 Figure 4. Quadrupole assembly with four coil boxes
You can use the basic assembly multiple times in a Magwinder script. For example, Fig. 4 shows a quadrupole magnet. The standard text from the spreadsheet was pasted into four COIL sections, and then each coil was assigned a specific rotation and translation.
|
|