CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   2D Lid Driven Cavity Flow simulation using MATLAB (http://www.cfd-online.com/Forums/main/72985-2d-lid-driven-cavity-flow-simulation-using-matlab.html)

 josephlm February 23, 2010 14:17

2D Lid Driven Cavity Flow simulation using MATLAB

I have been trying to simulate the 2D lid driven cavity flow using the SIMPLE algorithm on the staggered grid, in which velocity is assumed to be coupled with pressure and momentum equations are iterated and u, v and pressure p are corrected by a correction term u_corr, v_corr and p_corr respectively. The looping stops when p_corr decreases to a sufficiently small value.

However, the flow obtain does not seem to look like how it should look like, i.e. a main vortex at the centre with counter vortices at the bottom corners. Instead, the plot I obtained shows the boundary conditions (Lid velocity at top, with no-slip condition at other walls), but the velocity arrows in the middle seem to be of a magnitude 100 times smaller than lid velocity and in random directions. It would appear that I have a problem with the correction terms, u_corr, v_corr and p_corr being too small, but i checked the discretized equations over and over and they seem to be correct..

Does anyone know what could be the likely reason for this? Appreciate any help or suggestions to modify my code!

 bikash89 June 14, 2010 13:25

I have been also facing similar kind of problem. In my case after few iterations oscillations start and the solution fails. However the same code worked really well for Coutte flow. Can ne1 help??
Quote:
 Originally Posted by josephlm (Post 247098) I have been trying to simulate the 2D lid driven cavity flow using the SIMPLE algorithm on the staggered grid, in which velocity is assumed to be coupled with pressure and momentum equations are iterated and u, v and pressure p are corrected by a correction term u_corr, v_corr and p_corr respectively. The looping stops when p_corr decreases to a sufficiently small value. However, the flow obtain does not seem to look like how it should look like, i.e. a main vortex at the centre with counter vortices at the bottom corners. Instead, the plot I obtained shows the boundary conditions (Lid velocity at top, with no-slip condition at other walls), but the velocity arrows in the middle seem to be of a magnitude 100 times smaller than lid velocity and in random directions. It would appear that I have a problem with the correction terms, u_corr, v_corr and p_corr being too small, but i checked the discretized equations over and over and they seem to be correct.. Does anyone know what could be the likely reason for this? Appreciate any help or suggestions to modify my code!

 mensacorp June 23, 2010 08:54

Quote:
 Originally Posted by josephlm (Post 247098) I have been trying to simulate the 2D lid driven cavity flow using the SIMPLE algorithm on the staggered grid, in which velocity is assumed to be coupled with pressure and momentum equations are iterated and u, v and pressure p are corrected by a correction term u_corr, v_corr and p_corr respectively. The looping stops when p_corr decreases to a sufficiently small value. However, the flow obtain does not seem to look like how it should look like, i.e. a main vortex at the centre with counter vortices at the bottom corners. Instead, the plot I obtained shows the boundary conditions (Lid velocity at top, with no-slip condition at other walls), but the velocity arrows in the middle seem to be of a magnitude 100 times smaller than lid velocity and in random directions. It would appear that I have a problem with the correction terms, u_corr, v_corr and p_corr being too small, but i checked the discretized equations over and over and they seem to be correct.. Does anyone know what could be the likely reason for this? Appreciate any help or suggestions to modify my code!
Hi

Do you have to solve your system with SIMPLE algorithm? I mean you can use picard iteration which is also very simple. I just wrote a 2D Navier Stokes code for Matlab which iterates the solution of matrix K by using picard iterations. It gives reasonable results for the cavity problem.

 Dhileep T K June 24, 2010 01:58

Hi,
i have written a matlab code for a 2D natural convection problem using malalasekara versteeg as reference. can you suggest me some reference books for lid driven cavity problem.

 All times are GMT -4. The time now is 00:14.