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.

Moving mesh with automatic remeshing

Please login with a confirmed email address before reporting spam

Hello

I am new to COMSOL. I have successfully run a stationary study with coupled laminar flow, nernst planck and electrostatics. For a time dependent study I am trying to use a moving mesh to move an object with the velocity calculated in between studies. I have refined my mesh pretty much but it is giving inverted elements. The velocity value calculated is also correct. For the Automatic remeshing: it is showing "Condition for remeshing fulfilled for initial time". Please help.
Thanks.

Payel

9 Replies Last Post Jun 9, 2017, 9:27 p.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Jun 7, 2017, 2:13 a.m. EDT
I'm very new to this, so this may be wrong, but I've seen this several times and I think it is because the initial conditions are far enough off from equilibrium that it has to remesh before it even completes the first iteration, which is apparently not allowed. There are several potential solutions:

1) Use adaptive meshing instead of automatic remeshing.
2) Turn down the mesh quality required for remeshing (initially set to 0.2 -- try lower quality and see if you can get it to go past the first iteration).
3) Set your system up so that it is closer to convergence from the start. (Though it sounds like this might not be your issue given the workflow you describe).
4) I suspect finer mesh will not help, but it's something else you could try.
I'm very new to this, so this may be wrong, but I've seen this several times and I think it is because the initial conditions are far enough off from equilibrium that it has to remesh before it even completes the first iteration, which is apparently not allowed. There are several potential solutions: 1) Use adaptive meshing instead of automatic remeshing. 2) Turn down the mesh quality required for remeshing (initially set to 0.2 -- try lower quality and see if you can get it to go past the first iteration). 3) Set your system up so that it is closer to convergence from the start. (Though it sounds like this might not be your issue given the workflow you describe). 4) I suspect finer mesh will not help, but it's something else you could try.

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Jun 7, 2017, 2:40 a.m. EDT
Updated: 8 years ago Jun 7, 2017, 2:48 a.m. EDT
Payel,

In addition to following Jame's instructions, try to change the condition for remeshing to "distortion". Note that by default, "mesh quality " is selected. Set it to a small value (like 0.01, zero indicates no distortion). This way, it is more probable that you get your results since the mesh distortion is zero as the simulation starts, regardless of the mesh configuration which satisfies the meshing criteria at t=0 and helps convergence.

Amin,
Payel, In addition to following Jame's instructions, try to change the condition for remeshing to "distortion". Note that by default, "mesh quality " is selected. Set it to a small value (like 0.01, zero indicates no distortion). This way, it is more probable that you get your results since the mesh distortion is zero as the simulation starts, regardless of the mesh configuration which satisfies the meshing criteria at t=0 and helps convergence. Amin,

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Jun 7, 2017, 1:06 p.m. EDT
Hello

I changed the mesh quality to 0.01 and it worked.
Thank you very much.

Payel
Hello I changed the mesh quality to 0.01 and it worked. Thank you very much. Payel

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Jun 8, 2017, 9:30 p.m. EDT
Hello

As suggested, I reduced the quality and the simulation ran. But after a certain time it is giving inverted mesh again and is not getting remeshed. Is it because it is above the given quality but there are few elements inverted? How to avoid this error?
Can you please help. Thanks.

Payel
Hello As suggested, I reduced the quality and the simulation ran. But after a certain time it is giving inverted mesh again and is not getting remeshed. Is it because it is above the given quality but there are few elements inverted? How to avoid this error? Can you please help. Thanks. Payel

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Jun 8, 2017, 9:42 p.m. EDT
My experience with inverted nodes is hard to separate from failure to converge -- they seem to frequently occur together. Given that, I think there are a few things to consider:

1) The mesh is too coarse for the geometry. Make it a couple steps finer (though this can make the model much slower).

2) The velocity is too high for the time steps being chosen. Try setting the time steps to "strict" under Time Dependent Solver -> Time Stepping."

3) Also, you might decrease the "Relative Tolerance" under Time Dependent -> Study Settings. I have read that the default value of 0.01 is too high for accurate results and that it should be decreased FAR below that for some models (0.0001 or even less -- but I'd try 0.001 first). This might sound counter-intuitive but I think the idea is that by requiring higher accuracy at each step, you prevent errors from propagating through subsequent time steps.

Hope this helps!
James
My experience with inverted nodes is hard to separate from failure to converge -- they seem to frequently occur together. Given that, I think there are a few things to consider: 1) The mesh is too coarse for the geometry. Make it a couple steps finer (though this can make the model much slower). 2) The velocity is too high for the time steps being chosen. Try setting the time steps to "strict" under Time Dependent Solver -> Time Stepping." 3) Also, you might decrease the "Relative Tolerance" under Time Dependent -> Study Settings. I have read that the default value of 0.01 is too high for accurate results and that it should be decreased FAR below that for some models (0.0001 or even less -- but I'd try 0.001 first). This might sound counter-intuitive but I think the idea is that by requiring higher accuracy at each step, you prevent errors from propagating through subsequent time steps. Hope this helps! James

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Jun 8, 2017, 10:07 p.m. EDT
Payel,

As I suggested in my previous post, try to change the remeshing criteria to "distortion" and set it to a very small value. Inverted mesh element appears when the element is distorted very much. By controlling this parameter, the warning disappears. However, the simulation takes longer to converge as the number of remeshing steps increases by doing this.

My experience with remeshing is in contrast with what James suggested about changing the mesh size.
I think using finer meshes worsens the situation and leads to lower element quality.

Amin,
Payel, As I suggested in my previous post, try to change the remeshing criteria to "distortion" and set it to a very small value. Inverted mesh element appears when the element is distorted very much. By controlling this parameter, the warning disappears. However, the simulation takes longer to converge as the number of remeshing steps increases by doing this. My experience with remeshing is in contrast with what James suggested about changing the mesh size. I think using finer meshes worsens the situation and leads to lower element quality. Amin,

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Jun 9, 2017, 12:39 p.m. EDT
Hello

I have tried keeping the distortion factor lower (0.01). But in that case it shows the same problem " condition for remeshing fulfilled for initial time".
Any idea why?

Thanks for your suggestions.
Payel
Hello I have tried keeping the distortion factor lower (0.01). But in that case it shows the same problem " condition for remeshing fulfilled for initial time". Any idea why? Thanks for your suggestions. Payel

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Jun 9, 2017, 4:27 p.m. EDT
Updated: 8 years ago Jun 9, 2017, 4:28 p.m. EDT
When you say "distortion" is that really what you mean, or do you mean "relative tolerance"? I ask because these are in two different nodes, so if you really mean you reduced the relative tolerance in "Step 1 Time Dependent" then I am wondering if you tried Mohammad's suggestion of using "distortion" as the remeshing criteria instead of "mesh quality."

If you've already tried this, I don't know. The only other thought that comes to mind is to perhaps try adaptive meshing in place of automatic remeshing. My observation has been that adaptive meshing is slower, but at least in some cases can substitute for automatic remeshing. (I confess to not really understanding the difference so if anyone would like to explain, that would be great).
When you say "distortion" is that really what you mean, or do you mean "relative tolerance"? I ask because these are in two different nodes, so if you really mean you reduced the relative tolerance in "Step 1 Time Dependent" then I am wondering if you tried Mohammad's suggestion of using "distortion" as the remeshing criteria instead of "mesh quality." If you've already tried this, I don't know. The only other thought that comes to mind is to perhaps try adaptive meshing in place of automatic remeshing. My observation has been that adaptive meshing is slower, but at least in some cases can substitute for automatic remeshing. (I confess to not really understanding the difference so if anyone would like to explain, that would be great).

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Jun 9, 2017, 9:27 p.m. EDT
Payel,

Try smaller values of distortion (i.e. 1e-3, 1e-4, until you see simulation starts running). It doesn't make sense to me though, since you said it was working without remeshing. If the problem was due to setting a large value for the remeshing criteria, it should still work without taking any remeshing steps since the condition has not been fulfilled yet.

Anyway,
Also try remeshing manually at a very early time like 1e-6 sec and see if it works. See the attached file.

Amin,
Payel, Try smaller values of distortion (i.e. 1e-3, 1e-4, until you see simulation starts running). It doesn't make sense to me though, since you said it was working without remeshing. If the problem was due to setting a large value for the remeshing criteria, it should still work without taking any remeshing steps since the condition has not been fulfilled yet. Anyway, Also try remeshing manually at a very early time like 1e-6 sec and see if it works. See the attached file. Amin,

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.