# SIMPLE algorithm code not converging

 Register Blogs Members List Search Today's Posts Mark Forums Read

 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: 11 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 Rhie-Chow 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,NI-1) * (sum(U(:,1))/sum(U(:,NI-1)) ; This is applied in each TDMA iteration loop, just after the calculation of the value of U(I,NI-1) 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)))*(PP-P(I,J+1))) +0.5*(-(DX/APU(I,J)) *(PWF -PEF) -(DX/APU(I,J+1)) *(PEF-PEE) ); end if J==2; VPW= U(I,J-1); else VPW=(UWF) + 0.5*(((DY/APU(I,J) +DY/APU(I,J-1)))*(P(I,J-1)-PP)) +0.5*(-(DX/APU(I,J)) *(PWF -PEF) -(DX/APU(I,J-1)) *(PWW-PWF) ); end if I==LNR+1; VPN= V(I+1,J); else VPN=(VNF) + 0.5*(((DX/APV(I,J) + DX/APV(I+1,J)))*(PP-P(I+1,J))) +0.5*(-(DX/APV(I,J)) *(PSF -PNF) -(DX/APV(I+1,J)) *(PNF-PNN) ); end if I==2; VPS= V(I-1,J); else VPS=(VSF) + 0.5*(((DX/APV(I,J) + DX/APV(I-1,J)))*(P(I-1,J)-PP)) +0.5*(-(DX/APV(I,J)) *(PSF -PNF) -(DX/APV(I-1,J)) *(PSS-PSF) ); end %================================================= ================================================== ======================================= and the co-efficients 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 under-relaxation factor : .1 and pressure under-relaxation factor: 0.1 The pressure is corrected as: P= P_star + pressure_UR*p'; the nodal velocities are also under-relaxed as: U(I,J)= U(I,J)-((DX)/APU(I,J))*(PPE-PPW); V(I,J)= V(I,J)-((DX)/APV(I,J))*(PPN-PPS); where PPE,PPW,PPN,PPS are the pressure correction values at the faces The momentum equation are under-relaxed as: AP= AP./RF ; B = B + (1-RF)*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(U-U_initial)+abs(V-V_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: 11 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: 14 Hello, Thank-you 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: 15 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...