CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Multigrid Solver using Matlab for Poisson Equation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 5, 2018, 06:35
Question Multigrid Solver using Matlab for Poisson Equation
  #1
Member
 
Suman Sapkota
Join Date: Feb 2018
Posts: 32
Rep Power: 8
Suman Sapkota is on a distinguished road
Hello,
I coded multigrid solver for Poisson equation in matlab. In my case, I am making simple multigrid i.e. coarse grid correction cycle using 2 levels (fine and coarse grid). The problem is when I increase the number of points i.e. 'n' , the relaxations needed to get the required accuracy also increases. With two level grids, the relaxations required on fine 'v1' and coarse grid 'v2' , v1+v2<=3 should give the same solution. After all, we are using it for fast convergence. But I am not getting the same solution. My gauss siedel function is correct. I checked it with others. But the problem of requiring high relaxations has been troubling my convergence rate. Thus, i know the solver is not working properly. Please Help!!
Suman Sapkota is offline   Reply With Quote

Old   February 5, 2018, 20:06
Default
  #2
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,276
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by Suman Sapkota View Post
Hello,
I coded multigrid solver for Poisson equation in matlab. In my case, I am making simple multigrid i.e. coarse grid correction cycle using 2 levels (fine and coarse grid). The problem is when I increase the number of points i.e. 'n' , the relaxations needed to get the required accuracy also increases. With two level grids, the relaxations required on fine 'v1' and coarse grid 'v2' , v1+v2<=3 should give the same solution. After all, we are using it for fast convergence. But I am not getting the same solution. My gauss siedel function is correct. I checked it with others. But the problem of requiring high relaxations has been troubling my convergence rate. Thus, i know the solver is not working properly. Please Help!!

Thats because you only use 2 levels. It is possible for the 2 levels to show the behaviour you mentioned.

Even if you used multiple levels but not solving completely at the coarsest level in this case too many times multigrid may stall and does not converge as fast as you expect.

Coarse level solution is absolutely important in case of multigrid.
arjun is offline   Reply With Quote

Old   February 6, 2018, 01:37
Default
  #3
Member
 
Suman Sapkota
Join Date: Feb 2018
Posts: 32
Rep Power: 8
Suman Sapkota is on a distinguished road
Hello, Thank you for the rely.

Does it mean that I am not solving the problem completely in the coarse grid though? I am solving Le= Ir where e= error, L=laplace operator, I= Interpolation constant and r= residual injected from fine grid. I took this equation in gauss siedel relaxation. solving this equation means that I suppose the problem is solved in coarse grid. Correct me if I am wrong.
Suman Sapkota is offline   Reply With Quote

Old   February 6, 2018, 19:18
Default
  #4
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,276
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by Suman Sapkota View Post
Hello, Thank you for the rely.

Does it mean that I am not solving the problem completely in the coarse grid though? I am solving Le= Ir where e= error, L=laplace operator, I= Interpolation constant and r= residual injected from fine grid. I took this equation in gauss siedel relaxation. solving this equation means that I suppose the problem is solved in coarse grid. Correct me if I am wrong.

Yes it means that.

Gauss Seidel becomes ineffective as the problem size increases, so at the coarser level it won't be removing all the errors.

Multigrid gains efficiency by removing all frequencies of error by using coarser and coarser girds and each level is responsible for removing certain frequency of errors.

So at the coarsest level you have still some errors remaining that then completely solved by using a direct solver (Typically LU factorization).
arjun is offline   Reply With Quote

Old   February 7, 2018, 08:47
Default
  #5
Member
 
Suman Sapkota
Join Date: Feb 2018
Posts: 32
Rep Power: 8
Suman Sapkota is on a distinguished road
But I am using an iterative solver. gauss siedel reduces the error efficiently than jacobi but is there any better option to solve the Le=Ir equation in coarse grid???.. where L = operator ; e=error; Ir= interpolated value of residual from fine grid. Another question is: Can the laplace operator that I use in the fine grid be used as the coarse grid L operator? because i am using same gauss siedel function to relax in both fine and coarse grid.
Suman Sapkota is offline   Reply With Quote

Old   February 12, 2018, 23:19
Default
  #6
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,276
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by Suman Sapkota View Post
But I am using an iterative solver. gauss siedel reduces the error efficiently than jacobi but is there any better option to solve the Le=Ir equation in coarse grid???...
Gauss Seidel is fine, it is doing what it is supposed to do.

There are other options but very unlikely that is the issue. Main thing is that for 2 level multigrid the behaviour you were complaining is possible

Quote:
Originally Posted by Suman Sapkota View Post
Can the laplace operator that I use in the fine grid be used as the coarse grid L operator? because i am using same gauss siedel function to relax in both fine and coarse grid.
Thats makes something called geometric or full multigrid. Don't go in that direction, stick to algebraic version unless you are specifically asked to do geometric mg.
arjun is offline   Reply With Quote

Reply

Tags
gauss siedel, laplace, matlab code, multigrid, poisson


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
suGWFoam: Richards equation solver for porous media flows liu OpenFOAM Announcements from Other Sources 4 February 10, 2021 15:14
Add Work due to body force in the energy equation for a lagrangian solver mneben OpenFOAM Programming & Development 6 January 19, 2016 05:30
lid-driven cavity in matlab using BiCGStab Don456 Main CFD Forum 1 January 19, 2012 15:00
Coupled solver and multigrid Hong Main CFD Forum 0 September 11, 2000 09:05
Matlab Unsteady 1D Euler Solver??? Johan Sylwander Main CFD Forum 1 May 24, 2000 15:26


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