CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Problem on a sample program (https://www.cfd-online.com/Forums/main/90451-problem-sample-program.html)

houkensjtu July 11, 2011 00:59

Problem on a sample program
 
Maybe you know the sample program:
http://www.students.ncl.ac.uk/f.j.he...webs/codes.php

It seems a very good one but when I tried to raise the grid number from 10*10 to 12*12,it leads to a divergence.The main error happened in TDMA:
//Forward substitution
for (int i=1; i < n; i++) {
gam(i) = c(i-1) / bet;
bet = b(i) - a(i) * gam(i);

if (bet == 0.0)
throw("Solver Error 2 in triag: Zero in denominator \n");
u(i) = ( r(i) - a(i) * u(i-1) ) / bet;
}
I can't figure out why it happen and I need your help!


All times are GMT -4. The time now is 07:45.