I'm trying to simulate the magnetic field of a permanent magnet in 3D.
I used elmerGUI tutorial 8: MagnetostaticsMagnetic 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.
magnetic field of a permanent magnet in 3D

 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
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
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

 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.
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.
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?
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?

 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
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
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

 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
Boundary Condition 1
Target Boundaries(1) = 2
Name = "FarField"
AV {e} = 0.0
End
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. I expected the result should be like this.
Thank you.
And the result I got looks like magnetic fields are canceled just between magnets. nothing effected to air region. I expected the result should be like this.

 Posts: 1027
 Joined: 25 Jan 2019, 01:28
 Antispam: Yes
Re: magnetic field of a permanent magnet in 3D
I normally use the stream tracer function in Paraview to make that plot
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
 (248.18 KiB) Not downloaded yet

 log.txt
 (4.54 KiB) Downloaded 48 times

 case.sif
 (3.01 KiB) Downloaded 45 times

 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
a 2d and 3d case compared here
https://github.com/mrkearden/magforce
Your air field my not be large enough relative to the magnet.a 2d and 3d case compared here
https://github.com/mrkearden/magforce