10 likes | 164 Views
Sources and BC’s. Numerical Solution of control volume Finite Difference. Point form. nrow 3 2 row=1. N. W. E. P. Matrix Form. S. Col =1 2 3 ncol. For current problem. for row=1:nrow for col=1:ncol
E N D
Sources and BC’s Numerical Solution of control volume Finite Difference Point form nrow 3 2 row=1 N W E P Matrix Form S Col =1 2 3 ncol For current problem for row=1:nrow for col=1:ncol i=col+(row-1)*ncol; if col>1 a(i,i-1)=1; end if col<ncol a(i,i+1)=1; end if row>1 a(i,i-ncol)=1; end if row<nrow a(i,i+ncol)=1; end ai(i)=4; if row==1 ai(i)=a(i)+1; end if row==nrow ai(i)=ai(i)+1; b(i)=200; end if col==1 ai(i)=ai(i)+1; end if col==ncol ai(i)=ai(i)+1; end