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.

Question on uploading and meshing simulation with CAD import module

Please login with a confirmed email address before reporting spam

Hello,

I am new to using the CAD import module, and I am having a problem with meshing. I made a magnetic shield in Solidworks, and then I imported it into comsol. When I try to mesh it, I get some errors that I do not know how to fix and have tried some solutions found on the web and have not been able to resolve the problem. I want to attach my file here; however, it is too large. I already cleared the solutions and the mesh, and it is still 16 MB. I also tried something that I found online that involves going into the preferences section under files, and that does not work either. Does anyone know how I can upload this file? Afterwards, I would like to attach this file and see if someone knows how to fix my meshing problems. Please let me know. Thank you so much!


12 Replies Last Post Dec 6, 2022, 12:10 p.m. EST

Please login with a confirmed email address before reporting spam

Posted: 1 year ago Nov 19, 2022, 9:47 a.m. EST
Updated: 1 year ago Nov 19, 2022, 9:48 a.m. EST

I am replying to my previous message. I used 7zip to zip the file! If someone could please take a look and see if they know how I can mesh correctly, I would appreicate it. Once again, I am using the CAD import module on COMSOL 6.1, and I imported a magnetic shield that I built in SolidWorks. I am new to this module and am having a hard time getting the mesh to work. Thank you!

I am replying to my previous message. I used 7zip to zip the file! If someone could please take a look and see if they know how I can mesh correctly, I would appreicate it. Once again, I am using the CAD import module on COMSOL 6.1, and I imported a magnetic shield that I built in SolidWorks. I am new to this module and am having a hard time getting the mesh to work. Thank you!


Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 1 year ago Nov 19, 2022, 11:29 a.m. EST

Victoria,

the 7z file is empty. Compressing Comsol files is not efficient because they are zip files essentially.

You can ask Comsol support to help upload a bigger file.

Cheers Edgar

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Victoria, the 7z file is empty. Compressing Comsol files is not efficient because they are zip files essentially. You can ask Comsol support to help upload a bigger file. Cheers Edgar

Please login with a confirmed email address before reporting spam

Posted: 1 year ago Nov 23, 2022, 11:42 a.m. EST

Hi,

Thank you for the reply! I have successfully reduced the size. The file is below.

Hi, Thank you for the reply! I have successfully reduced the size. The file is below.


Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 1 year ago Nov 23, 2022, 1:05 p.m. EST

Victoria,

this is quite a complex thing and I am afraid I cannot analyse it in detail. CAD imports can be difficult, because often the original CAD design wasn't done with FEM and the need of meshing in mind. So you may want to analyse the original CAD design for inaccuracies, intersections, missing conjunctions and the like. Or build the thing in Comsol which gives you more control of the geometry and also allows easy parameterization. You have thin structures in the geometry. This will likely require setting up a custom mesh. In most cases I start to set up meshes in the inner delicate parts and make my way to the outside boundaries of the geometry. It may also be possible to replace thin domains by suitable boundary conditions.

Good luck Edgar

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Victoria, this is quite a complex thing and I am afraid I cannot analyse it in detail. CAD imports can be difficult, because often the original CAD design wasn't done with FEM and the need of meshing in mind. So you may want to analyse the original CAD design for inaccuracies, intersections, missing conjunctions and the like. Or build the thing in Comsol which gives you more control of the geometry and also allows easy parameterization. You have thin structures in the geometry. This will likely require setting up a custom mesh. In most cases I start to set up meshes in the inner delicate parts and make my way to the outside boundaries of the geometry. It may also be possible to replace thin domains by suitable boundary conditions. Good luck Edgar

Please login with a confirmed email address before reporting spam

Posted: 1 year ago Nov 24, 2022, 7:21 a.m. EST

The shield would be much better represented by zero thickness boundaries, which you can assign the magnetic shielding boundary condition. I would created the geometry within Comsol, it would not be very complex (see attached simplified model).

Note, I have not added the cut-outs in the shield (but would be simple to do). The magnetic shielding boundary condition allows you to add a thickness. In this model I have defined it with a relative permeability, but you could assign a BH curve (the one from the Silicon Steel material) too.

Obviously the attached is not to scale, and uses different current in the coil, but you get the idea... (note it is a version 6.1 model).

By doing something similar to the attached, you will avoid the horrors of meshing that imported geometry.

Mark

The shield would be much better represented by zero thickness boundaries, which you can assign the magnetic shielding boundary condition. I would created the geometry within Comsol, it would not be very complex (see attached simplified model). Note, I have not added the cut-outs in the shield (but would be simple to do). The magnetic shielding boundary condition allows you to add a thickness. In this model I have defined it with a relative permeability, but you could assign a BH curve (the one from the Silicon Steel material) too. Obviously the attached is not to scale, and uses different current in the coil, but you get the idea... (note it is a version 6.1 model). By doing something similar to the attached, you will avoid the horrors of meshing that imported geometry. Mark


Please login with a confirmed email address before reporting spam

Posted: 1 year ago Nov 28, 2022, 8:28 p.m. EST

Thank you both so much! I will continue to work on it.

Thank you both so much! I will continue to work on it.

Please login with a confirmed email address before reporting spam

Posted: 1 year ago Nov 29, 2022, 10:48 p.m. EST

The shield would be much better represented by zero thickness boundaries, which you can assign the magnetic shielding boundary condition. I would created the geometry within Comsol, it would not be very complex (see attached simplified model).

Note, I have not added the cut-outs in the shield (but would be simple to do). The magnetic shielding boundary condition allows you to add a thickness. In this model I have defined it with a relative permeability, but you could assign a BH curve (the one from the Silicon Steel material) too.

Obviously the attached is not to scale, and uses different current in the coil, but you get the idea... (note it is a version 6.1 model).

By doing something similar to the attached, you will avoid the horrors of meshing that imported geometry.

Mark

Hi,

I want to follow up with this message. I followed this much simplier method of creating the magnetic shield and was able to mesh it successfully, thankfully. However, I am now running into an error when computing. It reads something similiar to "maximum number of Newton iterations reached" and I have been able to fix this error in the past when this error message appeared in different simulations; however, the methods that I have tried are not working now. I ignored many of the edges in the shield; however, I am not sure if that is helping me in this situation. The "ignore edges" can be disabled if need be. I also tried decreasing the relative tolerarnce from .001 to .0001, which also did not help. I cleared the mesh and the solutions and set the relative tolerance back to its original value of .001 and I have attached my file below if anyone could please take a look and let me know if they see what is wrong. Let me know, and thank you so much.

>The shield would be much better represented by zero thickness boundaries, which you can assign the magnetic shielding boundary condition. I would created the geometry within Comsol, it would not be very complex (see attached simplified model). > >Note, I have not added the cut-outs in the shield (but would be simple to do). The magnetic shielding boundary condition allows you to add a thickness. In this model I have defined it with a relative permeability, but you could assign a BH curve (the one from the Silicon Steel material) too. > >Obviously the attached is not to scale, and uses different current in the coil, but you get the idea... (note it is a version 6.1 model). > >By doing something similar to the attached, you will avoid the horrors of meshing that imported geometry. > >Mark Hi, I want to follow up with this message. I followed this much simplier method of creating the magnetic shield and was able to mesh it successfully, thankfully. However, I am now running into an error when computing. It reads something similiar to "maximum number of Newton iterations reached" and I have been able to fix this error in the past when this error message appeared in different simulations; however, the methods that I have tried are not working now. I ignored many of the edges in the shield; however, I am not sure if that is helping me in this situation. The "ignore edges" can be disabled if need be. I also tried decreasing the relative tolerarnce from .001 to .0001, which also did not help. I cleared the mesh and the solutions and set the relative tolerance back to its original value of .001 and I have attached my file below if anyone could please take a look and let me know if they see what is wrong. Let me know, and thank you so much.


Please login with a confirmed email address before reporting spam

Posted: 1 year ago Nov 30, 2022, 9:25 a.m. EST

I think you can delete the "ignore edges"...

Also, I have changed the length factor in the Geometry Analysis to 4 (doesn't affect the solving but will affect the values of results).

In order to troubleshoot, I would start by making some further simplifications, maybe making your shield with a relative permeability magnetization model (maybe start with a value of 1000).

Also, start off with linear discretisation in the mf node, rather than quadratic.

I tried the above tweaks and it solves in a few minutes. You can then try adding in a BH curve definition to see if it is that causing the model to not solve... if it is, then there may be some further guidance you can seek with the knowledge that it is the BH curve defition that is causing the model to fall over.

As always, start simple and include more complexity if it is justified...

I think you can delete the "ignore edges"... Also, I have changed the length factor in the Geometry Analysis to 4 (doesn't affect the solving but will affect the values of results). In order to troubleshoot, I would start by making some further simplifications, maybe making your shield with a relative permeability magnetization model (maybe start with a value of 1000). Also, start off with linear discretisation in the mf node, rather than quadratic. I tried the above tweaks and it solves in a few minutes. You can then try adding in a BH curve definition to see if it is that causing the model to not solve... if it is, then there may be some further guidance you can seek with the knowledge that it is the BH curve defition that is causing the model to fall over. As always, start simple and include more complexity if it is justified...


Please login with a confirmed email address before reporting spam

Posted: 1 year ago Dec 2, 2022, 7:49 p.m. EST

So, basically I have a working simulation involving two magnetic shields and coils that are actually going to be constructed very soon for the project that I am working on. I had to change the shape of the shield which is why I am now working with the file referenced above.

In the file above, I see that the model solves very quickly when using the relative permeability magnetization model; however, I have to use the BH curve model. When I use the BH curve model, the computation fails. In my working simulation, I use the BH curve model, use a quadratic discetisation, and I use the direct solver. I tried running my new simulation with the more simple settings that were suggested (linear discreisation, relative permebility magnetization model, and a different solver) but it did not work. I then enabled the "ignore edges" again (because in my working simulation, ignoring the edges was necessary) and I then tried computing with the same more complex settings that I have in my working simultion; however, that did not work either. I keep getting the same error message stating "Failed to find a solution. Maximum number of Newton iterations reached. Returned solution is not converged. Not all parameter steps returned".

I am not sure what is different between my new simulation and my simulation that works other than the fact that I changed the shape of the shield. I tried using a mesh with less degrees of freedom because I know the direct solver uses a lot of RAM; however, that also did not help. I attached both simulations below. I have not added the 2nd shield into the new simulation yet because I want to get it working first with just the one shield and then I will add in the second shield. If you / anyone could take a look I would greatly appreciate it!

The older simulation that works with the 2 shields is the one called "magshield_newcoils_fixed" The newer simulation is the one called "magshield...simplified"

So, basically I have a working simulation involving two magnetic shields and coils that are actually going to be constructed very soon for the project that I am working on. I had to change the shape of the shield which is why I am now working with the file referenced above. In the file above, I see that the model solves very quickly when using the relative permeability magnetization model; however, I have to use the BH curve model. When I use the BH curve model, the computation fails. In my working simulation, I use the BH curve model, use a quadratic discetisation, and I use the direct solver. I tried running my new simulation with the more simple settings that were suggested (linear discreisation, relative permebility magnetization model, and a different solver) but it did not work. I then enabled the "ignore edges" again (because in my working simulation, ignoring the edges was necessary) and I then tried computing with the same more complex settings that I have in my working simultion; however, that did not work either. I keep getting the same error message stating "Failed to find a solution. Maximum number of Newton iterations reached. Returned solution is not converged. Not all parameter steps returned". I am not sure what is different between my new simulation and my simulation that works other than the fact that I changed the shape of the shield. I tried using a mesh with less degrees of freedom because I know the direct solver uses a lot of RAM; however, that also did not help. I attached both simulations below. I have not added the 2nd shield into the new simulation yet because I want to get it working first with just the one shield and then I will add in the second shield. If you / anyone could take a look I would greatly appreciate it! The older simulation that works with the 2 shields is the one called "magshield_newcoils_fixed" The newer simulation is the one called "magshield...simplified"


Please login with a confirmed email address before reporting spam

Posted: 1 year ago Dec 5, 2022, 6:11 a.m. EST

OK, so it seems you have identified the BH curve as the source of the failure. The following Blog post may have the answer for you.

https://www.comsol.com/blogs/how-the-b-h-curve-affects-a-magnetic-analysis-and-how-to-improve-it/

The Blog looks at what can happen if the BH data is not smooth enough, and the error you have seen is mentioned.

It seems you may need to add some additional points and/or run your data through the B-H curve checker application (linked to in the Blog).

The material you use from the built-in library (Silicon Steel GO 3408 does not seem to have been optiomised according to the list on the blog).

I hope the above helps!

Mark

OK, so it seems you have identified the BH curve as the source of the failure. The following Blog post may have the answer for you. https://www.comsol.com/blogs/how-the-b-h-curve-affects-a-magnetic-analysis-and-how-to-improve-it/ The Blog looks at what can happen if the BH data is not smooth enough, and the error you have seen is mentioned. It seems you may need to add some additional points and/or run your data through the B-H curve checker application (linked to in the Blog). The material you use from the built-in library (Silicon Steel GO 3408 does not seem to have been optiomised according to the list on the blog). I hope the above helps! Mark

Please login with a confirmed email address before reporting spam

Posted: 1 year ago Dec 5, 2022, 11:57 a.m. EST
Updated: 1 year ago Dec 6, 2022, 11:33 a.m. EST

Hi Mark,

Thank you for the tip! I am trying this now.

Hi Mark, Thank you for the tip! I am trying this now.

Please login with a confirmed email address before reporting spam

Posted: 1 year ago Dec 6, 2022, 12:10 p.m. EST

The BH curve checker solved the problem!

The BH curve checker solved the problem!

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.