Multigrid failure during solver

Topics: 4.2, Mesh, Solving, 4.4

Thread index  |  Previous thread  |  Next thread  |  Start a new discussion

RSS FeedRSS feed   |   Email notificationsTurn on email notifications   |   6 Replies   Last post: June 12, 2014 4:33pm UTC
Tim Gustafson

Tim Gustafson

February 1, 2011 10:56pm UTC

Multigrid failure during solver

Hey all,

I'm working on a 3D model of a microfluidic system using the laminar flow (spf) and transport of diluted species (chds) physics models. I've got everything modeled with all the physics settings done, and the mesh applies quickly, but when I set it to solve, it errors out saying:

"Error: Problem setting up multigrid"

Looking through the model the error appears to be when the solver creates a coarser mesh in order to get a simpler solution, the "coarse" mesh has elements too large for the geometry and so it errors out. To give an idea of what I'm working with, the microfluidic channel is 301um x 6000um x 110um with microcantilevers that are 300um x 45um x 1um in the middle.

I know this will be a very intensive model; I have a Core i7 system with 16GB of RAM dedicated to this (as well as about 200GB of virtual memory). The problem is it never even gets to needing any of that RAM (gets to about 500 MB working set and 500 MB virtual) and just errors out trying to simplify the mesh. (Or at least that's my understanding.)

Is there anything I can do to get it to stop with the multigrid preconditioner, or get it to push through it? I'm using Comsol 4.0a, and have a copy of Comsol 4.1 that I haven't upgraded to yet, so if there's a solution that needs 4.1 I can update my system.

Thanks for any advice.

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

James  Freels

James Freels

February 2, 2011 3:47am UTC in response to Tim Gustafson

Re: Multigrid failure during solver

Tim, a couple of suggestions. 1) definitely upgrade your COMSOL to the latest version. If you are entitled to any upgrade in the v4+ series, do it. It is well worth it just to gain all the new capabilities and fix bugs, gain stability, etc.
2) study up on the multigrid method. This is your best option for single node (non-parallel processing cluster) machines attempting to solve complex 3D flow models. The multigrid implementation in COMSOL is designed to work automatically for free meshes and if you use higher-order finite element shape functions. I have found that the best option is to use manually generated meshes because you will have full control over your solution and get it to fit in your machine. This requires more effort on your part, but ultimately is what you will need to get a solution if you cannot fit a direct solver in your memory. My experience is that about 20 GB of memory is required for 1 Million degrees of freedom in the direct solver as a benchmark.

How many degrees of freedom is your problem ?

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Tim Gustafson

Tim Gustafson

February 2, 2011 8:58pm UTC in response to James Freels

Re: Multigrid failure during solver


Tim, a couple of suggestions. 1) definitely upgrade your COMSOL to the latest version. If you are entitled to any upgrade in the v4+ series, do it. It is well worth it just to gain all the new capabilities and fix bugs, gain stability, etc.
2) study up on the multigrid method. This is your best option for single node (non-parallel processing cluster) machines attempting to solve complex 3D flow models. The multigrid implementation in COMSOL is designed to work automatically for free meshes and if you use higher-order finite element shape functions. I have found that the best option is to use manually generated meshes because you will have full control over your solution and get it to fit in your machine. This requires more effort on your part, but ultimately is what you will need to get a solution if you cannot fit a direct solver in your memory. My experience is that about 20 GB of memory is required for 1 Million degrees of freedom in the direct solver as a benchmark.

How many degrees of freedom is your problem ?

Thanks for the response!

1) I'll work on the upgrade as soon as I have the time; it's a network license so I need to get the license done elsewhere.

2) I've been trying to follow the multigrid method but didn't see a lot of documentation on it. Google provided almost no help, and I didn't see much listed in the support section of the site. Maybe I overlooked an obvious explanation source.

How do I manually generate a mesh to start trying that method?

Looking at the mesh statistics I have 846,788 total elements, which I'm guessing puts me easily above 1 million DoF. I don't fully understand the difference between linear, quadratic, and cubic tetrahedral elements, so I don't know which factor to multiply by to get the nodes, but since there's 1 dependent variable in the diluted species physics and 4-5 in the laminar flow, I'm guessing I'm around 5-6 million DoF.

I suppose the main options here are to either simplify the model or try to exploit potential symmetries to lessen the number of calculations?

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Ivar Kjelberg

Ivar Kjelberg

February 3, 2011 11:07am UTC in response to Tim Gustafson

Re: Multigrid failure during solver

Hi

in the KB you can find a relation (approximate one) between the DoF and elements. THe shape functions in COMSOL is more or less equivalent to selecting "higher order" elements in other FEM tools. In COMOL the emshing is rather "basic" and you apply different shape functions on the mesh to get intermediate "points" thsi is mathematically far cleaner than the traditional "numerical" way of selecting different n-node elements, in classical tools.

My first guess for a 0.8Melemen model is that you might have troule finding a normal PC with enogh RAM, in anycase such models are almost impossible to debug, better to start simpler to check the coherence of the model, than increase to mprove the results

And consider rapidly 4.1 + patches, far more stable and less frustrating to use ;)

--
Good luck
Ivar

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Tim Gustafson

Tim Gustafson

February 3, 2011 7:47pm UTC in response to Ivar Kjelberg

Re: Multigrid failure during solver


Hi

in the KB you can find a relation (approximate one) between the DoF and elements. THe shape functions in COMSOL is more or less equivalent to selecting "higher order" elements in other FEM tools. In COMOL the emshing is rather "basic" and you apply different shape functions on the mesh to get intermediate "points" thsi is mathematically far cleaner than the traditional "numerical" way of selecting different n-node elements, in classical tools.

My first guess for a 0.8Melemen model is that you might have troule finding a normal PC with enogh RAM, in anycase such models are almost impossible to debug, better to start simpler to check the coherence of the model, than increase to mprove the results

And consider rapidly 4.1 + patches, far more stable and less frustrating to use ;)

--
Good luck
Ivar

Thanks a lot for the help; I found the parameter that was messing up the system (I think). I simplified the model and had a 1um gap between two points that the mesh was error'ing out in, so I increased the gap to 5um (less accurate for the model, but still useful) and the mesh worked.

Out of curiosity, I noticed that during the calculations Comsol never used more than ~4GB of RAM for "working set" despite my having 16 GB available. I was thinking this might be because it's not taking advantage of the multiple cores in the system, but I've tried starting up Comsol with the "-np 8" after the prompt and it didn't change. Is there a trick or a setting to get it to use more?

In the past I've had it use all the physical RAM (old system had 8GB) as well as ~160GB of virtual memory; now neither will go above 4GB.

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Lalit  Singh  Syunary

Lalit Singh Syunary

October 18, 2013 10:43am UTC in response to Tim Gustafson

Re: Multigrid failure during solver

I am also working on a similar problem of microfluidics involving the two physics mentioned.
Since I've changed my model geometry to a more complex one, I am unable to get a solution. The problem doesn't converge even when I solve only for the Laminar Flow (spf).

It doesn't show any error but there is no output and even the convergence plots are not generated.

I've changed the mesh size to extremely coarse, still the problem persists.

Please suggest some corrective measures.

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

John Stasko

John Stasko

June 12, 2014 4:33pm UTC in response to Lalit Singh Syunary

Re: Multigrid failure during solver

I have a similar question. I have a model which is broken into two components and connected through a linear extrusion. I am using 4.4.

The first component is solved using the stationary solver, extra coarse. The second component has somewhat finer mesh.

I get the following error when trying to run the second solver,

Problem setting up multigrid.
Failed to build feature 'Boundary Layer 1' in sequence 'Mesh 1'.
Internal error accessing mesh fields.
- Detail: Type index out of bounds
Error in multiphysics compilation.

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse


Rules and guidelines