
[Sponsors] 
Help with Pressure Correction Matrix  Singular  Illconditioned Matrix. 

LinkBack  Thread Tools  Search this Thread  Display Modes 
November 1, 2021, 08:30 
Help with Pressure Correction Matrix  Singular  Illconditioned Matrix.

#1  
New Member

Need Help !! How do you solve linear System of Equations(Solver), with a Singular or IllConditioned Matrix?
The linear system of equation is based on Pressure corrector Step 2 from incompressible SIMPLE algorithm, & I would be implementing same for converging loops of SIMPLE for X & Y velocity. I am stuck on the illconditioned matrix (cond = 1e16, please only consider first one in the image) & can't seem to find a solution to this problem. Can anybody point me in the correct direction. I've picked up the derivation from RoyChowdhury/Patankar, on a structured 10/10 Mesh. Can a linear solver(Python based) do this, or should I go about coding steepest descent or conjugate gradient, as I did with a relaxation sample problem before. I've attached the images of the A matrix, cond number range of matrix, & the warning message I receive in the console during run. Also here is a code snippet of the Pressure Correction Matrix formulation, if anyone's interested. Quote:
Please advice on posting with proper code Indentation too. I'll correct this. Last edited by Fluidentity13; November 1, 2021 at 08:35. Reason: Code Indentation 

November 1, 2021, 09:04 

#2 
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,290
Rep Power: 67 
Let me generalize the issue. The fact that the pressure matrix is singular is a consequence of the Neumann BCs and expresses the fact that the pressure solution is determined up to a function of time.
A solution is determined even using an iterative method, provided that the BCs fulfill the compatibility relation. I suppose that a nonconvergence is a signal of wrong BCs 

November 1, 2021, 09:16 

#3 
New Member

So, you mean the formulation of the pressure correction matrix must be wrong, and it's not commonplace for illconditioned matrix, requiring special attention. Sorry, I am very new to this. And rechecking so many times, made me believe something else needed to be done for such a matrix.
Coming on to the boundary conditions. I am solving this in a staggerred system. And the pressure corrector system contains as many equations as there are cells in the mesh. 10 X 10. Owing to the staggerred scheme I am able to include both side u_star terms in the rhs B matrix. Can u take a look at the Matrix Formulation image I've attached for reference. I am not sure what to do next!! 

November 1, 2021, 09:18 

#4  
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,290
Rep Power: 67 
Quote:
How do you prescribe the BCs for the pressure? 

November 1, 2021, 09:24 

#5 
New Member

I haven't, prescribed anything. Initial conditions I've provided. I'll have to revisit the chapters once again, I guess. Is the boundary condition treated by equating the last row to a fixed value, or to the second last row.
Sorry I got really confused, devising something for the staggerred scheme, but I guess it's getting better now with your help. 

November 1, 2021, 09:29 

#6  
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,290
Rep Power: 67 
Quote:
have you already searched in the forum for similar post? 

November 1, 2021, 09:38 

#7 
New Member

No, I guess I need information on specifying boundary conditions.
Only one wall needs Pressure boundary right? And the whole matrix would resize because of that? Also for XVelocity, I have provided Left and Right Boundary Cond, and for Y Velocity, Top And Bottom boundary are equated to Zero. Does this all sound good to you? 

November 1, 2021, 09:40 

#8  
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,290
Rep Power: 67 
Quote:
Poisson equation,Neumann BCs 

November 2, 2021, 04:32 

#9 
New Member

Thank a lot for diverting me to that enlightening thread. I picked up that only applying Nuemann Boundary condition can tease out a solution, & wanted to give it a try, assigning the right boundary that condition. Instead of adding nuemann terms to the source term, following changes were made to the A matrix in Ax=b:
1. Bottom row of each submatrix removed which contained rightmost cell coefficients. (Similar changes to p & B matrix. 2. New bottom row of each submatrix changed to AppApe from plain App. (Neumann terms) Anyways, that did not work for me still giving that error for inaccurate solution, cond (1e17). Does my implementation look good to you, must be a problem in the code? Assigning the topleft most cell dirichlet boundary did the job for the con number (1040). There's still huge divergence in the whole algorithm somewhere though, I am sure there's some mistake somewhere. To summarise, the mistake I did was not providing any boundary condition to the pressure corrector equation whatsoever. It's recommended to fix a cell (mostly to 0), & update the Ax=b matrix based on that. 

November 2, 2021, 05:12 

#10  
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,290
Rep Power: 67 
Quote:
Fixing a value is a way to get one solution because you fixed the constant value. But that does not mean you have the correct solution. Boundary conditions are required for the mathematical pressure problem to be wel posed. You need then to discretize those BCs accordingly. 

May 3, 2022, 12:06 

#11 
New Member
Vyas Duggirala
Join Date: May 2014
Posts: 4
Rep Power: 10 
I am facing a similar issue. I am simulating a steady state 2D channel flow in my code with velocity inlet and pressure outlet B.C`s. For the pressure correction equation I have imposed Neumann B.C at the top and bottom and zero correction at the inlet & outlet. What i am seeing is that the sparse matrix for pressure correction is becoming illconditioned (almost singular) due to which I am getting extremely high values for pressure correction with the 1st iteration itself.
Would be very interested to know how to solved the same issue that. 

May 3, 2022, 15:07 

#12 
New Member

Zero Correction at inlet ? Shouldn't be that way for channel flow, if I understand your inquiry right. Only for Outlet you've to fix the Pressure value.
Also, staggered or collocated grid. You can reference my code if you want. 2D_PanelCFD v0.0.1 Release 

May 4, 2022, 02:46 

#13 
New Member
Vyas Duggirala
Join Date: May 2014
Posts: 4
Rep Power: 10 
I am a little confused with the pressure correction boundary condition for the inlet/inflow condition. Patankar says with inflow there is not need to prescribe a pressure correction B.C.
I was able to obtain the solution using collocated grid & momentum interpolation approach, and i used a Neumann condition at the inlet and walls. But when trying to replicate in a staggered grid arrangement I am running into problems with a illconditioned sparse matrix for solving pressure correction. I guess pressure correction being elliptic, it is important to prescribe the correct B.C`s on all the walls of the domain. 

May 4, 2022, 14:43 

#14  
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,290
Rep Power: 67 
Quote:
In inflow you prescribe the Dirichlet bc for the velocity but the pressure equation requires to prescribe bcs on the whole frontier of the domain. In your case you have nonhomogenoeus Neumann BC to prescribe at inflow and walls. 

Tags 
illconditioned matrix, implicit solvers, pressure correction, simple, singular matrix 
Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
What is difference between static pressure and gauge pressure?  aja1345  FLUENT  1  July 20, 2018 21:05 
question regarding LES of pipe flow  pimpleFoam  Dan1788  OpenFOAM Running, Solving & CFD  37  December 26, 2017 15:42 
SIMPLE algorithm does not converge when using old pressure (correction) values  andreasp  Main CFD Forum  3  February 9, 2016 22:18 
Pressure correction equation,Ferziger and Peric  Hooman  Main CFD Forum  1  July 20, 2010 06:21 
Hydrostatic pressure in 2phase flow modeling (long)  DS & HB  Main CFD Forum  0  January 8, 2000 16:00 