How to solve for pressure using the velocity field?
이전 댓글 표시
Hi,
I'm trying to solve for the pressure field on a 120x120 grid. I have the velocity field, and I have to use the Pressure Poisson Equation to solve for the pressure. The known boundary condition is P=Patm along the right edge of the grid. Using this I can get all the boundary conditions. I've created my coefficient matrix and I've tried so many different ways to solve the problems but I keep getting and error saying "Out of memory". I've tried solving by the easiest way which is Ax=b, x=A\b. Also by using reduced row echelon form. I'm now trying to solve using lower triangular matrix and the other an upper triangular matrix, but when I try using the function lu on MATLAB, again I get the same "Out of memory" message. Any comments or ideas are appreciated.
Thank you,
Orlando R.
댓글 수: 5
Star Strider
2015년 1월 25일
Posting your code would definitely help. We have no idea what actual problem you’re having. (We’re collectively very good at solving MATLAB problems, but history has more than adequately demonstrated that we have absolutely no talent for mind-reading.)
It is likely best for you to attach your script and function files, and if you have data, save and attach those as .mat files. [Use the ‘paperclip’ (or ‘staple’) icon to attach them.]
Orlando Rojas
2015년 1월 25일
Star Strider
2015년 1월 25일
What are ‘umean’ and ‘vmean’? I can’t find them in the online MATLAB documentation.
Orlando Rojas
2015년 1월 25일
편집: Orlando Rojas
2015년 1월 25일
Star Strider
2015년 1월 25일
OK. Thanks. I didn’t look at the .mat files yet.
답변 (1개)
Youssef Khmou
2015년 1월 26일
This problem is for non compressible fluid, first you have to explain the equation you want use, for this two dimensional case, the Poission Pressure equation is D(P)=d((1/Re).D(u)-u.d(u)), D is the Laplacian, d is divergence and Re denotes the Reynold number. What is not clear is that you need only one matrix for velocity u as field of x and y components, anyway i suggest that you use Jacobi method; for (i,j) component of P at iteration m+1 u have :
P(i,j,m+1) = ( P(i-1,j,m) + P(i+1,j,m) + P(i,j-1,m) + P(i,j+1,m) +C(i,j) )/4
C(i,j) is result of right hand side of equation, parallel to this approach try to use gradient function of velocity U to obtain C.
댓글 수: 2
Orlando Rojas
2015년 1월 26일
Youssef Khmou
2015년 1월 26일
편집: Youssef Khmou
2015년 1월 26일
For discrete solution, you initialize the matrix P with zeros, you define the boundaries conditions numerically and the size of P(M,N), then you implement the loop:
C1=0.25*(Ux(x-1,y)+Ux(x+1,y)+Ux(x,y-1)+Ux(x,y+1));
C3=0.25*(Uy(x-1,y)+Uy(x+1,y)+Uy(x,y-1)+Uy(x,y+1));
C2=2*(0.5^2)*(Ux(x-1,y)+Ux(x+1,y))*(Uy(x,y-1)*Uy(x,y+1));
P(x,y)=0.25*(P(x-1,y)+P(x+1,y)+P(x,y-1)+P(x,y+1))+rho*(C1+C2+C3);
카테고리
도움말 센터 및 File Exchange에서 Spline Construction에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!