3D Magnetics With Elmer FEM
3D Magnetics With Elmer FEM
3D Magnetics With Elmer FEM
Richard Crozier
July 20, 2016
Contents
1 Introduction 1
1 Introduction
This tutorial describes the full steps to go from nothing to a 3D magnetic
simulation using Elmer FEM. This is done in the the following steps:
1
2 Cylindrical Magnet in Air
The first problem we are going to solve is that of a simple cylindrical bar magnet
in free space that looks like this:
The magnet will be 20mm in diameter, 50mm long and will be magnetised
along it’s axis. To model this, we will place it in a box of air, to approximate
the infinite space region around the magnet.
2
This adds some tools to the toolbar. We can create a cylinder by clicking
on the little yellow cylinder icon. This creates a cylinder with default sizes. We
will change the size by selecting the cylinder and going modifying properties on
it’s ’Data’ tab:
This should leave us with something like the following, a cylider with one
face on the XY plane and it’s centre on the origin.
3
Now we need to make a box of air to put the cylinder into, do this by
selecting the ’Create a cube solid’ tool. This creates a new cuboid with one face
on the XY plane, and one corner on the origin, with default dimensions. Set
the Length, Width, and Height to all be 100mm using the Data tab for the box
in the same way as was done for the cylinder. Then, expand the ’Placement’
property, also in the Data tab, and then expand the ’Postiion’ property. Change
the ’x’ and ’y’ position to both be -50mm, and the ’z’ position to be -25mm.
This makes the box fully overlap our magnet.
Now we can’t see the cylinder any more as it overlaps the box. To make
everything easier to see, make the box transparent by going to it’s ’View’ tab.
Scroll down to the ’Transparency’ property and change to 75. You will now be
able to see the magnet inside the box.
4
This is our geometry complete. With our geometry created, we now have
to mesh it. This will be done in another program, Salome, and to get it into
this we must first export the geometry to a format Salome can import, in this
case STEP. To export the objects to a STEP file, simply select both object in
the model browser and then choose File=¿Export and choose the ’STEP with
colors’ file type. The advantage of STEP is that the model units of FreeCAD,
which are mm by default are saved in the file, and can be correctly imported by
Salome when we load it again.
5
2.3 Converting Mesh for Elmer
Elmer doesn’t natively support the unv mesh format, but we can use ElmerGrid
to convert the unv file to Elmer’s mesh format. Elmer’s mesh format is not a
single file, but rather a directory containing a collection of files. The command
to convert a unv file to Elmer’s format is:
ElmerGrid 8 2 < file name >. unv
The first number is the input file format, the second is the output file format,
and these are followed by the name of the file to be converted. So in our case
we run
ElmerGrid 8 2 e l m e r _ 3 d _ m a g n e t _ m e s h . unv
By setting the appropriate variables in our Elmer case file, we can use these
names instead of having to figure out what numbers have been assigned to the
mesh groups.
6
3 A Current Carrying Coil in Air
4 Flux Linkage and Mutual Inductance In a Pair
of Iron Cored Coils
5 A Permanent Magnet Machine With Symme-
try
6 Permanent Magnet Machine With Sliding Air
Gap Mesh