close all
clear all
nu = 1e-6;
rho = 1000;

D = [0.0254 1.9*.0254 0.2 .3 0.4];
Q = 0:100;  %L/min

for i = 1:length(D)
  Vbar(:,i) = (Q/(1000*60))./(0.25*pi*D(i).^2);
  Re(:,i) = Vbar(:,i)*D(i)/nu;
  f(:,i) = 0.3164./(Re(:,i).^.25);
  hl(:,i) = 0.5*f(:,i).*(Vbar(:,i).^2)./D(i);
  leg_str{i}= ['Diam = ' num2str(D(i)*1000) ' mm'];
end

figure
plot(Q,Vbar)
xlabel('Flow Rate (L/min)');
ylabel('Mean Speed (m/s)');
legend(leg_str);

figure
subplot(2,1,1)
plot(Q,Re)
xlabel('Flow Rate (L/min)');
ylabel('Reynolds Number');
legend(leg_str);
grid on;
subplot(2,1,2)
plot(Q,hl*rho/6894.76)
xlabel('Flow Rate (L/min)');
ylabel('pressure drop (psi per meter)');
legend(leg_str);
grid on;


