CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

GAMG hexa vs. tetrahedron meshes

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree20Likes
  • 18 Post By MartinB
  • 1 Post By MartinB
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 16, 2010, 12:14
Default GAMG hexa vs. tetrahedron meshes
  #1
Senior Member
 
Claus Meister
Join Date: Aug 2009
Location: Wiesbaden, Germany
Posts: 241
Rep Power: 17
idrama is on a distinguished road
Hello Foamers!

Has anybody experience to set up GAMG for hexa or tetraeder? On tet, Do I have to increase, for instance, smoother iteration or merge levels?

Cheers in advance
idrama is offline   Reply With Quote

Old   July 16, 2010, 13:23
Default
  #2
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
Hi Claus,

in my opinion it doesn't matter for GAMG if you are using hexas or tetras. A good choice of settings for my projects is:
Code:
solvers
{
    U                                   // linear equation system solver for U
    {
        solver          smoothSolver;   // solver type
        smoother        GaussSeidel;    // smoother type
        tolerance       1e-06;          // solver finishes if either absolute
        relTol          0.01;           // tolerance is reached or the relative
                                        // tolerance here
        nSweeps         1;              // setting for smoothSolver
        maxIter         100;            // limitation of iterations number
    }
    pd                                  // linear equation system solver for pd
    {
        solver          GAMG;           // very efficient multigrid solver
        tolerance       1e-07;          // solver finishes if either absolute
        relTol          0.001;          // tolerance is reached or the relative
                                        // tolerance here
        minIter         3;              // a minimum number of iterations
        maxIter         100;            // limitation of iterions number
        smoother        DIC;            // setting for GAMG
        nPreSweeps      1;              // 1 for pd, set to 0 for all other!
        nPostSweeps     2;              // 2 is fine
        nFinestSweeps   2;              // 2 is fine
        scaleCorrection true;           // true is fine
        directSolveCoarsestLevel false; // false is fine
        cacheAgglomeration on;          // on is fine; set to off, if dynamic
                                        // mesh refinement is used!
        nCellsInCoarsestLevel 500;      // 500 is fine,
                                        // otherwise sqrt(number of cells)
        agglomerator    faceAreaPair;   // faceAreaPair is fine
        mergeLevels     1;              // 1 is fine
    }
}
Important to note:
- nPreSweeps must be 0 for other equation systems than pressure
- to use the minIter option you must patch GAMG sources in most OpenFOAM versions
- cacheAgglomeration must be switched off when using dynamic mesh refinement

Playing with the options don't give remarkable speedup for my problems.

Martin
MartinB is offline   Reply With Quote

Old   July 17, 2010, 05:19
Default
  #3
Senior Member
 
Claus Meister
Join Date: Aug 2009
Location: Wiesbaden, Germany
Posts: 241
Rep Power: 17
idrama is on a distinguished road
Thanks MartinB, the informations are valueable for me! However, there is one question concernins the option nCellsInCorseLeve: Why the sqrt of the cells? Have you an paper or something like that?

Cheers
idrama is offline   Reply With Quote

Old   July 17, 2010, 06:03
Default
  #4
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
Hi Claus,
I found the hint for sqrt(#cells) in the forum some time ago and made a note in my fvSolution template without paying too much attention to it...

This might be an interesting thread (especially the links to the PDFs), if you want to use some variants of AMG:
http://www.cfd-online.com/Forums/ope...41dev-svn.html
However it could be some work to integrate these solvers and preconditioners in the newer OpenFOAM versions.

Martin
rajibroy likes this.
MartinB is offline   Reply With Quote

Old   July 19, 2010, 08:59
Default
  #5
Senior Member
 
Claus Meister
Join Date: Aug 2009
Location: Wiesbaden, Germany
Posts: 241
Rep Power: 17
idrama is on a distinguished road
Do you probaly mean: If I have n processors then I have to take (total no. cells)^(1/n)?
idrama is offline   Reply With Quote

Old   July 19, 2010, 09:30
Default
  #6
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
I mean: sqrt(1000000) = 1000
But: I never tested it in more detail... my value of 500 was fine, changing it had no big influence on my computation speed.
You can test it out: start your simulation, change the value after a few iterations and check the new iteration times. Then make another change and check again...

Many other posts in the forum prefer values of 10 to 30 for nCellsInCoarsestLevel...
http://www.cfd-online.com/OpenFOAM_D...tml?1162930507

Martin
MartinB is offline   Reply With Quote

Old   September 1, 2013, 05:54
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
FYI: For future reference, the link on the previous post is for the following thread in the new forum format: http://www.cfd-online.com/Forums/ope...rsus-iccg.html
wyldckat is offline   Reply With Quote

Old   September 26, 2018, 10:49
Default
  #8
New Member
 
Join Date: Aug 2018
Posts: 9
Rep Power: 7
mszeto715 is on a distinguished road
Hi,

Thank you for your assistance. I am wondering: where do these values stem from? Specifically, why does nPreSweeps need to be 1 for pd?

-Mimi
mszeto715 is offline   Reply With Quote

Old   September 26, 2018, 17:06
Default
  #9
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer: I can never remember off-hand which equations have a symmetric A matrix and which ones have an asymmetric A matrix... but the "nPreSweeps" has to be set to 1 probably because the "pd" (pressure) equation is the opposite type of symmetry from the other equations.
__________________
wyldckat is offline   Reply With Quote

Old   September 27, 2018, 16:44
Default
  #10
New Member
 
Join Date: Aug 2018
Posts: 9
Rep Power: 7
mszeto715 is on a distinguished road
Thanks for responding. I have an easier simpler question. What encompasses one iteration? In the log file, I'll get something like "GAMG: Solving for pd, Initial residual = 3.833447548e-13, Final residual = 3.908110229e-15, No Iterations 2."

What are the two iterations? Is that one V cycle? multiple V cycles? I can't seem to find a good answer anywhere.

-Mimi
mszeto715 is offline   Reply With Quote

Old   September 27, 2018, 17:14
Default
  #11
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer: I don't know what a V-cycle technically is, but the number of iterations is how many iterations it does to try and solve the "A*x=b" equation.
It (usually) does not include how many intermediate passes it does within the matrix solver, e.g. pre/post-sweeps are not accounted by the number of iterations.

In foam-extend, you can find:
  • the GAMG solver code in the folder "$FOAM_SRC/foam/matrices/lduMatrix/solvers/AMG";
  • the GAMG preconditioner at "$FOAM_SRC/foam/matrices/lduMatrix/preconditioners/GAMGPreconditioner".
As a quick reference, the number of iterations increments can be seen in this do-while cycle: $FOAM_SC/foam/matrices/lduMatrix/solvers/AMG/GAMGSolverSolve.C starting line 82 and in line 103 is where the number of iterations increases.
Geon-Hong likes this.
wyldckat is offline   Reply With Quote

Old   September 27, 2018, 17:37
Default
  #12
New Member
 
Join Date: Aug 2018
Posts: 9
Rep Power: 7
mszeto715 is on a distinguished road
Thanks for your help! So it looks like one iteration IS one V-cycle. The V Cycle goes from fine to coarse and then fine again.
mszeto715 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
pisoFoam floating point error - GAMG sErik OpenFOAM Running, Solving & CFD 8 January 14, 2010 10:43
Hexa Block meshes in ANSYS Meshing? siw ANSYS Meshing & Geometry 3 July 31, 2009 10:40
MRFSimpleFoam amp cyclic patches david OpenFOAM Running, Solving & CFD 36 October 21, 2008 21:55
Differences between serial and parallel runs carsten OpenFOAM Bugs 11 September 12, 2008 11:16
Hexa meshes with ICEM CFD 5.1 Tim Guo CFX 8 June 29, 2005 09:27


All times are GMT -4. The time now is 04:54.