% We don't want to print on each timestep -> would be too time consuming if(mod(t,500)==0) % draw 2d temperature figure(1), clf, box imagesc([min(min(X)) max(max(X))],[min(min(Y)) max(max(Y))], T(iny,inx)), axis equal colormap jet axis tight ylabel('y [m]') xlabel('x [m]'), colorbar, drawnow axis([0,Lx,0,Ly]) print -dpng Temperature2dfins pause(0.1) % draw 2d velocity figure(2), clf, box imagesc([min(min(X)) max(max(X))],[min(min(Y)) max(max(Y))], U), axis equal, hold on qiny = iny(1:5:length(iny)); qinx = inx(1:5:length(inx)); quiver( X(qiny,qinx), Y(qiny,qinx), U(qiny,qinx), V(qiny,qinx),4, 'w') colormap jet axis tight ylabel('y [m]') xlabel('x [m]'), colorbar, drawnow axis tight axis([0,Lx,0,Ly]) print -dpng Velocity2dfins pause(0.1) if(t<100) figure(1), clf figure(2), clf, figure(3), clf end figure(3), clf, box Tm = sum(T(iny,inx).*U)./(sum(U)); Um = mean(U); dTm = diff(Tm); plot(0:7, Tm(150:100:850),'ko-'), hold on plot(0:7, Thot*ones(8,1), 'r-','Linewidth',2) plot(0:7, Tleft*ones(8,1), 'b-','Linewidth',2) ylabel('T_{mean} [K]') xlabel('Fin row number'), drawnow legend('T_m between rows', 'T_s', 'T_{in}','Location', 'Northwest') print -dpng Tmeanfins pause(0.1) figure(4), clf, box Tm = sum(T(iny,inx).*U)./(sum(U)); Um = mean(U); dTm = diff(Tm(150:100:850)); plot(1:7, dTm./(Thot-Tm(250:100:850)),'ko-'), hold on ylabel('\Delta T_n/(T_s - T_n) ') xlabel('Fin row number'), drawnow % legend('T_m between rows', 'T_s', 'T_{in}','Location', 'Northwest') print -dpng Tmeanrelativefins figure(5), clf, box Tm = sum(T(iny,inx).*U)./(sum(U)); Um = mean(U); dTm = diff(Tm(150:100:850)); plot(1:7, 0.5*(0.00125/k)*rho*cp*Um(150:100:750).*dTm./(Thot-Tm(250:100:850)),'ko-'), hold on ylabel('Nu = hD/k ') xlabel('Fin row number'), drawnow % legend('T_m between rows', 'T_s', 'T_{in}','Location', 'Northwest') print -dpng Nusseltfins end