30 likes | 176 Views
Oliver Johnson & Sam Wilding. Heat Transfer Me 340-2. Winter Semester, 2010. Nusselt Number Calculator.
E N D
Oliver Johnson & Sam Wilding Heat Transfer Me 340-2 Winter Semester, 2010
Nusselt Number Calculator Using inputs like fluid type, internal or external flow, and parameters given in the problem, this program will automatically select the applicable Nusselt Number equation(s) and return the Nusselt Number(s)
The Code if config == 2; % External Flow % Find fluid properties at film temperature Tf = (Tinf+Ts)/2; [rho,mu,nu,Pr] = props(fluid,Tf,quality); % Fixed Surface Temperature if geometry == 3; % Flat Plate, Parallel Flow Re = v*D/nu; xcritical = 5e5*nu/v; if isnan(qs) && isnan(Xi); if D <= 1.05*xcritical % Laminar if Pr >= 0.6 Nu{1,1} = 0.332*Re^(1/2)*Pr^(1/3); %Eq. 7.23 Nu{1,2} = 'Eq. 7.23'; if Re < 5.3e5 Nu{2,1} = 0.664*Re^(1/2)*Pr^(1/3); %Eq. 7.30 Nu{2,2} = 'Eq. 7.30'; end end % Liquid Metals if isequal('hg',fluid) && Pr <= 0.05 && Pr*Re >= 100 Nu{3,1} = 0.565*(Re*Pr)^(1/2); %Eq. 7.32 Nu{3,2} = 'Eq. 7.32'; end % Churchill-Ozoe if Pr*Re >= 100 Nu{4,1} = 0.3387*Re^(1/2)*Pr^(1/3)/(1+(0.0468/Pr)^(2/3))^(1/4); %Eq. 7.33 Nu{4,2} = 'Eq. 7.33 (Churchill-Ozoe)'; if Re < 5.3e5 Nu{5,1} = 2*Nu; Nu{5,2} = 'Nu_ave '; end end elseif D > 1.05*xcritical && D < 20*xcritical % Mixed Laminar/Turbulent if Pr > 0.6 && Pr < 60 Nu{6,1} = (0.037*Re^(4/5)-871)*Pr^(1/3); %Eq. 7.38 Nu{6,2} = 'Eq. 7.38'; end elseif D >= 20*xcritical % Fully Turbulent if Pr > 0.6 && Pr < 60 Nu{7,1} = 0.0296*Re^(4/5)*Pr^(1/3); %Eq. 7.36 Nu{7,2} = 'Eq. 7.36'; end if Re > 10^8 Nu{8,1} = 0.037*Re^(4/5)*Pr^(1/3); %Eq. 7.38 Nu{8,2} = 'Eq. 7.38'; end end % Unheated Starting Length elseif isnan(qs) && ~isnan(Xi) if Re < 5e5 %Laminar Nu{9,1} = 0.332*Re^(1/2)*Pr^(1/3)/(1-(Xi/D)^(3/4))^(1/3); %Eq. 7.42 Nu{9,2} = 'Eq. 7.42'; else %Turbulent Nu{10,1} = 0.0296*Re^(1/2)*Pr^(1/3)/(1-(Xi/D)^(3/4))^(1/3); %Eq. 7.43 Nu{10,2} = 'Eq. 7.43'; end % Fixed Heat Flux elseif isnan(Ts) && isnan(Xi) if Re < 5e5 && Pr >= 0.6 Nu{11,1} = 0.453*Re^(1/2)*Pr^(1/3); %Eq. 7.45 Nu{11,2} = 'Eq. 7.45'; elseif Re > 5e5 && Pr > 0.6 && Pr < 60 Nu{12,1} = 0.0308*Re^(4/5)*Pr^(1/3); %Eq. 7.46 Nu{12,2} = 'Eq. 7.46'; end end elseif geometry == 4; % Cylinder Re = v*D/nu; % Hilpert if Re > 0.4 && Re < 4e5 && Pr >= 0.6 if Re >= 0.4 && Re < 4 C = 0.989; m = 0.330; elseif Re >= 4 && Re < 40 C = 0.911; m = 0.385; elseif Re >= 40 && Re < 4000 C = 0.683; m = 0.466; elseif Re >= 4000 && Re < 40000 C = 0.193; m = 0.618; elseif Re >=40000 && Re <= 400000 C = 0.027; m = 0.805; end Nu{13,1} = C*Re^m*Pr^(1/3); %Eq. 7.52 Nu{13,2} = 'Eq. 7.52 (Hilpert)'; end % Churchill if Re*Pr >= 0.2 Nu{14,1} = 0.3+0.62*Re^(1/2)*Pr^(1/3)*(1+(Re/282000)^(5/8))^(4/5)/(1+(0.4/Pr)^(2/3))^(1/4); %Eq. 7.54 Nu{14,2} = 'Eq. 7.54 (Churchill)'; end % Zhukauskas [rhoinf,muinf,nuinf,Prinf] = props(fluid,Tinf,quality); [rhos,mus,nus,Prs] = props(fluid,Ts,quality); Reinf = v*D/nuinf; if Prinf > 0.7 && Prinf < 500 && Reinf > 1 && Reinf < 10^6 if Reinf >= 1 && Reinf < 40 C = 0.75; m = 0.4; elseif Reinf >= 40 && Reinf < 1000 C = 0.51; m = 0.5; elseif Reinf >= 10^3 && Reinf < 2e5 C = 0.26; m = 0.6; elseif Reinf >= 2e5 && Reinf < 1e6 C = 0.076; m = 0.7; end if Prinf <= 10 n = 0.37; else n = 0.36; end Nu{15,1} = C*Reinf^m*Prinf^n*(Prinf/Prs)^(1/4); %Eq. 7.53 Nu{15,2} = 'Eq. 7.53 (Zhukauskas)'; end % Sphere elseif geometry == 5; % Whitaker [rhoinf,muinf,nuinf,Prinf] = props(fluid,Tinf,quality); [rhos,mus,nus,Prs] = props(fluid,Ts,quality); Reinf = v*D/nuinf; muratio = muinf/mus; if ffld == 0; if Prinf > 0.71 && Prinf < 380 && Reinf > 3.5 && Reinf < 7.6e4 && muratio > 1 && muratio < 3.2 Nu{16,1} = 2+(0.4*Reinf^(1/2)+0.06*Reinf^(2/3))*Prinf^(0.4)*(muratio)^(1/4); %Eq. 7.56 Nu{16,2} = 'Eq. 7.56 (Whitaker)'; end % Ranz and Marshall for freely falling liquid drops elseif ffld == 1; Nu{17,1} = 2+0.6*Reinf^(1/2)*Pr^(1/3); %Eq. 7.57 Nu{17,2} = 'Eq. 7.57 (Ranz and Marshall)'; end end elseif config == 1; % Internal Flow if geometry == 1; % Circular Pipe Tmave = (Tmi+Tmo)/2; [rho,mu,nu,Pr] = props(fluid,Tmave,quality); [rhos,mus,nus,Prs] = props(fluid,Ts,quality); if isnan(mdot); Re = rho*v*D/mu; elseif isnan(v); Re = 4*mdot/(pi*mu*D); end muratio=mu/mus; f Re < 2300 % Laminar xhydro = D*0.05*Re; xthermal = xhydro*Pr; xratio = xthermal/xhydro; S = (Re*Pr/(L/D))^(1/3)*(muratio)^0.14; if S >= 2 if xratio >= 0.5 && xratio <= 1.5 && Pr > 0.48 && Pr < 16700 && muratio > 0.0044 && muratio < 9.75 Nu{18,1} = 1.86*S; %Eq. 8.57 Nu{18,2} = 'Eq. 8.57'; elseif xratio > 1.5 Nu{19,1} = 3.66 + (0.0668*(D/L)*Re*Pr)/(1+0.04*((D/L)*Re*Pr)^(2/3)); %Eq. 8.56 Nu{19,2} = 'Eq. 8.56'; end elseif S < 2 if ~isnan(qs) Nu{20,1} = 4.36; %Eq. 8.53 Nu{20,2} = 'Eq. 8.53'; Nu{21,1} = Nu{20,1}; Nu{21,2} = 'Nu_ave'; elseif ~isnan(Ts) Nu{22,1} = 3.66; %Eq. 8.55 Nu{22,2} = 'Eq. 8.55'; Nu{23,1} = Nu{22,1}; Nu{23,2} = 'Nu_ave'; else disp('Error: Cannot have Ts == const and qs == const simultaneously.') return end end elseif Re > 2300 % Turbulent if L < 60*D % Short Pipe L = 60*D*1.01; % This is here to calculate a fully developed Nu needed to find the % Nu for a short pipe. 1.01 is 101% of fully developed length shortpipe = 1; end if ~isequal('hg',fluid) if isnan(qs) && isnan(f) % Dittus if Pr > 0.7 && Pr < 160 && Re > 10000 && L > 60*D if Ts > Tmave n = 0.4; elseif Ts < Tmave n = 0.3; end Nu{24,1} = 0.023*Re^(4/5)*Pr^n; %Eq. 8.60 Nu{24,2} = 'Eq. 8.60'; Nuave = Nu{24,1}; end elseif ~isnan(qs) || ~isnan(Ts) if isnan(f) % Sieder if Pr > 0.7 && Pr < 16700 && Re > 10000 && L > 60*D Nu{25,1} = 0.027*Re^(4/5)*Pr^(1/3)*(muratio)^0.14; %Eq. 8.61 Nu{25,2} = 'Eq. 8.61 (Sieder)'; Nuave = Nu{25,1}; end elseif ~isnan(qs) || ~isnan(Ts) && ~isnan(f) % Gnielinski if Pr > 0.5 && Pr < 2000 && Re > 3000 && Re < 5e6 && L > 60*D Nu{26,1} = (f/8)*(Re-1000)*Pr/(1+12.7*(f/8)^(1/2)*(Pr^(2/3)-1)); %Eq. 8.62 Nu{26,2} = 'Eq. 8.62 (Gnielinski)'; Nuave = Nu{26,1}; end end end elseif isequal('hg',fluid) % Liquid Metals Pe = Pr*Re; if isnan(Ts) && ~isnan(qs) if Pe > 100 && Pe < 10000 && Re > 3.63e3 && Re < 9.05e6 Nu{27,1} = 4.82+0.0185*(Pe)^0.287; %Eq. 8.64 Nu{27,2} = 'Eq. 8.64'; Nuave = Nu{27,1}; end elseif isnan(qs) && ~isnan(Ts) if Pe >= 100 Nu{28,1} = 5+0.025*Pe^0.8; %Eq. 8.65 Nu{28,2} = 'Eq. 8.65'; Nuave = Nu{28,1}; end end end end if shortpipe == 1; C = 2.4254; m = 0.676; Nu{29,1} = Nuave*(1+C/(L/D)^m); %Eq. 8.63 Nu{29,2} = 'Eq. 8.63 (Short Tubes)'; end elseif geometry == 2; % Non-Circular Cross Section Tmave = (Tmi+Tmo)/2; [rho,mu,nu,Pr] = props(fluid,Tmave,quality); [rhos,mus,nus,Prs] = props(fluid,Ts,quality); muratio=mu/mus; Dh = 4*Ac/P; if isnan(mdot); Reh = rho*v*Dh/mu; elseif isnan(v); Reh = 4*mdot/(pi*mu*Dh); end if Reh < 2300 Nu{30,1} = 'See Table 8.1'; Nu{30,2} = ''; elseif Reh > 2300 % Sieder if Pr > 0.7 && Pr < 16700 && Reh > 10000 if L > 60*Dh Nu{31,1} = 0.027*Reh^(4/5)*Pr^(1/3)*(muratio)^0.14; %Eq. 8.61 Nu{31,2} = 'Eq. 8.61 (Sieder - Non-Circular Cross Section)'; elseif L <= 60*Dh % Short Pipe L = 60*Dh*1.01; % This is here to calculate a fully developed % Nu needed to find the Nu for a short pipe. 1.01 is 101% of fully developed length Nuave = 0.027*Reh^(4/5)*Pr^(1/3)*(muratio)^0.14; %Eq. 8.61 C = 2.4254; m = 0.676; Nu{29,1} = Nuave*(1+C/(L/Dh)^m); %Eq. 8.63 Nu{29,2} = 'Eq. 8.63 (Short Tubes)'; end end end end end