
[Sponsors] 
December 28, 2014, 14:29 
SIMPLE algorithm code not converging

#1 
New Member
Md. Intishar Rahman
Join Date: Nov 2014
Location: Bangladesh
Posts: 6
Rep Power: 7 
Hello CFD Coders,
I am writing a SIMPLE algorithm code on Matlab for my undergrad project. I am using the colocated formulations on a finite differencing method. I am using RhieChow interpolation for the face velocity interpolation. D I am conserving total mass in the overall domain by setting the Outlet Node value of U velocity as: U(I,NI)= U(I,NI1) * (sum(U(:,1))/sum(U(:,NI1)) ; This is applied in each TDMA iteration loop, just after the calculation of the value of U(I,NI1) In the Pressure Correction code, the momentum interpolated face velocities are computed as follows : %================================================= ================================================== ================================= if J==LNC+1; VPE= U(I,J+1); else VPE=(UEF) + 0.5*(((DY/APU(I,J) +DY/APU(I,J+1)))*(PPP(I,J+1))) +0.5*((DX/APU(I,J)) *(PWF PEF) (DX/APU(I,J+1)) *(PEFPEE) ); end if J==2; VPW= U(I,J1); else VPW=(UWF) + 0.5*(((DY/APU(I,J) +DY/APU(I,J1)))*(P(I,J1)PP)) +0.5*((DX/APU(I,J)) *(PWF PEF) (DX/APU(I,J1)) *(PWWPWF) ); end if I==LNR+1; VPN= V(I+1,J); else VPN=(VNF) + 0.5*(((DX/APV(I,J) + DX/APV(I+1,J)))*(PPP(I+1,J))) +0.5*((DX/APV(I,J)) *(PSF PNF) (DX/APV(I+1,J)) *(PNFPNN) ); end if I==2; VPS= V(I1,J); else VPS=(VSF) + 0.5*(((DX/APV(I,J) + DX/APV(I1,J)))*(P(I1,J)PP)) +0.5*((DX/APV(I,J)) *(PSF PNF) (DX/APV(I1,J)) *(PSSPSF) ); end %================================================= ================================================== ======================================= and the coefficients are : AE(I,J)= RHO*DFe* DY; AW(I,J)= RHO*DFw* DY; AN(I,J)= RHO*DFn* DX; AS(I,J)= RHO*DFs* DX; where, DFe = (DY/APU(I,J) + DY/APU(I,J+1)) I am using momentum equation underrelaxation factor : .1 and pressure underrelaxation factor: 0.1 The pressure is corrected as: P= P_star + pressure_UR*p'; the nodal velocities are also underrelaxed as: U(I,J)= U(I,J)((DX)/APU(I,J))*(PPEPPW); V(I,J)= V(I,J)((DX)/APV(I,J))*(PPNPPS); where PPE,PPW,PPN,PPS are the pressure correction values at the faces The momentum equation are underrelaxed as: AP= AP./RF ; B = B + (1RF)*AP.*SPECIES; % SPECIES=U for U velocity and SPECIES=V for V velocity I have used all the procedures, instructionss required for the SIMPLE and similar coding, following CFD book of Versteeg and Malalakera, and Numerical Methods in Heat, Mass, and Momentum Transfer by J.Y. Murthi and every other books and instruction I get at hand. Reading a thread on CFD ONLINE I also double cheked the mass conserving 'Outlet Condition'. At this point I absolutely have no idea why my code is not converging. I used the difference of U and V velocity to determine the convergence, DIFF= (abs(UU_initial)+abs(VV_initial))*0.5; Also as outlined in the CFD book of Anil Date I used 10 iterations for pressure correction but the system still, on the whole, diverges. Can someone kindly help me to fix this problem? I am in urgent need. Thanks in advance. 

December 31, 2014, 04:03 

#2 
New Member
Md. Intishar Rahman
Join Date: Nov 2014
Location: Bangladesh
Posts: 6
Rep Power: 7 
Not convinced if CFD online has ever been designed for the slightest purpose of the young coders. :what:


January 21, 2015, 13:28 

#3 
Member
Michael Moor
Join Date: May 2012
Location: Ireland
Posts: 30
Rep Power: 10 
Hello,
Thankyou for your email. As you may have seen from my previous posts, I am happy to give you the work that i did on a backward staggered grid for 2D laminar flow. Unfortunately i have not worked on CFD programming for a few years now, however if asked a question on the code that i have, which a member Dr. Ding PEng helped me with, I might be able to help! Working now, I have very little time I'm afraid! I also do not have my copy of Versteg with me, and so cannot check the code against the backward staggered grid. From reading through your code, you seem to have a good grasp of the process.... If you supplied me with an email address, I would be happy to forward you my code, which is quite explicitly explained. Kind regards, Michael 

January 22, 2015, 13:34 

#4 
Member
G. S.
Join Date: Nov 2010
Posts: 54
Rep Power: 11 
Hello Mike, long time no talk to you, I see you are still active...How is it going?? Still in contact with Ding???
Best regards... By the way I strongly recommend Michael on CFD programming... 

Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
A simple DNS code  aroma  Main CFD Forum  2  September 16, 2014 23:29 
SIMPLE algorithm instability at low viscosities  kooroshg1  Main CFD Forum  7  July 10, 2014 03:00 
code for SIMPLE algorithm  2D Lid driven cavity flow problem  Collocated grid  h_amooie  OpenFOAM Programming & Development  0  June 9, 2011 11:17 
SIMPLE algorithm not converging.  sgp  Main CFD Forum  4  August 12, 2010 21:06 
SIMPLE algorithm  Jonathan Castro  Main CFD Forum  3  December 10, 1999 04:59 