## Simulation of the force between two magnets

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

### Re: Simulation of the force between two magnets

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

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

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
3D_20.grd
TwoMagnets.geo
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: 641
Joined: 25 Jan 2019, 01:28
Antispam: Yes

### Re: Simulation of the force between two magnets

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

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
Could anything else be the problem?

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

### Re: Simulation of the force between two magnets

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

Are you sure about this? When I generate the mesh using gmsh with the given .geo file, I get three bodies:
Elmer_bodies.png
TwoMagnets.geo
mesh.elements

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

### Re: Simulation of the force between two magnets

Yours is correct. Not sure why mine didn't.

raback