Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

3D Meshing in COMSOL

Please login with a confirmed email address before reporting spam

Hello,

When using the 3D space geometry in COMSOL, I'm seeing a lot of jaggedness (from numerical noise) in my plots even after meshing several times.

I've attached a COMSOL file with a very simple 1 magnet system where I'm seeing a lot of jaggedness when plotting the magnetic fields. It seems to me that with such a simple system, I should be able to get a more accurate result.

To simulate the air around the magnet, I put two spheres around the magnet and set the outer one to spherical infinite elements. Is this the best thing to do?

Looking at the meshing, it seems to me that COMSOL is meshing the same amount everything in the sphere. (When using the 2D space geometry, normally it meshes more inside and near the magnet than the rest of the space.) Is there a way to improve the quality of meshing for 3D?

Any advice anyone could give me about this would be greatly appreciated.

Thank you,
Kevin


2 Replies Last Post May 13, 2011, 12:55 a.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago May 11, 2011, 7:06 p.m. EDT
Can anyone help me please? It seems to me that with such a simple system, I should be able to get a more accurate result.
Can anyone help me please? It seems to me that with such a simple system, I should be able to get a more accurate result.

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 May 13, 2011, 12:55 a.m. EDT
Hi

I do not see anything that special, you are in 3D that is element consuming, hence computing expensive to get fine and precise results.

Nevertheless, what I would have done is the following:

1) place the magnet in the middle of the sphere
2) mesh the magnet with a finer mesh, and the air perhaps even with a coarser. As the magnet has a fine mesh, the "air" just around it would also get a fine mesh, then it will "coarsen" going outwards
3) sharp edges are always tricky, these represent singularities and tend to make hot spots, someof it might be numerical, but there are also physics behind, the atoms that are on the boundary layer of any object have a different environment than those all surrounded by a homogenious material, edge oor phringe effects are not "just" numeric

Example:
Take a thermal stress (TS in v4) model, in 3D, stationary, draw a sphere, a cylinder and a block (default dimensions, make have them distinct, not overlapping). Give them some simple (constant) material properties, i.e. aluminium.
Now in "TS" means solid strucutral and one of the rules is to attach somewhat your material in space. To do this there will be new "spring" BC in v4.2, but in 3.5 and up to 4.1 you "just" add volume force on all domains and call it

Fvol = (-Kx*u,-Ky*v, -Kz*w)

where Kx,Ky,Kz is you spring value (1 or 1000 N/m/m^3 should do). For the temperature you need to fixe one boundary per item to a fixed T=T0 of the default 293.15K

Then solve like that, you might see the mesh structure imprints in the "sqrt(eps)" numerical level = numerical noise.

Then if you give a different initial (& fixed) temperature and resolve: as expected no changes.

But if you add a temperature gradient by defining two fixed temperatures on two opposed sides you will start to get stress in the sharp corners (for the domains that have "corners". By playing with the Kxyz spring value you can estimate how much i due to the expansion and the soft spring and how much is due to thermal stress buildup. You might also turn "off" nu=0 the cross coupling term of stress-strain to have a fluid type material and see that effect too

And finally play a little with the mesh to see what is directly mess density related

For your case you could try the same but make these shapes magnets (+ air and infinite elements to loop the field lines properly). Then try to make the cylinder and the cube with filleted corners

--
Good luck
Ivar
Hi I do not see anything that special, you are in 3D that is element consuming, hence computing expensive to get fine and precise results. Nevertheless, what I would have done is the following: 1) place the magnet in the middle of the sphere 2) mesh the magnet with a finer mesh, and the air perhaps even with a coarser. As the magnet has a fine mesh, the "air" just around it would also get a fine mesh, then it will "coarsen" going outwards 3) sharp edges are always tricky, these represent singularities and tend to make hot spots, someof it might be numerical, but there are also physics behind, the atoms that are on the boundary layer of any object have a different environment than those all surrounded by a homogenious material, edge oor phringe effects are not "just" numeric Example: Take a thermal stress (TS in v4) model, in 3D, stationary, draw a sphere, a cylinder and a block (default dimensions, make have them distinct, not overlapping). Give them some simple (constant) material properties, i.e. aluminium. Now in "TS" means solid strucutral and one of the rules is to attach somewhat your material in space. To do this there will be new "spring" BC in v4.2, but in 3.5 and up to 4.1 you "just" add volume force on all domains and call it Fvol = (-Kx*u,-Ky*v, -Kz*w) where Kx,Ky,Kz is you spring value (1 or 1000 N/m/m^3 should do). For the temperature you need to fixe one boundary per item to a fixed T=T0 of the default 293.15K Then solve like that, you might see the mesh structure imprints in the "sqrt(eps)" numerical level = numerical noise. Then if you give a different initial (& fixed) temperature and resolve: as expected no changes. But if you add a temperature gradient by defining two fixed temperatures on two opposed sides you will start to get stress in the sharp corners (for the domains that have "corners". By playing with the Kxyz spring value you can estimate how much i due to the expansion and the soft spring and how much is due to thermal stress buildup. You might also turn "off" nu=0 the cross coupling term of stress-strain to have a fluid type material and see that effect too And finally play a little with the mesh to see what is directly mess density related For your case you could try the same but make these shapes magnets (+ air and infinite elements to loop the field lines properly). Then try to make the cylinder and the cube with filleted corners -- 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.