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.

How to ensure spatial sampling requirements are met?

Please login with a confirmed email address before reporting spam

Dear all,

I would like to ask experienced users how do they ensure that spatial sampling requirements on geometry are met? For now, I just keep on enhancing my mesh and then solve the model to see that everything is right. However, I don't think this is an educated approach. After prototyping a small geometry this way I like to enlarge things for extended simulations and sometimes I have noticed this to have resulted in a coarser mesh and unexpectedly poorer results. May be it is due to my lack of formal learning exposure to FEM or I could not spot something of significance in Comsol's literature. So I would request people who think a more learned approach is possible to give me some tips on that.

To exemplify the question above, suppose I have a 2D rectangular domain of both height and width equal to 1 micro-meter. In plain case of finite difference, I would like my domain to be sampled with a period of 100 nano-meters max in both directions. What parameters I could provide to comsol to ensure that? And now if I keep the height constant but enlarge the width of my domain to, say, 10 micro-meters, what parameters would I need to change, if at all, to ensure that I don't bypass minimum sampling requirements?

Any explanations or pointers to literature would be highly appreciated.

Thank you.

4 Replies Last Post Jun 1, 2010, 7:12 a.m. EDT
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 31, 2010, 6:58 a.m. EDT
Hi

you have a delicate questions there, and I do not believe there is ON response, there are already a few discussions on the forum about mesh density (try a search left to the [Go] just above ;)

My way is
1) consider the physics what are the gradients of the fileds I'm solving for ? if it is periodic I would want to have at least 5 points per periode (>=2 is the theory, but for me that ti too coarse and risky), for gradients with steep slopes I would like to have gradients below 30° or height length rations of 1:2 at most, again on average.
All this is very physics dependent, are you talking about waves, thermal diffusion, structural stress ...

2) identify stress concetrations ponts/regions and increase the mesh there

The risk is that you then get a very dense mesh from the beginning, long to solve while you are still debugging your model. SO starting with a corse one is not that bad.

You also have the "solver refinement" option to improve the mesh quality (refine locally) or you can do it by a "box" in 2D

Then, as final check rune 1,2,3 simulations by refining the mes 1x, 2x ad observe the changes on teh results, from the moment you have less than 10% change I'm rather happy.

By the way, do also a mesh statistics check, the higher the better but I accept 3D mesh down to 0.1 without really being worried, you can also plot the mesh quality, to help you identify where to improve.

Have fun Comsoling
Ivar
Hi you have a delicate questions there, and I do not believe there is ON response, there are already a few discussions on the forum about mesh density (try a search left to the [Go] just above ;) My way is 1) consider the physics what are the gradients of the fileds I'm solving for ? if it is periodic I would want to have at least 5 points per periode (>=2 is the theory, but for me that ti too coarse and risky), for gradients with steep slopes I would like to have gradients below 30° or height length rations of 1:2 at most, again on average. All this is very physics dependent, are you talking about waves, thermal diffusion, structural stress ... 2) identify stress concetrations ponts/regions and increase the mesh there The risk is that you then get a very dense mesh from the beginning, long to solve while you are still debugging your model. SO starting with a corse one is not that bad. You also have the "solver refinement" option to improve the mesh quality (refine locally) or you can do it by a "box" in 2D Then, as final check rune 1,2,3 simulations by refining the mes 1x, 2x ad observe the changes on teh results, from the moment you have less than 10% change I'm rather happy. By the way, do also a mesh statistics check, the higher the better but I accept 3D mesh down to 0.1 without really being worried, you can also plot the mesh quality, to help you identify where to improve. Have fun Comsoling Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 1, 2010, 6:05 a.m. EDT
Thank you so much Ivar for your response. However, I would appreciate if you could give some comments on the next aspect of the problem.

Suppose you have determined field gradients and how many points you need in different subdomains of your geometry. How would you specify your requirement to Comsol? Is there a way of doing it by defining various options in, say, free-mesh parameters or anything else for that matter?

Up till now, I have been playing with free-mesh parameters in different sections of geometry. But so far as I see, I could not come with a reliable explanation of my own as to how it can be used to manage a constant mesh density when size of the geometry is changed by some order of magnitude.

I actually need to learn this, if possible, so that I could easily iterate my script over different size factors of my geometry.
Thank you so much Ivar for your response. However, I would appreciate if you could give some comments on the next aspect of the problem. Suppose you have determined field gradients and how many points you need in different subdomains of your geometry. How would you specify your requirement to Comsol? Is there a way of doing it by defining various options in, say, free-mesh parameters or anything else for that matter? Up till now, I have been playing with free-mesh parameters in different sections of geometry. But so far as I see, I could not come with a reliable explanation of my own as to how it can be used to manage a constant mesh density when size of the geometry is changed by some order of magnitude. I actually need to learn this, if possible, so that I could easily iterate my script over different size factors of my geometry.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 1, 2010, 6:10 a.m. EDT
Oh and I am doing transient electromagnetic simulations in version 3.5. And as I see it, solver mesh refinement is not a possibility.
Oh and I am doing transient electromagnetic simulations in version 3.5. And as I see it, solver mesh refinement is not a possibility.

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 Jun 1, 2010, 7:12 a.m. EDT
Hi

the mesh refinement is probably not everywhere (any applications, I cannot check no direct access to COMSOL just now), but for the manual mesh options check the doc (index the pdf files and run a search for mesh) you have many mesh settings, the predefined ones (a series of from extremely fine to extremely coarse) that take into account the overall sizes of your parts and adapto to it, and then you can play with all the individual settings, by the way you ave a full day training course organised by COMSOL regularly on meshing, this really gies you a "kick-start").

In V3.5 you cannot store the mesh methodology, this is rather frustrating, I uually wrote it down on a separate txt file to know how to restart, as when you do a model reset, you lose all meshes and you must restart maually from scratch (easiest is automatic, you just click mesh, OK if works and you can still solve your model in a reasonnable amount of time). In V4 this is highly improves, as you mesh sequence is stored and you can always go back, adapt it recalculate it, or even try out several and switch between the meshes (your model file grows close to a Gb if you have a true CAD model though, and it's aready quity compressed !

Finally, I'm mostly finsihing up my models by running 2-3 models with finer and finer mesh (global refinement button) and check how my results change, it's a perfectly agreed and recognised iterative method for FEM.

I would say, start with a rather coarse mesh, it solves quicker, you can always "refine later", furst one must ensuire that the global model is correct.

Have fun Comsoling
Ivar
Hi the mesh refinement is probably not everywhere (any applications, I cannot check no direct access to COMSOL just now), but for the manual mesh options check the doc (index the pdf files and run a search for mesh) you have many mesh settings, the predefined ones (a series of from extremely fine to extremely coarse) that take into account the overall sizes of your parts and adapto to it, and then you can play with all the individual settings, by the way you ave a full day training course organised by COMSOL regularly on meshing, this really gies you a "kick-start"). In V3.5 you cannot store the mesh methodology, this is rather frustrating, I uually wrote it down on a separate txt file to know how to restart, as when you do a model reset, you lose all meshes and you must restart maually from scratch (easiest is automatic, you just click mesh, OK if works and you can still solve your model in a reasonnable amount of time). In V4 this is highly improves, as you mesh sequence is stored and you can always go back, adapt it recalculate it, or even try out several and switch between the meshes (your model file grows close to a Gb if you have a true CAD model though, and it's aready quity compressed ! Finally, I'm mostly finsihing up my models by running 2-3 models with finer and finer mesh (global refinement button) and check how my results change, it's a perfectly agreed and recognised iterative method for FEM. I would say, start with a rather coarse mesh, it solves quicker, you can always "refine later", furst one must ensuire that the global model is correct. Have fun Comsoling 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.