CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Implementing SIMPLE for unstructured, collocated grid (https://www.cfd-online.com/Forums/main/181670-implementing-simple-unstructured-collocated-grid.html)

mnroelofs December 19, 2016 04:28

Implementing SIMPLE for unstructured, collocated grid
 
3 Attachment(s)
I have been trying to implement the SIMPLE algorithm as described by Ferzinger and Peric in the book "Computational Methods for Fluid Dynamics".
I want to simulate thec2D airflow around an airfoil of which I can dynamically create the shape. I use a triangular mesh for the flow field and use collocated variables. To solve the linear systems of equations I implemented a SOR Gauss-Seidel algorithm (but actually underrelax).

I implemented the algorithm in a C# application and the good news is it runs. However, since I am getting wrong results, I want to pinpoint whether the solver diverges, oscillates or that I just have gotten the theory wrong and thus implemented it incorrectly.

So, here are two pictures in which I have written down my discretization for the momentum and pressure correction equations. Can you spot any mistakes? The code file where the matrices and RHS vectors are created is also included. I hope the code is self-explanatory, otherwise ask.

Furthermore, should the coefficient matrix for u and v momentum be the same?

Thanks in advance for your time.

FMDenaro December 19, 2016 05:12

when you write a new code you MUST assess that it runs well in a controlled test-case. Check first the accuracy and the quality of the solution for a well known solution.

mnroelofs December 19, 2016 06:26

Thanks for your response. I have run a lid driven cavity flow problem, and it seems like the solution is diverging. It is pointless to run an accuracy check at this point since I am not getting sensible results... I am at a loss of what is causing the issue, but my guess is I have misinterpreted the theory... I particularly struggle with the pressure correction equation (e.g. I have no clue what to do with the equations (8.56 and 8.59) in section 8.8 of the book).

FMDenaro December 19, 2016 08:30

check the code for the Poiseuille solution, this way you can control the setting of inflow, outflow and wall BC.s

arjun December 20, 2016 03:29

Quote:

Originally Posted by mnroelofs (Post 630372)
Thanks for your response. I have run a lid driven cavity flow problem, and it seems like the solution is diverging. It is pointless to run an accuracy check at this point since I am not getting sensible results... I am at a loss of what is causing the issue, but my guess is I have misinterpreted the theory... I particularly struggle with the pressure correction equation (e.g. I have no clue what to do with the equations (8.56 and 8.59) in section 8.8 of the book).


Construct the pressure equation from 1/Ap and not from 1/(Ap + SumApi) like simplec.

The SIMPLEC part is tricky and i would not advise you to try that first. Try the safer approach of simple ie 1/Ap.

Solver can diverge for lots of reasons and many times it could even if everything in code is right. So first find a case that is easy to do. You try lid driven cavity is good idea with cartesian type meshes.

stirafira May 1, 2017 20:51

Hi mnroelofs, would you be kind enough to send me a copy of your final code for the same problem, I need to compare this for my research.
I am also looking for a Matlab code for the same problem FVM collocated grid.
My mail id is srs83@psu.edu.
-Thank you. :)


All times are GMT -4. The time now is 20:06.