## magnetic field of a permanent magnet in 3D

Numerical methods and mathematical models of Elmer
emmy.t
Posts: 21
Joined: 28 Oct 2020, 08:50
Antispam: Yes

### magnetic field of a permanent magnet in 3D

I'm trying to simulate the magnetic field of a permanent magnet in 3D.
I used elmerGUI tutorial 8: Magnetostatics-Magnetic field resulting from a permanent magnet as a reference, and tried to apply in 3D, but it doesn't work and couldn't see magnetic field in paraview.
if you find some mistakes or have tips, please let me know.

thank you.
Attachments
log.txt
case.sif
raback
Posts: 4066
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

### Re: magnetic field of a permanent magnet in 3D

Hi

At least it would be advisable to solve the postprocessing fields after the vector potential is computed. I.e. change order of solvers 1 and 2.

-Peter
kevinarden
Posts: 1027
Joined: 25 Jan 2019, 01:28
Antispam: Yes

### Re: magnetic field of a permanent magnet in 3D

In log text it says Equation 2 is not used in any body, the body enteries use Equation 1

In the sif

Equation 1
Name = "Equation 3"
Active Solvers(1) = 2
End

Equation 2
Name = "Equation 5"
Active Solvers(1) = 1
End

There should only be 1 equation, with both solvers being active.

Equation 1
Name = "Equation 3"
Active Solvers(2) = 1 2
End

If you built this in the GUI only add one equation, go to each tab for the solvers and active each one.
emmy.t
Posts: 21
Joined: 28 Oct 2020, 08:50
Antispam: Yes

### Re: magnetic field of a permanent magnet in 3D

Thank you, Peter and Kevin.

I changed a little, there is one equation with active two solvers, and checked the order of these solvers. However the result hasn't changed, still I get zero magnetic field in the entire model.

In the tutorial 8, set boundary condition "farfield" to the outer circle.
how should I set boundary condition in this model?
raback
Posts: 4066
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

### Re: magnetic field of a permanent magnet in 3D

Hi

The best you can set for farfield is have the vector potential be zero. The vector potential is only defined at the direction of the edges so funnily you cannot define the vector potential for a sphere in the normal direction at all. Hence there is easily not a similar BC as for 2D.

-Peter
kevinarden
Posts: 1027
Joined: 25 Jan 2019, 01:28
Antispam: Yes

### Re: magnetic field of a permanent magnet in 3D

This has worked for me in 3D

Boundary Condition 1
Target Boundaries(1) = 2
Name = "FarField"
AV {e} = 0.0
End
emmy.t
Posts: 21
Joined: 28 Oct 2020, 08:50
Antispam: Yes

### Re: magnetic field of a permanent magnet in 3D

tried some changes of target boundaries and then the BC (AV=0.0) worked.
Thank you.

And the result I got looks like magnetic fields are canceled just between magnets. nothing effected to air region.
2020-11-30 151304.png
I expected the result should be like this.
BarMagnetFieldFRONT.png (10.04 KiB) Viewed 1196 times
kevinarden
Posts: 1027
Joined: 25 Jan 2019, 01:28
Antispam: Yes

### Re: magnetic field of a permanent magnet in 3D

field.png
I normally use the stream tracer function in Paraview to make that plot
glyphs.png
emmy.t
Posts: 21
Joined: 28 Oct 2020, 08:50
Antispam: Yes

### Re: magnetic field of a permanent magnet in 3D

I mean arrows in the air region are not aligned and have almost zero magnetic field strength.
Attachments
120320paraview.png
log.txt
case.sif
kevinarden
Posts: 1027
Joined: 25 Jan 2019, 01:28
Antispam: Yes

### Re: magnetic field of a permanent magnet in 3D

It certainly looks better in 2d
2dglyphs.png