Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Magnetics and Electrostatics simulations with FEMM

FEMM stands for Finite Element Method Magnetics, and it is a nice software for solving magnetics and electrostatics problems.

I’ve known FEMM for at least a couple of years but I’ve never tried  it out and used it at its full power! Now the time has come to do that!

Image 1

In this post I’m going to present the results of the following simulations:

  1. A C shaped electromagnet (detailed results).
  2. The magnetic field of the rotor of a 4 poles synchronous machine (brief overview).

C shaped electromagnet

A C shaped electromagnet is pretty much what the name says: a C shaped bloc of iron or other ferromagnetic material with a coil wrapped around the body of the C. A C shaped electromagnet can be found, for instance, in a shaded pole motor. In FEMM we can easily model such simple geometry as follows


I’ve assumed that the core is made of pure iron and that the windings of the coil consist of 500 turns of 18 AWG copper. Both these parameters can be changed according to the materials available in the materials library of the program. After running the mesh generator, if everything is fine, we should obtain a full mesh. The circle represents the boundary condition I’ve set for this example. Setting a boundary condition is not required (the program runs anyway) but strongly suggested for better resutls.

From the theory, we would expect the following:

The magnetic circuit associated with the problem  at hand can be obtained using the following equation:

$$\oint_{c}^{ }\vec{H}d\vec{l}= \sum_{i}^{n}R_i \phi_i =M=NI$$


  • $c$ is the contour of integration (think of it as a flux line).
  • $\vec{H}$ is the magnetic field along that flux line.
  • $R_i$ is the reluctance of the flux tube we are considering. Note that $R_i = \frac{l_i}{\mu A_i}$ with $\mu$ being the magnetic permeability of the material, $l_i$ the length and $A_i$ the area of the chunk f material permeated by the magnetic flux. We have 4 different flux tube to account for, so $n = 4$.
  • $M = N I$ is the magnetomotive force and it is equal to the sum of the current concatenated to the contour of integration that is equal to the number of turns of the coil multiplied by the current flowing in the coil.

Note that the following magnetic circuit (assuming no flux leakage) can be obtained from the equation stated above:

Image 5

The relationship between the magnetic induction $B$ and the Magnetic Field $H$ depends on the material used:

$$B = \mu H$$

In the case of ferromagnetic materials, this relationship is non-linear, while in the case of the air it is. Furthermore $\mu_{air}

The magnetic flux is equal to:

$$\phi = B A$$

and the energy stored in a chunk of material is equal to $\frac{1}{2} l_i A_i \mu_{air} H^2$.

Usually, since $\mu_{air}

We could expect the following:

  • The magnetic flux $\phi$ should be within the same order of magnitude at all points which means that also the magnetic induction $B$ should vary within the same order of magnitude.
  • The magnetic field $H$ should be much stronger in the air gap then in the core since $$B = \mu H$$ and $\mu_{air}
  • The magnetic tension drop should be higher in the air gap compared than in the iron core.
  • The magnetic tension drop around the system perimeter should equal the magnetomotive force.

Let’s run the simulation and analyse the results:


First off, we can note that some flux lines are outside the magnetic core. These flux is called leakage flux. The induction field is stronger in the core and becomes weaker near the air gap, however, the induction field varies between 1.8 and 0.9 T. The magnetic flux is 0.000378472 Wb where the induction is strongest and 0.000220786 Wb where the induction is weaker. Again, note that the flux can be reasonably assumed to be constant. The flux can be calculated by using the integration function of FEMM.

If we plot the magnetic field $H$ we obtain the following contour


Bingo, $H$ is much much stronger in the airgap then anywhere else. How much stronger you may ask. Well, at the center of the air gap, the absolute value of $H$ is about 850 000 A/m while in the iron core, at its best, it is close to 20 000 A/m. Not bad, huh?

The magnetic voltage drop can be found by integrating the magnetic field over the desired contour. The magnetic tension drop in the air gap is about 3400 A while in the whole iron core it is about 1500 A. Again our expectations are met by the simulation. The sum of the tension drops around the magnetic circuit isn’t exactly equal to the magnetomotive force, although it is close.


If we plot the strength (absolute value) of $B$ from A to F we find the following pattern

Image 9

The induction field is at its lowest in the air gap, while the magnetic field is mostly concentrated in the air gap as expected

Image 10

If we plot the strengh of the normal component (with respect to the cross section of the iron core) of the $B$ field at the mid point of the A and B we find out that the induction is roughly constant within the cross section of the iron core (look at the scale!).

Image 12

Since in this case there is just one coil and no moving parts, we can interpret the ration $\frac{\phi}{I}$ as the inductance of the electrical circuit. According to FEMM the inductance of the electrical circuit is about 19mH.

Image 11

Stepping up the geometry: field windings of a synchronous machine

So far I’ve simply scratched the surface of what FEMM can do. It can help you calculate electromagnetic forces, induced currents and much more. As a simple example, below you can find the results of the simulation of the induction field of a 4 poles synchronous machine. Usually, the induction field is generated using a constant current (or permanent magnets). This simulation applies , for example, to a synchronous generator that is rotating with the stator windings open (in that case, no magnetic field is generated by the stator since no current is flowing through those windings).

This is the FEMM schematics

Image 19

The generator is modelled using M22 steel. The following pictures represent a 90 degree turn of a synchronous generator with no load attached

Image 001

Image 002

Image 003

Image 004

Image 005

Image 006

Note how the field lines change. The head of the poles tend to be saturated much faster than the air gap.

I hope you enjoyed this overview of some of the functions of FEMM for magnetics simulations. The files of the simulations can be downloaded here. Please do share this post if you have found it useful or interesting or even in the case you liked the pretty pictures :D.

This post first appeared on The Beginner Programmer, please read the originial post: here

Share the post

Magnetics and Electrostatics simulations with FEMM


Subscribe to The Beginner Programmer

Get updates delivered right to your inbox!

Thank you for your subscription