% this script solves example 4.2 from Mills Basic Heat and Mass Transfer
% this is to solve for the convection coefficient for
% air flowing (turbulantly) between two flat plates

% Air Properties
mdot = 0.11			% [kg/s]
mue = 22.5e-6		% [kg/m*s]
k = 0.0331			% [W/m*K]
Pr = 0.69			% []
Tbulk = 400			% [K]

% Plate Properties
w = 0.01;			% [m]
h = 0.5;				% [m]
l = 0.8;				% [m]
Twall = 600;		% [K]

Ac = w*h;			% x-sectional area of flow
P = 2*(h+w);		% perimiter of flow area
Dh = 4*Ac/P;		% Hydraulic Diameter

ReDh = mdot*Dh/(Ac*mue) %the Reynolds number

if ReDh <= 2800		%if the Reynolds number is not turbulant
   ReDh					%return just the Reynold number
else					%if it is Turbulant then do the hc caluclations
   f=(0.79*log(ReDh)-1.64)^-2;
   %now calculate the uncorrected nusselt number
   NuDh=((f/8)*(ReDh-1000)*Pr)/(1+12.7*(f/8)^0.5*(Pr^(2/3)-1));
   %now we need to correct NuDh for variable properties
   %from table 4.6 in Mills BHMT for a turb gas heating
   n=-0.55;
   NuDh=NuDh*(Twall/Tbulk)^n;
   
   %now we need to correct for the entry lengths
   %for the given loading configuration table 4.4 Mill BHMT gives
   c=1.18;
   NuDh=c*NuDh				%display the final Nusselt number
   hc = k*NuDh/Dh			%display the convection coefficient
end
