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

Post by emmy.t »

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
(3.45 KiB) Downloaded 51 times
case.sif
(3.14 KiB) Downloaded 66 times
raback
Site Admin
Posts: 4066
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: magnetic field of a permanent magnet in 3D

Post by raback »

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

Post by kevinarden »

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

Post by emmy.t »

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
Site Admin
Posts: 4066
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: magnetic field of a permanent magnet in 3D

Post by raback »

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

Post by kevinarden »

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

Post by emmy.t »

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
(489.1 KiB) Not downloaded yet
I expected the result should be like this.
BarMagnetFieldFRONT.png
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

Post by kevinarden »

field.png
(209.4 KiB) Not downloaded yet
I normally use the stream tracer function in Paraview to make that plot
glyphs.png
(208.47 KiB) Not downloaded yet
emmy.t
Posts: 21
Joined: 28 Oct 2020, 08:50
Antispam: Yes

Re: magnetic field of a permanent magnet in 3D

Post by emmy.t »

I mean arrows in the air region are not aligned and have almost zero magnetic field strength.
Attachments
120320paraview.png
(248.18 KiB) Not downloaded yet
log.txt
(4.54 KiB) Downloaded 48 times
case.sif
(3.01 KiB) Downloaded 45 times
kevinarden
Posts: 1027
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: magnetic field of a permanent magnet in 3D

Post by kevinarden »

It certainly looks better in 2d
2dglyphs.png
(648.47 KiB) Not downloaded yet
Your air field my not be large enough relative to the magnet.

a 2d and 3d case compared here
https://github.com/mrkearden/magforce
Post Reply