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.
Multigrid failure during solver
Posted Feb 1, 2011, 5:56 p.m. EST Computational Fluid Dynamics (CFD), Geometry, Mesh, Studies & Solvers 8 Replies
Please login with a confirmed email address before reporting spam
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.
Please login with a confirmed email address before reporting spam
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 ?
Please login with a confirmed email address before reporting spam
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?
Please login with a confirmed email address before reporting spam
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
Please login with a confirmed email address before reporting spam
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.
Please login with a confirmed email address before reporting spam
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.
Please login with a confirmed email address before reporting spam
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.
Please login with a confirmed email address before reporting spam
Since now I have these suggestion :
1- change the iterative method to the direct in Advance control through solver setting
2- use a stationary step in advance for solving single phase flow then a time dependent step for component's transfer
3- take care of your boundary condition especially for inlet velocity in spf model.
Best regards
Please login with a confirmed email address before reporting spam
Regarding this question about the Multigrid solver, there is also a knowledgebase entry that addresses this issue and how you can resolve it, please see:
www.comsol.com/support/knowledgebase/1213/
Best Regards,
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.
Suggested Content
- KNOWLEDGE BASE Error: Failure Loading MATLAB Libraries. This model requires that MATLAB is available.
- KNOWLEDGE BASE The MUMPS Solver Crashes or Hangs During Cluster Simulation
- FORUM failure
- BLOG Using the Algebraic Multigrid (AMG) Method for Large CFD Simulations
- KNOWLEDGE BASE Improving Convergence of Transient Models