Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Force between two magnets - Question about Maxwell Stress Tensor

Please login with a confirmed email address before reporting spam


I have two permanent magnets and I would like to compute the force that one magnet exerts on the the other.


if the two magnets (mag1 and mag2) are the same (same dimensions, and same magnetization vector)

I would expect that the force of Mag 1 on Mag2 is the same as the one of Mag2 on Mag1 and also if the magnets are small enough, the directions of these forces should be along the line connecting the two magnets' centers (more or less, since it's not the gilbert model).

Two issues

the forces should be equal and opposite, but they are not. I have refined the mesh an still no convergence, so I am not sure how to get better results


The force has components that Iwould expect to be zero (because of symmetry). SO I am questioning whether or not I am missing something,

Can some check my model and tell me where I am making a mistake?

12 Replies Last Post 25.08.2016, 16:10 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10.12.2010, 12:30 GMT-5
attached is my simple model
attached is my simple model


Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 12.12.2010, 08:45 GMT-5
Hi

I have several things to suggest:

- first your overall air model is not very square/spherical around the magnets, this is restraining the field and will give you edge effects.
- You are not using PML to extend the field gently to infinite distance, PML requires some careful meshing in the PML region to get maximum effects for minimum number of elements ("onion" shell shapes elements, use layers in v4)
- you are not using symmetry that nicely applies here and further reduces the model size and will allow to increase the meh density (but not show the discrepancy left right magnet you are pointing to ;)
- finally, but not least, youre mesh is not very symmetric and you have sharp edges on your magnets, hence field concetration and singulartity points, which gives large field gradients that again have important effects on the maxwell tensor integration approach.

I had made some tries and tests that I deposited on the Model Exhange a few years ago, take a look on the difference between a fine teth mesh and a coarse structured mesh. Maxwell tensors for force computation are very mesh dependent

--
Good luck
Ivar
Hi I have several things to suggest: - first your overall air model is not very square/spherical around the magnets, this is restraining the field and will give you edge effects. - You are not using PML to extend the field gently to infinite distance, PML requires some careful meshing in the PML region to get maximum effects for minimum number of elements ("onion" shell shapes elements, use layers in v4) - you are not using symmetry that nicely applies here and further reduces the model size and will allow to increase the meh density (but not show the discrepancy left right magnet you are pointing to ;) - finally, but not least, youre mesh is not very symmetric and you have sharp edges on your magnets, hence field concetration and singulartity points, which gives large field gradients that again have important effects on the maxwell tensor integration approach. I had made some tries and tests that I deposited on the Model Exhange a few years ago, take a look on the difference between a fine teth mesh and a coarse structured mesh. Maxwell tensors for force computation are very mesh dependent -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 13.12.2010, 10:21 GMT-5

Ivar,
thanks for the reply - I will try out your suggestions, so I might ask for your feedback again once I implement them

However :

My model was not generated with a lot of attention - namely I let the software create the mesh and then I believe I set the mesh refinement automatically.

I knew about the sharp-corner problems - in fact I also created another model with oval magnets and I still got the same inconsistency of results in the force calculations which means this mesh-dependency is really too strong perhaps to be relied on?

I understand that more attention needs be put into meshing the system. However, this is just a little model I made to check results, their convergence and also consistency. The model I am working on has several other complications added to it (moving parts, ALE, more than two magnets, etc.) , and there will little I can do to check consistency of results because I won't have access to an analytical solution.

What PUZZLES me the most about this model is that - despite the poor mesh - shouldn't reciprocity of results still hold? Meaning what one magnet sees should be exactly what the other sees (except for some sign changes in the forces), so the Tensor approach gives very bad results -

Is there ANOTHER APPROACH I can use? Something that's easier to implement and is more robust mesh-wise?


Thanks for your help!
Ivar, thanks for the reply - I will try out your suggestions, so I might ask for your feedback again once I implement them However : My model was not generated with a lot of attention - namely I let the software create the mesh and then I believe I set the mesh refinement automatically. I knew about the sharp-corner problems - in fact I also created another model with oval magnets and I still got the same inconsistency of results in the force calculations which means this mesh-dependency is really too strong perhaps to be relied on? I understand that more attention needs be put into meshing the system. However, this is just a little model I made to check results, their convergence and also consistency. The model I am working on has several other complications added to it (moving parts, ALE, more than two magnets, etc.) , and there will little I can do to check consistency of results because I won't have access to an analytical solution. What PUZZLES me the most about this model is that - despite the poor mesh - shouldn't reciprocity of results still hold? Meaning what one magnet sees should be exactly what the other sees (except for some sign changes in the forces), so the Tensor approach gives very bad results - Is there ANOTHER APPROACH I can use? Something that's easier to implement and is more robust mesh-wise? Thanks for your help!

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 13.12.2010, 16:34 GMT-5
Hi

try to use a structured mesh (quads) with the same dimensions around the edges of the magnet.

Then anlyse finer the true value of the force along each edge separately, the final force appear often as the difference of large numbers, which are known to easily give numerical issues

--
Good luck
Ivar
Hi try to use a structured mesh (quads) with the same dimensions around the edges of the magnet. Then anlyse finer the true value of the force along each edge separately, the final force appear often as the difference of large numbers, which are known to easily give numerical issues -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 16.12.2010, 12:31 GMT-5
Ivar ,

I didn't quite get your suggestion

what you mean by ".... the true value of the force along each edge separately, " ?


thanks!
G.
Ivar , I didn't quite get your suggestion what you mean by ".... the true value of the force along each edge separately, " ? thanks! G.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 16.12.2010, 13:31 GMT-5
Hi

check the Maxwell tensor equations used by COMSOL and integrate separately the formula along each of the 4 edges of your magnet and compare the values, the global result of COMSOL is the integration along the closed loop around your magnet.

Then compare how these separate values changes with the meshing shape and density, it can indicate how your maxwell tensor error changes

--
Good luck
Ivar
Hi check the Maxwell tensor equations used by COMSOL and integrate separately the formula along each of the 4 edges of your magnet and compare the values, the global result of COMSOL is the integration along the closed loop around your magnet. Then compare how these separate values changes with the meshing shape and density, it can indicate how your maxwell tensor error changes -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 16.12.2010, 13:45 GMT-5
Hello again Ivar,
are you referring to an option in COMSOL, or should I use input the formula in the integration window separately for each boundary?
Hello again Ivar, are you referring to an option in COMSOL, or should I use input the formula in the integration window separately for each boundary?

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 21.12.2010, 06:34 GMT-5
I have problem finding the displacement of a magnet when modelling forces between two permanent magnets.I dont even know how to constrain one magnet and then find the displacement of the other .What should i do
I have problem finding the displacement of a magnet when modelling forces between two permanent magnets.I dont even know how to constrain one magnet and then find the displacement of the other .What should i do

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 21.12.2010, 13:12 GMT-5

Once you compute the force acting on one of the magnets, you can go under

options > integration coupling variables and create a global variable (technically 1 vector , i.e. 3 scalar quantities) and set them equal to the computed force components for one of the magnets.

then you can use "global expressions" (still under the options menu) and find the option that lets you integrate the equation F=ma .

You can either solve for displacement or velocity and then you will have to impose that quantity on the boundary of the magnets (or the subdomain) through the ALE application mode if you want to visualize the results with a movie.

since the Force is distance-dependent you will have to compute and use a transient analysis.

Also, I am not sure how COmsol handles unconstrained bodies, so I would impose that one MAGNET doesn't move while the other is either attracted or repulsed. The reaction force on the fixed magnet is equal to the mangetic one acting upon it.

I hope it makes sense. I am not an expert in COMSOL yet, but that's how I would try and approach the problem.

Let me know if I wasn't clear. Did you manage to get convergence of the computed magnetic force? That's my struggle.





Once you compute the force acting on one of the magnets, you can go under options > integration coupling variables and create a global variable (technically 1 vector , i.e. 3 scalar quantities) and set them equal to the computed force components for one of the magnets. then you can use "global expressions" (still under the options menu) and find the option that lets you integrate the equation F=ma . You can either solve for displacement or velocity and then you will have to impose that quantity on the boundary of the magnets (or the subdomain) through the ALE application mode if you want to visualize the results with a movie. since the Force is distance-dependent you will have to compute and use a transient analysis. Also, I am not sure how COmsol handles unconstrained bodies, so I would impose that one MAGNET doesn't move while the other is either attracted or repulsed. The reaction force on the fixed magnet is equal to the mangetic one acting upon it. I hope it makes sense. I am not an expert in COMSOL yet, but that's how I would try and approach the problem. Let me know if I wasn't clear. Did you manage to get convergence of the computed magnetic force? That's my struggle.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 22.12.2010, 15:59 GMT-5
Hi

normally magnets (MF in v4) are all constrained as nothing is solved for u,v,w. Depending on how you couple the physics /application mode, you might also solve for u,v,w but then probably you need some ALE to cope for the motion for the ACDC calculations

for the maxwell stress tensor you need to integrate one of the v4 mf.ntx_... or mf.nty_... or mf.ntz_...
or corresponding names for v3.5 along the edges of your magnet and compare the values for the four edges of a square magnet. Depending on the symmetry of your problem these should be equal and opposed for several and the total force is only a fraction of the sum of the absolute values. If your mesh is not very symmetric these differences might esasily grow and give rather wrong final sum ups


--
Good luck
Ivar
Hi normally magnets (MF in v4) are all constrained as nothing is solved for u,v,w. Depending on how you couple the physics /application mode, you might also solve for u,v,w but then probably you need some ALE to cope for the motion for the ACDC calculations for the maxwell stress tensor you need to integrate one of the v4 mf.ntx_... or mf.nty_... or mf.ntz_... or corresponding names for v3.5 along the edges of your magnet and compare the values for the four edges of a square magnet. Depending on the symmetry of your problem these should be equal and opposed for several and the total force is only a fraction of the sum of the absolute values. If your mesh is not very symmetric these differences might esasily grow and give rather wrong final sum ups -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 26.12.2014, 03:20 GMT-5
HI
I am trying to simulate repulsive force between two permanent magnets. One of the magnets is fixed and the other one moves freely. I have simulated it but two things in results make me confused:
1. Repulsive force in all times is the same. But we know that, as the second magnet goes far away first magnet, forces must become lesser.
2. I plotted displacement of one point on moving magnet. Graph shows displacement of 28000mm in 0.1 second (:-o). But animation shows about 1mm displacement.

What is the problem?
Can anyone help me?
HI I am trying to simulate repulsive force between two permanent magnets. One of the magnets is fixed and the other one moves freely. I have simulated it but two things in results make me confused: 1. Repulsive force in all times is the same. But we know that, as the second magnet goes far away first magnet, forces must become lesser. 2. I plotted displacement of one point on moving magnet. Graph shows displacement of 28000mm in 0.1 second (:-o). But animation shows about 1mm displacement. What is the problem? Can anyone help me?


Please login with a confirmed email address before reporting spam

Posted: 8 years ago 25.08.2016, 16:10 GMT-4
dear Sara

Please can you send me your file because I have the same issue

Thank you

Abdulrahman homadi
dear Sara Please can you send me your file because I have the same issue Thank you Abdulrahman homadi

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.