Problem with 3D Quadrupole Magnetic Field Strength

Numerical methods and mathematical models of Elmer
Post Reply
tanus
Posts: 2
Joined: 28 Sep 2022, 22:37
Antispam: Yes

Problem with 3D Quadrupole Magnetic Field Strength

Post by tanus »

Hello everyone,

I've been attempting to simulate the magnetic field strength of a quadrupole, but for some reason it has some aberrations that I can't find why.

First, using the gmsh software, I created a 2D mesh of 4 magnets surrounded by air (I attached all the images in one, results.png). I loaded it in the Elmer and, similar as the horseshoe tutorial, I made the material of the magnetics with the respective magnetizations using the magnetodynamics2d solver. The results were nice, it has some peculiar points on the magnets, but as a whole the results are as I expected.

Doing the same thing in 3D the results are strange. Using the gmsh software, I created a 3D mesh with the 2D geometry as a basis. I loaded it in the Elmer and, as before, I made the material of the magnetics with the respective magnetizations, but this time using the magnetodynamics solver, instead of the 2D one.

However, the results seems to have like an aberration out of the magnets, but just at one side of the mesh, a region that the magnetic field is much bigger than the rest of the mesh. Which doesn't make much sense, since the geometry has a radial symmetry.

So, my question is: what I'm doing wrong? Why I'm not finding a nice symmetric field?
Attachments
results.png
Geometries and results in 2D and 3D simulations
(618.89 KiB) Not downloaded yet
3D.zip
3D simulation files
(558.74 KiB) Downloaded 29 times
2D.zip
2D simulation files
(244.52 KiB) Downloaded 25 times
fjimenez
Posts: 63
Joined: 27 Sep 2021, 23:40
Antispam: Yes

Re: Problem with 3D Quadrupole Magnetic Field Strength

Post by fjimenez »

Hi,

I just took a quick look at the 2D case and there were a few things you do to improve results.

1. BSolver is obsolete, use MagnetoDynamicsCalcFields
2. Relative Permeability of permanent magnets is around 1.05
3. Magnetization directions need to be revised.
4. Use a finer mesh
5. Use a direct method (for 2D cases at least)

Take a look at this .sif file, you then can see what you need to do to fix the 3D case.

Cheers,
case.sif
(2.87 KiB) Downloaded 29 times
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Problem with 3D Quadrupole Magnetic Field Strength

Post by raback »

Hi,

I only looked at the 3D case. Luckily the problem was easy to spot. You were using bad preconditioner: We are solving an ungauged version of the AV solver hence the solution has a null space which means that the matrix does not have an inverse. Hence you cannot form ILU (incomplete LU decomposition). Plain scaling works much better and this is achieved by simply setting preconditioner to "none". This converges very nicely then. Your solution was probably not converged. The GUI puts some default options that are not always optimal.

I also added some better visualization options but didn't study the results critically.

-Peter
Attachments
case.sif
updated sif file
(3.04 KiB) Downloaded 29 times
Post Reply