Permanent Magnets
In this tutorial, the magnetic fields and magnetic forces resulting from a pair of small permanent magnets is simulated.
Model definition
The model consists of two cylindrical 2 mm permanent magnets separated by a distance of 1.2 mm and an air box surrounding them.
A constant magnetic flux density is applied to the magnets. The resulting magnetic forces are determined with the Magnetism-φ formulation.
Additional cylindrical force domain volumes are created around the magnets, so that the magnetic fields around the magnets can be integrated.
Element | Geometric details |
---|---|
Magnet 1 | Cylinder of 2 mm radius and 2 mm height centered at |
Magnet 2 | Cylinder of 2 mm radius and 2 mm height centered at |
Force domain 1 | Cylinder of 3 mm radius and 3 mm height centered at |
Force domain 2 | Cylinder of 3 mm radius and 3 mm height centered at |
Air box | Box of size 50 mm 50 mm 50 mm |
Output Results
- Magnetic field distribution.
- Magnetic forces between the magnets.
Material Data
- Air
Property | Value |
---|---|
Magnetic permeability |
Boundary conditions
Type | Value | Target volume |
---|---|---|
Remanence | [0, 1.35, 0] | Magnet 1 |
Remanence | [0,-1.35, 0] | Magnet 2 |
Step-by-step guide
Here you’ll find a detailed step-by-step tutorial on how to simulate a pair of permanent magnets and the resulting forces in Quanscient Allsolve.
Step 1 - Build the geometry
-
Create a new project and name it
Permanent magnets
. -
Start off with a
cylinder
element.Name Element type Center point [m] Size [m] Rotation [deg] magnet 1 Cylinder X: 0
Radius: 2e-3
X: 0
Y: 2.5e-3
Height: 2e-3
Y: 0
Z: 0
Z: 0
Note, that rotation in the X-direction is
0
. -
Reset view after building
magnet 1
to bring the small magnet cylinder back into view. -
Copy
magnet 1
to buildmagnet 2
.Name Element type Center point [m] Size [m] Rotation [deg] magnet 2 Cylinder X: 0
Radius: 2e-3
X: 0
Y: -2.5e-3
Height: 2e-3
Y: 0
Z: 0
Z: 0
-
Copy
magnet 1
to buildforce domain 1
.Name Element type Center point [m] Size [m] Rotation [deg] force domain 1 Cylinder X: 0
Radius: 3e-3
X: 0
Y: 2.5e-3
Height: 3e-3
Y: 0
Z: 0
Z: 0
-
Copy
force domain 1
to buildforce domain 2
.Name Element type Center point [m] Size [m] Rotation [deg] force domain 2 Cylinder X: 0
Radius: 3e-3
X: 0
Y: -2.5e-3
Height: 3e-3
Y: 0
Z: 0
Z: 0
At this point, there are 4 cylinders in the model, so that the force domains envelop the magnets that are facing each other.
-
Build the air box.
Name Element type Center point [m] Size [m] Rotation [deg] box Box X: 0
X: 50e-3
X: 0
Y: 0
Y: 50e-3
Y: 0
Z: 0
Z: 50e-3
Z: 0
Step 2 - Define materials
-
Go to the
Properties
section. -
tosign the
Air
material to all volumes.
Step 3 - Define the physics and apply boundary conditions
-
Go to the
Physics
section. -
Add the
Magnetism ϕ
physics. Let the target default to all volumes.Physics Target Magnetism φ All volumes -
Add a
Remanence
interaction to Magnetism φ. Remanence introduces a B-field to a volume.Interaction name Interaction type Target Value Remanence left Remanence
magnet 2 (volume 4
)[0; 1.35; 0]
-
Add another
Remanence
interaction to Magnetism φ.Interaction name Interaction type Target Value Remanence right Remanence
magnet 1 (volume 1
)[0; -1.35; 0]
Step 4 - Generate the mesh
-
Go to the
Simulations
section. -
Create a new mesh.
-
Set Mesh quality to
Expert Settings
. -
Set the mesh element Max size to
0.05
. -
Scroll down to Mesh Refinement and create a
Volume
mesh refinement entity. -
Select all cylindrical volumes to target and set Max size to
0.0001
. -
Generate the mesh and check the preview.
Step 5 - Apply simulation settings
-
Create a new simulation.
Simulation name Analysis type Node count Node type Simulation 1 Steady state 5
1 CPU, 16 GB
-
Select
Mesh 1
as the mesh for your simulation. -
Add a
B
field output.Output name Output type Target Output expression B magnets Magnetic flux density ( B
) field outputmagnets 1 and 2 (volumes 1, 4
)B
-
Add another
B
field output.Output name Output type Target Output expression B air Magnetic flux density ( B
) field outputForce domains 1 and 2, air box (volumes 5, 6, 7
)B
-
Add a
Magnetic force
value output.Output name Output type Target Magnetic force left Magnetic force value output magnet 2 and force domain 2 (volumes 4, 6
) -
Add another
Magnetic force
value output.Output name Output type Target Magnetic force right Magnetic force value output magnet 1 and force domain 1 (volumes 1, 5
) -
Run the simulation.
Step 6 - See results
-
Check
Summary
for the magnetic force value outputs. -
Add a visualization to see field output results:
Visualization name Fields Filters Visualization 1 B magnets B air Glyph -
Edit the
Glyph
settings:Filter Max sample points Scale factor Glyph 50000
0.001
-
Render the visualization.
-
The
Glyph
scale factor is reduced to0.0005
here for a closer look: