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.

Imported CAD model increase in number of elements

Please login with a confirmed email address before reporting spam

Hi,

I am trying to mesh an imported model (created parasolid & also in Solidworks) in COMSOL for a RF problem. It is a very basic model which includes three concentric cylinders. There are no tiny features to defeature at all. But if I create the same model in COMSOL it takes around70,000 elements. If I try to mesh the same model imported from parasolid or solidworks the number of elements shoots up to more than twice ( around 150,000). Again the geometry is pretty basic.

how do I reduce the number of elements? I am running a 2GB machine with 32bit comsol hence not able to solve this problem.

5 Replies Last Post Jan 10, 2010, 5:37 a.m. EST
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 Jan 6, 2010, 4:56 p.m. EST
Hi

cannot really tell why it should be different if the sizes and shapes are the same, except if you have changed the default mesh settings, or that COMSOL has reset an internal scaling factor.
In anycase for RF you must also check that your mesh is fine enough to resolve the wavelength, which mostly imply fine mesh and many elements.

Check the doc about meshing and default mesh sizes, you can adapt with the lower +/- buttons on the mesh GUI border, but deciding for the meshing and its size is not innocent w.r.t. FEM results validity

That is why , when one can, its better to work in 2D or 2D axisymmetric as you have far fewer elements to handle, and it solves far quicker.

As a last step one could try a revolve into 3D nd run it as a check, if the RAM holds.

Good luck
Ivar
Hi cannot really tell why it should be different if the sizes and shapes are the same, except if you have changed the default mesh settings, or that COMSOL has reset an internal scaling factor. In anycase for RF you must also check that your mesh is fine enough to resolve the wavelength, which mostly imply fine mesh and many elements. Check the doc about meshing and default mesh sizes, you can adapt with the lower +/- buttons on the mesh GUI border, but deciding for the meshing and its size is not innocent w.r.t. FEM results validity That is why , when one can, its better to work in 2D or 2D axisymmetric as you have far fewer elements to handle, and it solves far quicker. As a last step one could try a revolve into 3D nd run it as a check, if the RAM holds. Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jan 6, 2010, 5:55 p.m. EST
Hello Ivar,

Here is one thing I have noticed. In the concentric cylinder problem when difference in the sizes of the cylinders was big the number of elements the COMSOL created model took was less than half it took for the imported model.

lets say there are 3 cylinders with radius" R1, R2,R3,Length."

For COMSOL "5,7,50,100". No of elements- 24817
For Parasolid "5,7,50,100" No of elements- 24296


For COMSOL "0.5,0.7,50,100" No of elements-33,689

For parasolid "0.5,0.7,50,100" No of elements-88471



Hello Ivar, Here is one thing I have noticed. In the concentric cylinder problem when difference in the sizes of the cylinders was big the number of elements the COMSOL created model took was less than half it took for the imported model. lets say there are 3 cylinders with radius" R1, R2,R3,Length." For COMSOL "5,7,50,100". No of elements- 24817 For Parasolid "5,7,50,100" No of elements- 24296 For COMSOL "0.5,0.7,50,100" No of elements-33,689 For parasolid "0.5,0.7,50,100" No of elements-88471

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 Jan 7, 2010, 1:03 a.m. EST
Hi

Thanks for the hint, I'll try it out too, when I have a moment.

I can only guess, but I suspect that COMSOL generates an internal scaling value when making/importing the geometries, probably its also linked to the import "repair variable" size, this makes sens.
You could try to translate the the parasolid model into a composite COMSOL objexcct (select all + compose + keep interiour boundaries) and then mesh it.

In any case, for the mesh density you should first of all check your physics, the local wavelength compared to the geometry sizes, ot the expected gradients compared to the geoemtry etc and then decide for a mesh such that at least you have 5 elements per wavelength (do not forget that the index of the material changes the local wavelength "length". , and as you sayd, adapt the meshing parameters to model the detqails as needed, or defeature whatever unecessary.

Do not forget that the binary representation of number is very sparse, you have best density between 0 and 0.5, or 0 and1 depending on the real value coding. Therefore it's important to scale correctly your internal values for the matrix manipulations, and I'm convinced that COMSOL is doing this in detail, internally.

Good luck
Ivar
Hi Thanks for the hint, I'll try it out too, when I have a moment. I can only guess, but I suspect that COMSOL generates an internal scaling value when making/importing the geometries, probably its also linked to the import "repair variable" size, this makes sens. You could try to translate the the parasolid model into a composite COMSOL objexcct (select all + compose + keep interiour boundaries) and then mesh it. In any case, for the mesh density you should first of all check your physics, the local wavelength compared to the geometry sizes, ot the expected gradients compared to the geoemtry etc and then decide for a mesh such that at least you have 5 elements per wavelength (do not forget that the index of the material changes the local wavelength "length". , and as you sayd, adapt the meshing parameters to model the detqails as needed, or defeature whatever unecessary. Do not forget that the binary representation of number is very sparse, you have best density between 0 and 0.5, or 0 and1 depending on the real value coding. Therefore it's important to scale correctly your internal values for the matrix manipulations, and I'm convinced that COMSOL is doing this in detail, internally. Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jan 7, 2010, 4:09 p.m. EST
Hello Ivar,

Thanks for the feedback I appreciate it.

I am sorry but I did not get this last para in your response. Could please let me know what his was about.

"Do not forget that the binary representation of number is very sparse, you have best density between 0 and 0.5, or 0 and1 depending on the real value coding."
Hello Ivar, Thanks for the feedback I appreciate it. I am sorry but I did not get this last para in your response. Could please let me know what his was about. "Do not forget that the binary representation of number is very sparse, you have best density between 0 and 0.5, or 0 and1 depending on the real value coding."

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 Jan 10, 2010, 5:37 a.m. EST
Hi there

Well if you have done some numerical coding (but today most people can use programmes that mostly take care of this, like COMSOL) you would probably have learned that the binary representation of real numbers is not regularly distributed, if you write 1.234567 this might not exist as a binary representation and you get back a number only "close" to this value. In fact you see that in COMSOL, when you define 0. 0.5 etc, often the final results are 3e-16 or 4.99999...5e-1. Now, when you look how the number are distributed between 0 to infinity then this distribution is not regular (in decimal coded number you always know that you have X significative digits, in binary not, even when transformed to decimal).

That is why you should mostly renormalise your numbers to have them varying between 0 and 1, when possible, because that is where you have the highest density too, hence least chances for numerical errors.

Inside COMSOL the solvers mostly take care of this, but when we define new equations, or use the weak terms extensively COMSOL cannot always know where these values will end up, therefore its is sometimes required to renormalise these elements, either directly in the fonction defintions, or in the solver options.

Find a book on numerical coding/simulations, mostly they start with a few chapters on number representation, unfortunately mine are at work so I cannot give the references just now
Good luck
Ivar
Hi there Well if you have done some numerical coding (but today most people can use programmes that mostly take care of this, like COMSOL) you would probably have learned that the binary representation of real numbers is not regularly distributed, if you write 1.234567 this might not exist as a binary representation and you get back a number only "close" to this value. In fact you see that in COMSOL, when you define 0. 0.5 etc, often the final results are 3e-16 or 4.99999...5e-1. Now, when you look how the number are distributed between 0 to infinity then this distribution is not regular (in decimal coded number you always know that you have X significative digits, in binary not, even when transformed to decimal). That is why you should mostly renormalise your numbers to have them varying between 0 and 1, when possible, because that is where you have the highest density too, hence least chances for numerical errors. Inside COMSOL the solvers mostly take care of this, but when we define new equations, or use the weak terms extensively COMSOL cannot always know where these values will end up, therefore its is sometimes required to renormalise these elements, either directly in the fonction defintions, or in the solver options. Find a book on numerical coding/simulations, mostly they start with a few chapters on number representation, unfortunately mine are at work so I cannot give the references just now Good luck Ivar

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.