% Entrance length effect on turbulent pipe flow, Table 12-3. 
function [hL_hinf, ReD] = TurbEntry(flag,um,Dh,L,mat,Tm)
  [ReD Pr km] = Re(um,Dh,mat,Tm);                        
  if min(ReD) < 5e3 warning = 'TurbEntry: ReD < 5e3'
  end
  if max(ReD) > 1e5 warning = 'TurbEntry: ReD > 1e5'
  end
  switch flag
  case 'straight'
    C=(0.68+3000*ReD^-.81)./Pr.^(1/6);
    m=0.9;
  case 'ninety-bend'
    C=2.8;
    m=0.8;
  case 'sharp-edge'
    C=23.99*ReD.^-0.23;
    m=0.815-2.08e-6*ReD;
  otherwise
    error('flag= ''straight'', ''ninety-bend'' or ''sharp-edge''');
  end
  hL_hinf=1+C./(L./Dh).^m;
end
