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.

Modelling a cylindrical and ring magnet as well as finding the force between them.

Please login with a confirmed email address before reporting spam

Hello,

I'm a student trying to learn Comsol, specifically how to model magnetic fields.

Currently I am trying to simulate the magnetic fields of a cylinder magnet with a ring magnet around it.

I am using the Magnetic Fields, No Currents module with a 2D axis symmetric geometry. I have the cylinder magnet and ring magnets defined as neodymium with a relative permeability of 1.05 and then used the magnetic flux conservation to define a remnant flux density of 1.48 and 1.32 [T] to the magnets respectively. I then define a world of air around that with a relative permeability of 1. I then define a very fine mesh and try to compute a stationary study, but can not get it to work.

Does anyone have any ideas?

I plan on then moving the ring magnet along the Z axis and compute the force between the two magnets.

Thanks ahead of time!


14 Replies Last Post 5 giu 2015, 06:29 GMT-4
Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 24 apr 2015, 13:13 GMT-4
William,

you have to set Zero Magnetic Scalar Potential in one Point of the model to achieve an unambiguous solution.

Cheers
Edgar

--
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
William, you have to set Zero Magnetic Scalar Potential in one Point of the model to achieve an unambiguous solution. Cheers Edgar -- Edgar J. Kaiser emPhys Physical Technology http://www.emphys.com

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 24 apr 2015, 14:04 GMT-4
Hello,

Thank you! That seems to get it working.

I then calculate the force due to displacing the magnet, however, I am getting a very large force. I believe from previous simulations, I should be getting a force on the order of about 300 [N]. Here I am getting a force of about 30,000 [N]. I believe I have the correct remnant flux densities and geometry. I will double check that. Am I forgetting or missing something?

Very Respectfully,

Will
Hello, Thank you! That seems to get it working. I then calculate the force due to displacing the magnet, however, I am getting a very large force. I believe from previous simulations, I should be getting a force on the order of about 300 [N]. Here I am getting a force of about 30,000 [N]. I believe I have the correct remnant flux densities and geometry. I will double check that. Am I forgetting or missing something? Very Respectfully, Will


Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 24 apr 2015, 14:32 GMT-4
First, you have to use two separate force calculations for the two magnets and then you will get even higher values. The dimensions of the magnets are in meters. Is that the intention? Such huge magnets?

--
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
First, you have to use two separate force calculations for the two magnets and then you will get even higher values. The dimensions of the magnets are in meters. Is that the intention? Such huge magnets? -- Edgar J. Kaiser emPhys Physical Technology http://www.emphys.com

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 24 apr 2015, 16:46 GMT-4
Hello!

I believe that may have been my problem, let me change that!

Very Respectfully,

Will
Hello! I believe that may have been my problem, let me change that! Very Respectfully, Will

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 24 apr 2015, 17:26 GMT-4
Hello,

So I changed the scale to centimeters and redid the force calculation. Now I get a force of about 200 [N] which is much more reasonable, but not the 300 [N] I am looking for.

I have attached that file. Does it seem like I am doing everything correctly?

Very Respectfully,

Will

Hello, So I changed the scale to centimeters and redid the force calculation. Now I get a force of about 200 [N] which is much more reasonable, but not the 300 [N] I am looking for. I have attached that file. Does it seem like I am doing everything correctly? Very Respectfully, Will


Please login with a confirmed email address before reporting spam

Posted: 9 years ago 24 apr 2015, 18:18 GMT-4
I figured it out.

Thank you very much for your help!

Very Respectfully,

Will
I figured it out. Thank you very much for your help! Very Respectfully, Will

Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 25 apr 2015, 03:33 GMT-4
Hi Will,

I am glad I could help. In general force calculations with the Maxwell Stress Tensor are very sensitive to the mesh. You may also want to avoid sharp corners.

Cheers and good luck
Edgar

--
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Hi Will, I am glad I could help. In general force calculations with the Maxwell Stress Tensor are very sensitive to the mesh. You may also want to avoid sharp corners. Cheers and good luck Edgar -- Edgar J. Kaiser emPhys Physical Technology http://www.emphys.com

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 21 mag 2015, 11:02 GMT-4
Hi Will,

Could you explain how you figured it out. I am trying to work a similar problem by simulating two Neodymium block magnets and finding the force of attraction between them.

Adam
Hi Will, Could you explain how you figured it out. I am trying to work a similar problem by simulating two Neodymium block magnets and finding the force of attraction between them. Adam

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 21 mag 2015, 12:28 GMT-4
Hi Adam,

So what I did, what you can see above, was simulate a cylindrical magnet and a ring magnet. I defined the geometry and placement for the cylinder and ring, defined a remnant flux density (Brmax) for each which I found from a online magnet seller, and then applied a 0 scalar potential on the border of the simulation. Then using the force calculation in the AC/DC module ( I believe it is in this one ), I found the force acting on one of the magnets. (the force on each should be equal and opposite, so I only had to do this once)

I believe you should be able to do this with blocks without much issue. I recommend making your world or volume around the magnets a good deal larger than the volume containing the magnets. It seemed that at least several centimeters from the edges did just fine.

To get a Force versus Displacement curve, I actually wrote a python script that does the calculation for me. To do this, I simulated the magnetic field of the interior cylindrical magnet, exported the Z component of the magnetic field from this magnet ( based on geometry, this is the only component that would change since I would only be "moving" the ring magnet in the Z direction ), and then found the force via: F = ∫ ∇(m•B) dV.

To do this method of scripting for block magnets should be relatively simple, depending on how they are moving apart. Let me know if you have any more questions. Hope this helps!

Do you know python?

Very Respectfully,

Will
Hi Adam, So what I did, what you can see above, was simulate a cylindrical magnet and a ring magnet. I defined the geometry and placement for the cylinder and ring, defined a remnant flux density (Brmax) for each which I found from a online magnet seller, and then applied a 0 scalar potential on the border of the simulation. Then using the force calculation in the AC/DC module ( I believe it is in this one ), I found the force acting on one of the magnets. (the force on each should be equal and opposite, so I only had to do this once) I believe you should be able to do this with blocks without much issue. I recommend making your world or volume around the magnets a good deal larger than the volume containing the magnets. It seemed that at least several centimeters from the edges did just fine. To get a Force versus Displacement curve, I actually wrote a python script that does the calculation for me. To do this, I simulated the magnetic field of the interior cylindrical magnet, exported the Z component of the magnetic field from this magnet ( based on geometry, this is the only component that would change since I would only be "moving" the ring magnet in the Z direction ), and then found the force via: F = ∫ ∇(m•B) dV. To do this method of scripting for block magnets should be relatively simple, depending on how they are moving apart. Let me know if you have any more questions. Hope this helps! Do you know python? Very Respectfully, Will

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 21 mag 2015, 13:39 GMT-4
Hi Will,

Thank you for your quick response! I do not know python, but I have it installed and I am sure it shouldn't be hard to learn and do this quick calculation. I think I am having the same issue you were having where the force that I am getting is two orders of magnitude higher than what I am expecting (130 lbf compared to 1.3 lbf). How did you end up fixing that?

Thanks,
Adam
Hi Will, Thank you for your quick response! I do not know python, but I have it installed and I am sure it shouldn't be hard to learn and do this quick calculation. I think I am having the same issue you were having where the force that I am getting is two orders of magnitude higher than what I am expecting (130 lbf compared to 1.3 lbf). How did you end up fixing that? Thanks, Adam

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 21 mag 2015, 15:54 GMT-4
Hello,

Check what units you are in. I had everything in terms of meters when it should have been in centimeters. That's why I was getting giant results.

I recommend downloading pythonxy for learning/using python. It is great, has all the libraries you could ever want with it and it is free.

Very Respectfully,

William Steinberger
Hello, Check what units you are in. I had everything in terms of meters when it should have been in centimeters. That's why I was getting giant results. I recommend downloading pythonxy for learning/using python. It is great, has all the libraries you could ever want with it and it is free. Very Respectfully, William Steinberger

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 26 mag 2015, 22:37 GMT-4

I figured it out.

Thank you very much for your help!

Very Respectfully,

Will

Dear William,
Would you like tell me what is formula are used to calculate magnetic forces in comsol?
thank you so much

[QUOTE] I figured it out. Thank you very much for your help! Very Respectfully, Will [/QUOTE] Dear William, Would you like tell me what is formula are used to calculate magnetic forces in comsol? thank you so much

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 29 mag 2015, 15:19 GMT-4
Hello,

There is a force module that comsol offers that you may have to buy that does the calculation for you. Otherwise, if you export the components of the magnetic field, you can use this: F = ∫ ∇(m•B) dV.

Hope this helps!

Very Respectfully,

Will
Hello, There is a force module that comsol offers that you may have to buy that does the calculation for you. Otherwise, if you export the components of the magnetic field, you can use this: F = ∫ ∇(m•B) dV. Hope this helps! Very Respectfully, Will

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 5 giu 2015, 06:29 GMT-4
Hi Will,

I had the same problem about how to sovle the force between two permanent magnets. I got two defferent forces acting on the two permanent magnets. Could you please upload your COMSOL (.mph) file, so I can learn how to solve it.


Thanks,
wanqun qiu
Hi Will, I had the same problem about how to sovle the force between two permanent magnets. I got two defferent forces acting on the two permanent magnets. Could you please upload your COMSOL (.mph) file, so I can learn how to solve it. Thanks, wanqun qiu

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.