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

Parameters for multigrid solver

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

Like Tree8Likes
  • 3 Post By HaZe
  • 1 Post By arjun
  • 2 Post By HaZe
  • 2 Post By arjun

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 26, 2012, 04:40
Default Parameters for multigrid solver
  #1
New Member
 
Join Date: Jan 2012
Location: Germay - Stuttgart
Posts: 21
Rep Power: 0
HaZe is on a distinguished road
Hello!

I'm working with OpenFOAM-1.6-ext since last October. My task is to study the numerical methods like the ode solvers and matrix solvers. I've already finished to learn the theory about all methods and now I have to test them. For the tests I'm solving a steady state flame with reactingFoam.

Now I tried to solve the matrices with the xxAMG solvers and I'm wondering what all the parameters are saying. I got them with some debugging voodoo and I'm also wondering if there are any more parameters which are not necessary, but maybe useful.

For the GAMG solver I already got the parameters from this thread. And of course I read the linked two papers.

On that basis I tried to get the MPEAMG, RREAMG and FPEAMG solvers running. I managed them to get started, but I don't know what most parameters are doing.

Can anybody explain the following parameters where a question or no comment is posted. And maybe give some rule of thumb for their values?
The not indented parameters are from GAMG, the fist block of indented parameters is from MPEAMG and the second indented block is additional necessary for FPEAMG.

Code:
U xxEAMG
        {
        minIter 0; //tells you how many solver sweeps will be forced without checking the convergence tolerance: usually zero
        maxIter 500; // is this the max number of V-/W-/F- cylces in one time step?
        tolerance 1e-6; // evident
        relTol 1e-1; //evident

              cycle V-cycle; //evident, possible: V/W/F
               nMaxLevels 5; //
              scale 5; //
            policy AAMG; //possible: AAMG PAMG SAMG, but what do they do?
              groupSize 2; //
            minCoarseEqns 5; //
               kDimension 5; //
        
        nSmoothingSteps 2; //
            mFactor 2; //

        smoother GaussSeidel; //evident
        nPreSweeps 0; //
        nPostSweeps 2; //
        nFinestSweeps 2; //

        scaleCorrection true; //
        directSolveCoarsest false; //evident

        cacheAgglomeration true; //
        nCellsInCoarsestLevel 10; //
        agglomerator faceAreaPair; //
        mergeLevels 1; //evident
        };
Thanks,
HaZe
HaZe is offline   Reply With Quote

Old   January 26, 2012, 04:51
Default
  #2
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,273
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by HaZe View Post



Code:
U xxEAMG
        {
        minIter 0; //tells you how many solver sweeps will be forced without checking the convergence tolerance: usually zero
        maxIter 500; // is this the max number of V-/W-/F- cylces in one time step?
        tolerance 1e-6; // evident
        relTol 1e-1; //evident

              cycle V-cycle; //evident, possible: V/W/F
               nMaxLevels 5; // Maximum coarse levels to be produced. Sounds too small for group size of 2 . 
               scale 5; //
            policy AAMG; //possible: AAMG PAMG SAMG, but what do they do?

AAMG = Agglomoration based additive corrective. Should be default. 
PAMG = I am not sure, I never used openFOAM. 
SAMG = selective AMG like classical AMG or AMG based on Stuben's work. Look for Stuben and AMG for it. 

              groupSize 2; //  Two equations will be merged
            minCoarseEqns 5; // When coarse level equations are less than this direct solver will be used. 

               kDimension 5; //
        
        nSmoothingSteps 2; //
            mFactor 2; //

        smoother GaussSeidel; //evident
        nPreSweeps 0; //
        nPostSweeps 2; //
        nFinestSweeps 2; //

        scaleCorrection true; // Corrections are sometimes scaled to increase convergence.  phi_new = phi_old + alpha * corr
        directSolveCoarsest false; //evident

        cacheAgglomeration true; // save the aggomoration information
        nCellsInCoarsestLevel 10; // should be same as minCoarseEqns ???
        agglomerator faceAreaPair; // Apply aggomoration based of face area rather than matrix coefficients. If done this way one can save the agglomoration and weights. 

        mergeLevels 1; //evident
        };
Thanks,
HaZe
Note i have never used openfoam so if i am wrong at any place feel free to correct.
zhernadi likes this.
arjun is offline   Reply With Quote

Old   January 27, 2012, 05:56
Default
  #3
New Member
 
Join Date: Jan 2012
Location: Germay - Stuttgart
Posts: 21
Rep Power: 0
HaZe is on a distinguished road
I found some comments in older source code (blue) from OF1.5-dev on the net, but there are still some questions left (green).
Any suggestions for the numeric values, especially in view of their dependencies?

Code:
U xxEAMG        
{
         minIter 0; //tells you how many solver sweeps will be forced without checking the convergence tolerance: usually zero
         maxIter 500; // is this the max number of V-/W-/F- cylces in one time step?
         tolerance 1e-6; // evident
         relTol 1e-1; //evident

                cycle V-cycle; //evident, possible: V/W/F
                nMaxLevels 5; // Maximum coarse levels to be produced. Sounds too small for group size of 2 .
                scale 5; //what is scaled?
               policy AAMG; //possible: AAMG PAMG SAMG, but what do they do?
 AAMG = Agglomoration based additive corrective. Should be default.
 PAMG = I am not sure, I never used openFOAM.
 SAMG = selective AMG like classical AMG or AMG based on Stuben's work. Look for Stuben and AMG for it.
               groupSize 2; //  Two equations will be merged                           
               minCoarseEqns 5; // When coarse level equations are less than this direct solver will be used. Minimum number of coarse level equations.
               kDimension 5; //Krylov space dimension (are the equations on the coarsest level solved by Krylov-Methods? Is it possible to choose the method?)
                  
          nSmoothingSteps 2; //number of smoothing steps before projection 
          mFactor 2; //magnification factor (what's that?)
          
smoother GaussSeidel; //evident
nPreSweeps 0; //number of pre-sweeps (but what is meant by sweep?)
nPostSweeps 2; //number of post-sweeps
nFinestSweeps 2; //

scaleCorrection true; // Corrections are sometimes scaled to increase convergence.  phi_new = phi_old + alpha * corr
directSolveCoarsest false; //evident

cacheAgglomeration true; // save the aggomoration information        
nCellsInCoarsestLevel 10; // should be same as minCoarseEqns ???         
agglomerator faceAreaPair; // Apply aggomoration based of face area rather than matrix coefficients. If done this way one can save the agglomoration and weights.
mergeLevels 1; //(evident) (what's the difference to groupeSize?)         
};
mgg and Astrodan like this.
HaZe is offline   Reply With Quote

Old   January 28, 2012, 02:05
Default
  #4
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,273
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by HaZe View Post
I found some comments in older source code (blue) from OF1.5-dev on the net, but there are still some questions left (green).
Any suggestions for the numeric values, especially in view of their dependencies?

Code:
U xxEAMG        
{
         minIter 0; //tells you how many solver sweeps will be forced without checking the convergence tolerance: usually zero
         maxIter 500; // is this the max number of V-/W-/F- cylces in one time step?   

I think so.


         tolerance 1e-6; // evident
         relTol 1e-1; //evident

                cycle V-cycle; //evident, possible: V/W/F
                nMaxLevels 5; // Maximum coarse levels to be produced. Sounds too small for group size of 2 .
                scale 5; //what is scaled?

I do not have an idea. Usually corrections are scaled but it does not look like that parameter. 


               policy AAMG; //possible: AAMG PAMG SAMG, but what do they do?
 AAMG = Agglomoration based additive corrective. Should be default.
 PAMG = I am not sure, I never used openFOAM.
 SAMG = selective AMG like classical AMG or AMG based on Stuben's work. Look for Stuben and AMG for it.
               groupSize 2; //  Two equations will be merged                           
               minCoarseEqns 5; // When coarse level equations are less than this direct solver will be used. Minimum number of coarse level equations.

Yes. Number of equations at coarsest level. 

               kDimension 5; //Krylov space dimension (are the equations on the coarsest level solved by Krylov-Methods? Is it possible to choose the method?)
  
GMRES might need this parameter. 
About your question 'are the equations solved by Krylov method' ,  usually they are solved by LU factorization. But it all depends on who  implemented it. 
  
But if multigrid is used as preconditioner then it might be parameter  that is used.  The PAMG is my guess where multigrid shall be used as  preconditioner.  Note I said it is my guess so someone need to confirm  or deny it to correct it. 


                
          nSmoothingSteps 2; //number of smoothing steps before projection 
          mFactor 2; //magnification factor (what's that?)
          
Usually corrections are scaled by factor 2. As I  mentioned above, so this might be that factor.  Phi_new = Phi_old + 2 *  ProlongMat * phi_at_coarse_level. 
    
Note: This parameter is usually taken as 2 but there is a way to  estimate this. I do not remember exactly which paper or book I read it,  but i definitely remember reading a procedure to calculate this  parameter. 
    
The value 2 comes from coarsening of Poisson problem where coarse level  size is roughly 2 times of fine. For unstructured meshes it has to be  calculated. 
  
  In practice: I have never used this parameter. I use Phi_new = Phi_old +  ProlongMat * phi_at_coarse_level. 
    
Works just fine. 

Edited to add:
Look for 'A review of algebraic multigrid' by Stuben. There is some discussion about scaling and a method to calculate it. 



smoother GaussSeidel; //evident
nPreSweeps 0; //number of pre-sweeps (but what is meant by sweep?)

By sweep , usually means : one forward iteration of Gauss Seidel and 1 backward. 
    
That is 
Forward : for (i = 0; i < N; i++) {    } 
Backward : for (i = N-1;  i >= 0; i--) {  } 
    
This is what fluent means by sweep and it is generally understood as. 
  

nPostSweeps 2; //number of post-sweeps
nFinestSweeps 2; //

scaleCorrection true; // Corrections are sometimes scaled to increase convergence.  phi_new = phi_old + alpha * corr
directSolveCoarsest false; //evident

cacheAgglomeration true; // save the aggomoration information        
nCellsInCoarsestLevel 10; // should be same as minCoarseEqns ???         
agglomerator faceAreaPair; // Apply aggomoration based  of face area rather than matrix coefficients. If done this way one can  save the agglomoration and weights.
mergeLevels 1; //(evident) (what's the difference to groupeSize?)         
};

I am not sure what this parameter means but it is not groupsize. This is between levels but I do not know how openFOAM uses it. 


I am thinking that since various multigrids are implemented by various people there might be overlap of some parameters.

About this:

maxIter 500; // is this the max number of V-/W-/F- cylces in one time step?  

This value look to be ridiculously high. Fluent's default value is 30 and perhaps straccm+ default is 50 or also 30. It does not take this many cycles to reach there.

Today i finished implementing coupled multigrid for pressure based coupled solver. It normally takes around 10 cycles to drop error to 1E-5 levels using V cycle. And this problem is supposed to be very difficult to converge.
sharonyue and Astrodan like this.

Last edited by arjun; January 28, 2012 at 06:03.
arjun is offline   Reply With Quote

Reply

Tags
fpeamg, gamg, mpeamg, multigrid, rreamg

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
Creating New Solver: For particle-laden compressible jets sankarv OpenFOAM Running, Solving & CFD 17 December 3, 2014 19:41
Creating New Solver: For particle-laden compressible jets sankarv OpenFOAM 0 April 4, 2010 18:06
exper parameters on solver laura CFX 1 January 9, 2009 07:50
why the solver reject it? Anyone with experience? bearcat CFX 6 April 28, 2008 14:08
Relaxation and Solver Parameters norbinou Siemens 3 September 25, 2007 01:38


All times are GMT -4. The time now is 11:35.