
[Sponsors] 
May 17, 2012, 22:33 
Convergence problems in CVFEM

#1 
Member
G. S.
Join Date: Nov 2010
Posts: 53
Rep Power: 8 
Hi guys
Im developing an unstructured CVFEM code for the NS equations using SIVA algorithm proposed by Baliga. Im solving the induced flow in a square cavity for Re = 400, the mesh elements are triangular. For the first run my mesh had 100 nodes and I got convergence but when I refined the mesh I started to had divergence. Im using MATLAB and I have tried with Gauss Seidel, Bicgstab, Bicgstab with preconditioning without results, so what can you tell me about it The code is using 1st order upwind and Im following the ideas of the following paper: Alexandre Lamoureux & B. Rabi Baliga (2011): Improved Formulations of the Discretized Pressure Equation and Boundary Treatments in CoLocated EqualOrder ControlVolume FiniteElement Methods for Incompressible Fluid Flow, Numerical Heat Transfer, Part B: Fundamentals: An International Journal of Computation and Methodology, 59:6, 442472 Any help would be great, this is my master thesis and Im out of time so thanks in advance.... 

May 17, 2012, 22:43 

#2 
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 504
Rep Power: 13 
use small underrelaxations thats the only tip I can give you.


May 18, 2012, 09:21 

#3 
Member
G. S.
Join Date: Nov 2010
Posts: 53
Rep Power: 8 

May 18, 2012, 23:37 

#4 
Senior Member
Chris DeGroot
Join Date: Nov 2011
Location: Canada
Posts: 388
Rep Power: 8 
Does the code work for other problems? Have you ruled out a coding problem?


May 18, 2012, 23:40 

#5 
Senior Member
Chris DeGroot
Join Date: Nov 2011
Location: Canada
Posts: 388
Rep Power: 8 
Also, is it your residual that is diverging or the linear solver that is diverging? I.e. is the residual just growing too large or is it having trouble solving your system of equations. The reason I ask is because you have listed the linear solvers you have tried, which doesn't really have to do with convergence/divergence of the simulations.


May 20, 2012, 07:51 

#6  
Member
G. S.
Join Date: Nov 2010
Posts: 53
Rep Power: 8 
Quote:
thanks for taking time in this matter.... 

May 20, 2012, 08:47 

#7  
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 504
Rep Power: 13 
Quote:
Okey my second advise, as a student I believe you have to perform some calculations and present their results. So spend your time making the meshes as good as possible. Remove the skew etc problems and keep hexa type elements. With low underrelaxations and good mesh you could do calculations on a very fine mesh too. Further in the linear solver try to achieve very high convergence. With fine meshes it is very much needed to keep stablity. I have run calculations with 1billion cells and more without special treatment for stability and I can tell you convergence level of linear solver matters a lot in this case. 

May 20, 2012, 09:13 

#8 
Senior Member
Chris DeGroot
Join Date: Nov 2011
Location: Canada
Posts: 388
Rep Power: 8 
I'm still not totally clear if the divergence is due to issues with the linear solver or issues with the discretization. I will make a suggestion because I feel like it could be a solver issue. First, can you confirm that the linear solver is converging and to what tolerance level? If the solver is not converging you have likely found your problem. I would also ask if you are storing your matrices as dense or sparse matrices, i.e. are you storing all of the zeroes? If you are storing the full matrix, then I would not be surprised if the solver will not converge on a larger system.


May 20, 2012, 09:42 

#9  
Member
G. S.
Join Date: Nov 2010
Posts: 53
Rep Power: 8 
Quote:
Im only using trangular elements I used several lineal solvers because like you I thought the problem was there, but using bicgstab with preconditioning I get rid of that issue. Thanks cdegroot I really appreciate your help 

May 20, 2012, 09:48 

#10  
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 504
Rep Power: 13 
Quote:
Okey by this information I think there is something that could be concluded. First of all 900 nodes is pretty coarse mesh. It is not fine. In fact in my experience till 50000 cells is coarse mesh. So the conclusion is your code has some problem, check your code. (thats what i think). 

May 20, 2012, 10:01 

#11 
Senior Member
Chris DeGroot
Join Date: Nov 2011
Location: Canada
Posts: 388
Rep Power: 8 
I have to agree with arjun. In an absolute sense, the problem is not that large so convergence should not be difficult. Therefore it sounds like there is a problem with the code itself. How did the results look using 100 nodes? With 225 nodes, have you looked at the solution after a bunch of iterations to see if anything obvious is going wrong?
I always find a good way to isolate problems in a malfunctioning code is to turn off certain influences one at a time to see which one causes the problem. I'm not sure exactly how the method you are using works. I use cellcentered finitevolume. So if I have an error I will start by turning off higher order convection terms (making it first order upwind) to see if that is the issue. If not I will turn off the convection terms completely so I am essentially solving an unsteady Stokes equation instead of NavierStokes. Then you can proceed to lower the order of other interpolations (i.e. in diffusion or pressure terms) to try to locate the problem. Also, do all equations diverge together or does either mass or momentum diverge first. It always helps to know which equation is the problem. 

May 20, 2012, 13:04 

#12  
Member
G. S.
Join Date: Nov 2010
Posts: 53
Rep Power: 8 
Quote:
What I dont understand is why if I achieve convergence for a coarse problem I can't achieve for finer ones. Thanks a lot... 

May 20, 2012, 17:51 

#13  
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 504
Rep Power: 13 
Quote:
Have you ever read this small sweet book A Multigrid Tutorial by William L. Briggs. If not then please do read it, specially the chapter where he says that it is very difficult to convince people that their code has a bug if it works for small problems and show good convergence for small and simple problems. 

May 20, 2012, 18:18 

#14  
Member
G. S.
Join Date: Nov 2010
Posts: 53
Rep Power: 8 
Quote:
If you think you have some information that could be useful (books, papers, references, etc) please I beg both of you to share it with me. My email is gerardosrez@gmail.com. Thank u guys, I appreciate the time you spent here...and it's time to work harder!! 

May 20, 2012, 18:42 

#15  
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 504
Rep Power: 13 
Quote:
Tracking bug is not very easy sometimes. I can only share my experience. I have been in your position many many times. Even after writing more than 10 navier stokes solvers I often find myself in this position. My last such experience was very interesting. I wrote a cartesian based solver for LES / DNS only to find that everything works fine except that the stagnation pressure it was predicting is somewhat smaller by factor of 1.7 or so. Spent 4 days trying to figure out whats wrong. I could not figure out what was wrong because solver is stable, i do see the vortex shredding that i hoped for etc etc. Finally I wrote the whole damn thing again from scratch. I am still scratching my head about what was wrong with that. So how about write it again. Too troublesome but you can try. This way if there was a bug it would come out. It is difficult to help with bug. That only you can ferret out. 

May 20, 2012, 23:43 

#16 
Senior Member
Chris DeGroot
Join Date: Nov 2011
Location: Canada
Posts: 388
Rep Power: 8 
I can't think of any references necessarily that would help you debug.
Along the lines of what arjun said, but maybe a bit less extreme, you could start rewriting some of your functions/subroutines one at a time. It would be really nice though to have an idea of what physical influence is leading to the divergence before beginning something extreme. I would try verifying mass is conserved, verify boundary conditions are being imposed properly, check what happens with convection turned off, etc. If the square cavity problem doesn't work, try a duct. Maybe the issue will become glaringly obvious in another problem. The duct problem may be simpler because since you don't have to worry about setting the pressure level in the interior of the domain since it will be set at the outlet boundary. Additionally, the pressure field is extremely simple (linear) and there is only one component of velocity with a gradient in only one direction (assuming fully developed inlet is specified). To debug I often use this case. If I am having real troubles I will just prescribe the pressure field and try solving only velocity. I think a methodical analysis to determine which physical influence has the bug is the best place to start. 

June 9, 2012, 09:13 

#17 
Member
G. S.
Join Date: Nov 2010
Posts: 53
Rep Power: 8 
Hi guys, I write to you to inform that my code is already getting convergence, when I used the underrelaxation method proposed by Patankar the outer iterations got convergence, I think the problems was that when I refined the mesh the neighbor coefficients got small due to the decreasing of volume of cells os it becomes harder to solve the linear system by the bicgstab code.
Thanks for your help friends, now I´m working to get the streamfunction from my velocity field. How can I do this for an unstructured grid?? (CVFEM). Thanks in advance... 

Tags 
baliga, colocated, cvfem 
Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Gasliquid vertical separator, problems with convergence  juliom  Main CFD Forum  0  October 5, 2011 20:20 
NACA0012 Convergence Problems  StudentAndrew  CFX  6  November 21, 2005 07:49 
Convergence problems  Simone  CDadapco  5  June 29, 2005 10:48 
Convergence problems  Chetan  FLUENT  3  April 15, 2004 19:13 
convergence problems  jeremy  FLUENT  7  May 30, 2002 06:41 