2D Lid Driven Cavity Flow using SIMPLE algorithm

버전 1.1.0 (7.59 KB) 작성자: MJ Sarfi
The classical lid-driven cavity flow is solved for stead state using SIMPLE algorithm.
다운로드 수: 3.1K
업데이트 날짜: 2018/8/8

라이선스 보기

Boundary conditions:

v=0 on all sides. u=0 on right,left and bottom and u=lid velocity at top BC

Numerical method:

SIMPLE algorithm used for resolving velocity-pressure coupling. Staggered grid for u and v. To see how indexing works in staggered grid, Please check out "Versteeg, Malalasekera: an introduction to computational fluid dynamics" text book. Discretization of the governing equations is based on this text book. u and v are updated by Jacobi method in every iteration. Pressure correction equation is directly solved using a penta-diagonal matrix algorithm in every iteration. Proper choice of under-relaxation factors needed for convergence. Jacobi method is the least efficient way for this type of problems but it's simple and easy to prallelize. You are encouraged to apply other iterative methods such as line by line TDMA, Guess-seidel, multigrid or SOR for faster convergence.

Pressure correction:

I often see people struggling with solving the pressure correction equation in SIMPLE algorithm because the BCs for P' are unclear. here is how to tackle it:
1) pressure is a relative concept. So, clamp the pressure of one node in the domain to zero as a boundary condition and the pressure at other nodes will be measured relative to that point. It's a common practice to set P(1,1)=0 and because P(1,1) is known P'(1,1)=0, but you'll need to compute P' at other nodes. It's obvious that aS = 0 for a P' point that is located on the bottom wall because there is no P' node under it but it has aW,aE,aN. Other boundary P' values will be set this way. you'll end up with a penta-diagonal matrix of coefficients.

I have written this code in Parallel using PETSc (C language). I am going to upload it on GitHub pretty soon. It's much faster than this version because:
1) It is parallel and not serial so you can you can use multiple processors.
2) The C version solves the Momentum equations by iterating a couple of times unlike the MATLAB version which does only one Jacobi sweep.
3) Most importantly, PETSc uses Krylov subspace iterative method (type:GMRES) and it also uses preconditioners (I found Additive Shwartz PC the best) to solve momentum and pressure correction, which is way more efficient than Jacobi method in terms of convergence rate.

인용 양식

MJ Sarfi (2024). 2D Lid Driven Cavity Flow using SIMPLE algorithm (https://www.mathworks.com/matlabcentral/fileexchange/68348-2d-lid-driven-cavity-flow-using-simple-algorithm), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2018a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Partial Differential Equation Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.1.0

Fixed a mistake in assembling the matrix of coefficients for the pressure correction equation
Fixed another mistake about the defining the Peclet number in power-law upwinding scheme

1.0.0