Simulation of the force between two magnets

Numerical methods and mathematical models of Elmer
mika
Posts: 230
Joined: 15 Sep 2009, 07:44

Re: Simulation of the force between two magnets

Post by mika »

In the 3D case the source is defined as "Magnetization 1 = Real 9.55e5". Should it be "Magnetization 3 = Real 9.55e5" in order to have the same case (the magnetization vector aligned with the axis)?

-- Mika
JanHoek
Posts: 15
Joined: 13 Jan 2020, 14:06
Antispam: Yes

Re: Simulation of the force between two magnets

Post by JanHoek »

Thank you Mika, you are correct. I was using some different models which had different orientations, it does gives the expected result right now. Sorry for the silly mistake.

- Jan
JanHoek
Posts: 15
Joined: 13 Jan 2020, 14:06
Antispam: Yes

Re: Simulation of the force between two magnets

Post by JanHoek »

Hi everyone,

For further verification of the magnetic force implementation in Elmer, I am now trying to add symmetry planes to the model, simulating a quarter of the 3D case. For the symmetry, I am using that the magnetic flux density normal to the plane of symmetry is equal to zero. This also means that the magnetic field intensity in that direction is zero, which gives me the symmetry condition: Magnetic Field Strength n = Real 0. Here is the case file, the .grd file for the structured mesh and the .geo file for the unstructured mesh:
case.sif
(3.85 KiB) Downloaded 267 times
3D_20.grd
(877 Bytes) Downloaded 255 times
TwoMagnets.geo
(911 Bytes) Downloaded 267 times
If I compare to the 3D cases I have simulated, which all give the expected results, the model with symmetry does not give the expected result. Mesh refinement also does not give a solution closer to the expected solution. I think it could be the case that I am missing a symmetry condition, however I am not sure about this. Does anyone know what the correct symmetry condition should be, or what else the problem could be?

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

Re: Simulation of the force between two magnets

Post by kevinarden »

I don't think you can say
Magnetic Field Strength n = Real 0
in the sif file
It needs to be
Magnetic Field Strength 1 = Real 0
or
Magnetic Field Strength 2 = Real 0
or
Magnetic Field Strength 3 = Real 0

depending on whether your need direction 1, 2, or 3 or you could use a combination of the above with more than one entry
such as
Magnetic Field Strength 2 = Real 0
Magnetic Field Strength 3 = Real 0
JanHoek
Posts: 15
Joined: 13 Jan 2020, 14:06
Antispam: Yes

Re: Simulation of the force between two magnets

Post by JanHoek »

Thank you Kevin for your response!

When I use that condition with the direction normal to the boundaries (so direction 1 for boundaries 3, 13 and 15 and direction 2 for boundaries 5, 12 and 14), it gives the same result. Here is the case file with the alteration you suggested:
case.sif
(3.95 KiB) Downloaded 263 times
Could anything else be the problem?
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Simulation of the force between two magnets

Post by kevinarden »

When I generated the mesh from the geo file both the upper magnet and the air came out as body 1. The mesh.element file only had 2 bodies.
Make sure your mesh actually has 3 bodies.
JanHoek
Posts: 15
Joined: 13 Jan 2020, 14:06
Antispam: Yes

Re: Simulation of the force between two magnets

Post by JanHoek »

Are you sure about this? When I generate the mesh using gmsh with the given .geo file, I get three bodies:
Elmer_bodies.png
(93.33 KiB) Not downloaded yet
TwoMagnets.geo
(911 Bytes) Downloaded 284 times
mesh.elements
(19.45 KiB) Downloaded 288 times
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Simulation of the force between two magnets

Post by kevinarden »

Yours is correct. Not sure why mine didn't.
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Simulation of the force between two magnets

Post by raback »

Hi

Still problems? Could you treat the problem in terms of vector potential setting "AV {e} = 0.0" at the symmetry BCs.

-Peter
edge025
Posts: 28
Joined: 27 Apr 2019, 08:48
Antispam: Yes
Location: NJ, USA
Contact:

Re: Simulation of the force between two magnets

Post by edge025 »

Peter,

I ran your case that was posted on 30 Jan 2020. It works, just like you stated. However, for 3D my meshing workflow usually involves tets, not hex like in your mesh. When I ran the model using tets and gradient adaptive mesh refinement my "zeros" for magnetic force are on the order of 10^-3 - 10^-4 no matter what options for the solver I use (even quadratic approx). Can you please give me some pointers for what characteristics the tets should have for accurate results? Thanks.

Regards,
Joe
Post Reply