Pressure Possion equ.and multigrid method
Hi,CFD people,
I am a newcomer in multigrid method,when I extend my code to multigrid method,I met a problem, Because the pressure Possion equ.for imcompressible flow converge very slow,I want to use multigrid method to get a quickly convergence(without MG,the code is OK),in the pressure Possion equ.there are terms including pressure(the last time step)and the temperal velocities(I use projection method,FDM with staggered grids), in my code,three levels is used for MG,because of the linear Possion equ.I use the simple Vcycle,and the pressure (last time step) and the temperal velocities are restricted on coaser grids,the aeraweighed interpolation scheme was used,when running my code,I found that at the end of one Vcycle,the iteration residual didnot change small,even large,but for several iterations,the iteration neither converge,nor disconverge,anyone who have experence on this,please help me,I am waiting for reply. thanks a lot 
Re: Pressure Possion equ.and multigrid method
In this case, people usually use finite element method for Poisson solver in multigrid method.
Usually, the boundary condition for Poisson solver is the main cause for not convergence, but if you use finite element method for relaxation step in MG of Poisson solver, then you will see the convergence. 
Re: Pressure Possion equ.and multigrid method
Thanks, with the help of staggered grids,the pressure possion equ.converge in my code without MG,although slowly,should there any care be taken when using MG with staggered grids to solve the pressure equ.?it should be independent of the method,i.e.FDM or FEM.I think.

Re: Pressure Possion equ.and multigrid method
I was in the same situation for this, the main difficulty is how to impose boundary condition for the pressure, which is not clear so far.
But if you use finite element relaxation in pressure solver, which means you use higher order discretization for laplacian, which is equivalent to using 9 point stencils for laplacian. And it cares for boundary consitions and compatibility requirement automatically. I think you are implementing projection method by "Ann S. Almgren, John B. Bell, and William G. Szymczak" A numerical method for the incompressible navierstokes equations based on an approximate projection. And in that paper, they used the projection based on a finte element formulation. 
Re: Pressure Possion equ.and multigrid method
Hi Junseok,
Would you please give more details on the reference by Ann S. Almgren et al.? Thanks. 
Re: Pressure Possion equ.and multigrid method
Sure, no problem.
SIAM J. Sci. COMPUT. Vol. 17, No. 2, pp. 358369, March 1996 "A Numerical method for the incompressible navierstokes equations based on an approximate projection" by Ann S. Almgren, John B. Bell, and William G. Szymczak. 
Re: Pressure Possion equ.and multigrid method
Hi tony,
If i got u correctly, then ur solving a nonlinear problem. so u must be using FAS. u need to correctly interpolate residuals & the nodal values. I made a similar mistake & my code diverged!( i did'nt understand FAS correctly at that time). As u said ur a starter u can read a book by William Briggs " A tutorial on Multigrid" (some thing like that) I think problem is with interpolation. hope this helps abhijit 
Re: Pressure Possion equ.and multigrid method
Tony,
The multigrid method generally works very well for incompressible flows with only a few things that catch it out. I would treat the advice in the above two threads with some caution since the MG method is essentially independent of discretization scheme and if you are performing an accurate time simulation (an assumption?) there is often not much to be gained from treating the momentum equations implicitly (with a few exceptions). Some questions/observations: (1) Have you got a pressure term on the RHS (I am confused on this point)? If so, where does it come from? The smoothing? Do you have an implicit or explicit scheme? (2) Assuming an implicit scheme. If the coefficients are strongly anisotropic (e.g. very long thin cells) you will generally need something more sophisticated than SOR. Line solvers like ADI are relatively simple first improvement. If have serious anisotropy (usually encountered with FAS schemes and not just Poisson equations for pressure) then you may have to make the grid coarsening sensitive to the anisotropy in the coefficients. 
Re: Pressure Possion equ.and multigrid method
hi,Abhijit, thanks for your help,I mixed with what you said,last year,I have used the FAS to generate bodyfitted mesh,but I still think,this possion equ.is linear,because the pressure of last time step and the temperal velocity are known,the unknown is the pressure of the current time step(i use projection method in which the momentum equ.for the temperal velocity contain pressure belongs to the last time step ),why u said it is nonlinear and should use FAS? more detail: on staggered grids,the Restriction for temperal velocity is(1/2,1/2),Restriction for pressure(last time) and residual of current pressure is 1/4*(p(i,j)+p(i,j+1)+p(i+1,j)+p(i+1,j+1)),the interpolation for correction is like (3*p(i,j)+3p(i,j+1)+p(i+1,j)+9p(i+1,j+1))/16.
what I wonder is ,the restriction for the knowns(temperal velocity and last time step's pressure) is consistent with the restriction for residual(the correction for current pressure)? 
Re: Pressure Possion equ.and multigrid method
Dear andy,
just as what you said,I am performing an accurate time simulation,and there is a pressure term in RHS of the possion equ.for pressure,which belongs to the last time layer,implicit scheme are used . for the 2nd point you said,it's right,but as for equ.,the coef.of the equ arenot anisotropy seriously. 
Re: Pressure Possion equ.and multigrid method
If the pressure source term is for an earlier time step then no problems.
Suggestions: (1) Test the Poisson equation solver with a zero source term and a nonconstant initial field. If this does not converge to roundoff in less than 10 cycles for a decent sized grid you have not implemented your MG scheme correctly. (2) If that test passes, introduce your mass errors and check the source terms always sum to zero. (3) If that test passes, check your residuals are being weighted/evaluated correctly (a FVM and FDM are different here). Scale down the size of the residuals/corrections and observe if convergence appears. (4) If that test passes, I am starting to struggle. Check your boundary treatment on the coarser grids. (5) If that test passes, the last resort is to pick a small region of the grid and print out everything that is going on until something observably wrong happens. An alternative approach is to get someone elses code (one which works of course), run both codes simultaneously printing out coefficients/values for both codes until the difference/error is located. It can be a hassle setting things up but is a bombproof test. (I found a MG problem with a FAS scheme doing precisely this many years ago). 
Re: Pressure Possion equ.and multigrid method
Dear andy,
thanks for your help,sorry,i didnot formulate my problem clearly,I want to tell you something more, the source term of pressure equ.including pressure(last time step)and the termperal velocity(the current time step which is known,but the temperal velocity donot satisfy the freedivergence conditionprojection method),I Keep this unchanged on the finest grids,so I am sure this pressure equ.is linear,and the simple Vcycle can deal with this correctly,do you think so? for B.C.,I use dp/dn=0 at all face,and use this at all multigrid level,so for the restriction,because of staggered grid with FDM,1/4*(rP(i,j)+rp(i+1,j)+rp(i,j+1)+rp(i+1,j+1)) is used for residuals of pressure(rp),while,I use interpolation like what I said response to Abhijit . I look at my code again and again,it's simple,but not ok,why? thanks for your time tony 
Re: Pressure Possion equ.and multigrid method
Hi tony,
I read through the rest of threads. your formula for restriction/ prolongation is correct. I used same. I doubt if PDE for P'is linear. It's nonhomogeneous bcos RHS is not zero. I have a paper by prof S.P.Vanka (UIUC) excatly on same topic we are discussing. Actually it's almost a year since i read about MG. I'll wipe some dust from my file cabinet & let u know asap. Abhijit 
Re: Pressure Possion equ.and multigrid method
hi,Abhijit ,
I am almost exhaustive,and donot know what's wrong with my code,i am waiting for your help,thanks a lot 
Re: Pressure Possion equ.and multigrid method
Firstly, does your MG scheme satisfy the first test? If you cannot solve Laplaces equation efficiently with fixed boundary conditions you have a coding error. There seems little point prodding other parts of the code without knowing your MG scheme works in isolation.
A Poisson equation with nonDirichlet boundary conditions and source terms which do not sum to zero has no solution. Consider the trivial case of a single 1D element with zero gradient on both boundaries. For your Poisson equation the LHS is always zero so if your RHS is anything other than zero you are in trouble. This is the point of the second test (which I phrased poorly). A divergence free velocity field is not relevant  if your flow field was divergence free after advancing the momentum equations there would be no point solving the pressure equation!. There seems a fair chance you are violating this. > I look at my code again and again,it's simple,but not ok,why? Some advice. As a rule of thumb a quality piece of software is going to have as many source statements written to test/debug/prove it as there are performing the basic operations. Often a lot more and only rarely less. I would suggest you stop looking at the code and start generating code to methodically test the component parts in isolation. 
Re: Pressure Possion equ.and multigrid method
Dear Tony,
I have a good reference for you. a paper by S.P.Vanka in Comp. Methods in App Mech & Engg Vol 55 1986 pg 321 . It gives details on prolongation & restriction formulae , flowcharts of the algorithm. It's in great detail. I think u can cross check ur code with that. U can download some papers /reports from his site at UIUC . Since i am not familiar with the method ur using i cannot help much . This paper mainly deals with SIMPLE variants. hope this helps Abhijit 
Thanks andy !
Dear andy,
just as what you said,the source terms in the pressure possion equ. do not sum to zero,which leading to quickly disconverge in MG Vcycle.now,my code is OK,thanks for your help. best regards Tony 
All times are GMT 4. The time now is 23:28. 