CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

SIMPLE algorithm code not converging

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 28, 2014, 14:29
Default SIMPLE algorithm code not converging
  #1
New Member
 
Md. Intishar's Avatar
 
Md. Intishar Rahman
Join Date: Nov 2014
Location: Bangladesh
Posts: 6
Rep Power: 11
Md. Intishar is on a distinguished road
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.
Md. Intishar is offline   Reply With Quote

Old   December 31, 2014, 04:03
Default
  #2
New Member
 
Md. Intishar's Avatar
 
Md. Intishar Rahman
Join Date: Nov 2014
Location: Bangladesh
Posts: 6
Rep Power: 11
Md. Intishar is on a distinguished road
Not convinced if CFD online has ever been designed for the slightest purpose of the young coders. :what:
Md. Intishar is offline   Reply With Quote

Old   January 21, 2015, 13:28
Default
  #3
Member
 
Michael Moor
Join Date: May 2012
Location: Ireland
Posts: 30
Rep Power: 13
michaelmoor.aero is on a distinguished road
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
michaelmoor.aero is offline   Reply With Quote

Old   January 22, 2015, 13:34
Default
  #4
Member
 
G. S.
Join Date: Nov 2010
Posts: 54
Rep Power: 15
gerardosrez is on a distinguished road
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...
gerardosrez is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
code for SIMPLE algorithm - 2D Lid driven cavity flow problem - Collocated grid h_amooie OpenFOAM Programming & Development 1 January 22, 2022 11:33
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
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


All times are GMT -4. The time now is 05:15.