# Pressure Drop Analysis

```clc
clear all
close all
```

## Define Constants

```P1 = 500000; % Pa
Q_Step = 1; % mL/min
Q = (0:Q_Step:10)*(1.667*10^-8); % m^3/s
D1 = (1/8)*.0254; % m Entrance Pipe
D2 = 4*10^-3; % m Holder Inlet
D3 = 9*10^-3; % m Holder Fill Chamber
D4 = 147*10^-9;% m Membrane
D5 = 15*10^-3; % Holder Outlet
D6 = (1/8)*.0254; % m Entrance Pipe
L1 = 1*.0254; % m Entrance Pipe
L2 = 10*10^-3; % m Holder Inlet
L3 = 4*10^-3; % m Holder Fill Chamber
L4 = 58*10^-6; % m Membrane Thickness
L5 = 15*10^-3;% Holder Outlet
L6 = 1*.0254; % m Exit Pipe
mu = 1.002*10^-3; % Ns/m^2
N = 7.36*10^8; % Pores per membrane
Q_NTube = Q/N;
k = .5; % loss coeff
p = 998.2; % kgm/s^2
```

## Find P Final

```P_Final = ...
-((Q*128*mu*L6)/(pi*D6^4))-(.5*k*p*(Q/(pi*D5^2)))...
-((Q*128*mu*L5)/(pi*D5^4))...
-((Q_NTube*128*mu*L4)/(pi*D4^4))-(.5*k*p*(Q/(pi*D3^2)))...
-((Q*128*mu*L3)/(pi*D3^4))-(.5*k*p*(Q/(pi*D2^2)))...
-((Q*128*mu*L2)/(pi*D2^4))-(.5*k*p*(Q/(pi*D1^2)))...
-((Q*128*mu*L1)/(pi*D1^4))...
+P1;
```

## Find Delta_P and Q in Standard Units

```Delta_P = -(P_Final-P1);
Q_Standard = (0:Q_Step:10);
```

## Plot Delta_P

```figure('Units','normalized','Position',[0 0 1 1])
subplot(2,3,1)
plot(Q_Standard,Delta_P/6894.76,'LineWidth',1.5)
title('Pressure Drop vs Flow Rate (Constant Temperature 20°C)')
xlabel('Flow Rate (mL/min)')
ylabel('Pressure Drop (Psi)')
grid on
```

## Find Pressure Max and Min Increment

```n = size(Q);
Delta_Max = Delta_P(n(2))/6894.76;
Delta_Min = Delta_P(2)/6894.76;
fprintf('Pressure Drop With Constant Temp, Changing Flow Rate\n\n')
fprintf('The maximum pressure drop is %g Psi\n\n',Delta_Max)
fprintf('The minimum pressure drop is %g Psi\n\n',Delta_Min)
```
```Pressure Drop With Constant Temp, Changing Flow Rate

The maximum pressure drop is 166.582 Psi

The minimum pressure drop is 16.6582 Psi

```

## Temperature Effects on Flow

```Temp = 68:.01:73; % °F
Temp_C = (Temp - 32)*(5/9); % °C
B = 0.00021; % (m^3/m^3 °C) at 20°C
po = 998.2; % kg/m^3 at 20°C
to = 68; % intial temp °F
p_New = po./(1+(B*(to-Temp_C)));
```

## Pressure Drop vs Temperature Change

```Q_Constant = 5*1.667*10^-8; % m^3/s
Q_NTube_Constant = Q_Constant/N;
P_Temp = ...
-((Q_Constant*128*mu*L6)/(pi*D6^4))-(.5*k*p_New*(Q_Constant/(pi*D5^2)))...
-((Q_Constant*128*mu*L5)/(pi*D5^4))...
-((Q_NTube_Constant*128*mu*L4)/(pi*D4^4))-(.5*k*p_New*(Q_Constant/(pi*D3^2)))...
-((Q_Constant*128*mu*L3)/(pi*D3^4))-(.5*k*p_New*(Q_Constant/(pi*D2^2)))...
-((Q_Constant*128*mu*L2)/(pi*D2^4))-(.5*k*p_New*(Q_Constant/(pi*D1^2)))...
-((Q_Constant*128*mu*L1)/(pi*D1^4));
```

## Plot Pressure Drop vs Temperature

```subplot(2,3,2)
plot(Temp_C,-P_Temp/6894.76,'LineWidth',1.5)
title('Pressure Drop vs Temperature (Constant Flow Rate 5mL/min)')
xlabel('Temperature °C')
ylabel('Pressure Drop (Psi)')
grid on
```

## Find Pressure Max and Min Increment

```j = size(Temp);
Delta_TMax = -P_Temp(j(2))/6894.76;
Delta_TMin = -P_Temp(2)/6894.76;
fprintf('Pressure Drop With Changing Temp, Constant Flow Rate\n\n')
fprintf('The maximum pressure drop is %g Psi\n\n',Delta_TMax)
fprintf('The minimum pressure drop is %g Psi\n\n',Delta_TMin)
```
```Pressure Drop With Changing Temp, Constant Flow Rate

The maximum pressure drop is 83.2909 Psi

The minimum pressure drop is 83.2909 Psi

```

## Multiple Lines of Constant Q

```P_Matrix = zeros(j(2),10);
subplot(2,3,3)
for step = 1:1:4;
Q_Multi = (4:.001:4.003)*1.667*10^-8;
Q_NTube_Multi = Q_Multi/N;
P_Multi = ...
-((Q_Multi(step)*128*mu*L6)/(pi*D6^4))-(.5*k*p_New*(Q_Multi(step)/(pi*D5^2)))...
-((Q_Multi(step)*128*mu*L5)/(pi*D5^4))...
-((Q_NTube_Multi(step)*128*mu*L4)/(pi*D4^4))-(.5*k*p_New*(Q_Multi(step)/(pi*D3^2)))...
-((Q_Multi(step)*128*mu*L3)/(pi*D3^4))-(.5*k*p_New*(Q_Multi(step)/(pi*D2^2)))...
-((Q_Multi(step)*128*mu*L2)/(pi*D2^4))-(.5*k*p_New*(Q_Multi(step)/(pi*D1^2)))...
-((Q_Multi(step)*128*mu*L1)/(pi*D1^4));
P_Matrix(:,step) = -P_Multi;
hold on
Line_Color = ['b' 'r' 'c' 'g'];
plot(Temp_C,P_Matrix(:,step)/6894.76,Line_Color(step),'LineWidth',1.5)

end
hold off

title('Pressure Drop vs Temperature with Lines of Constant Flow')
xlabel('Temperature °C')
ylabel('Pressure Drop (Psi)')
grid on
legend('4.000 mL/min','4.001 mL/min','4.002 mL/min','4.003 mL/min','Location','NorthWest')
```

## Changes in Pressure Drop as a Function of Diameter and Flow Rate

```fprintf('Pressure Drop as a Function of Diameter\n\n')
fprintf('Pipe Diameter \t\tSlope(dPdrop/dQ)\n\n')
subplot(2,3,4)
Slope_Vector = zeros(1,6);
for step = 1:1:6;
D_Step = [(1/8) (3/16) (1/4) (3/8) (1/2) (3/4)]*.0254;
Q_Multi = (0:1:10)*(1.667*10^-8);
Q_NTube_Multi = Q_Multi/N;
P_Multi = ...
-((Q_Multi*128*mu*L6)/(pi*D_Step(step)^4))-(.5*k*p*(Q_Multi/(pi*D5^2)))...
-((Q_Multi*128*mu*L5)/(pi*D5^4))...
-((Q_NTube_Multi*128*mu*L4)/(pi*D4^4))-(.5*k*p*(Q_Multi/(pi*D3^2)))...
-((Q_Multi*128*mu*L3)/(pi*D3^4))-(.5*k*p*(Q_Multi/(pi*D2^2)))...
-((Q_Multi*128*mu*L2)/(pi*D2^4))-(.5*k*p*(Q_Multi/(pi*D_Step(step)^2)))...
-((Q_Multi*128*mu*L1)/(pi*D_Step(step)^4));
Slope = (-(P_Multi(11)-P_Multi(2))/6894.76)/((Q_Multi(11)-Q_Multi(2))/(1.667*10^-8));
Slope_Vector(:,step) = Slope;
fprintf('  %f \t\t  %f\n\n',D_Step(step)/.0254,Slope)
hold on
Line_Shape = ['o','x','+','s','d','v'];
Line_Color = ['r' 'm' 'b' 'c' 'k' 'g'];
plot(Q_Multi/(1.667*10^-8),-P_Multi/6894.76,Line_Color(step),'Marker',Line_Shape(step),'LineWidth',1.5)

end
hold off
title('Pressure Drop vs Flow Rate (Constant Lines of Inlet/Outlet Pipe Diameter)')
xlabel('Flow Rate (mL/min)')
ylabel('Pressure Drop (Psi)')
grid on
legend('1/8 in','3/16 in','1/4 in','3/8 in','1/2 in','3/4 in','Location','NorthWest')
subplot(2,3,5)

for step = 1:1:10;
D_Step = [(1/8):.001:.75]*.0254;
Q_Multi = (1:1:10)*(1.667*10^-8);
Q_NTube_Multi = Q_Multi/N;
P_Multi = ...
-((Q_Multi(step)*128*mu*L6)./(pi*D_Step.^4))-(.5*k*p*(Q_Multi(step)/(pi*D5^2)))...
-((Q_Multi(step)*128*mu*L5)/(pi*D5^4))...
-((Q_NTube_Multi(step)*128*mu*L4)/(pi*D4^4))-(.5*k*p*(Q_Multi(step)/(pi*D3^2)))...
-((Q_Multi(step)*128*mu*L3)/(pi*D3^4))-(.5*k*p*(Q_Multi(step)/(pi*D2^2)))...
-((Q_Multi(step)*128*mu*L2)/(pi*D2^4))-(.5*k*p*(Q_Multi(step)./(pi*D_Step.^2)))...
-((Q_Multi(step)*128*mu*L1)./(pi*D_Step.^4));

hold on
Line_Color = ['r','m','b','c','k','g','r','m','b','k'];
Line_Shape = ['-','-','-','-','-','-',':',':',':',':'];
plot(D_Step/.0254,-P_Multi/6894.76,Line_Color(step),'LineStyle',Line_Shape(step),'LineWidth',1.5)

end
hold off
title('Pressure Drop vs Inlet/Outlet Diameter (Constant Lines of Flow Rate)')
xlabel('Inlet/Outlet Diameter (in)')
ylabel('Pressure Drop (Psi)')
grid on
legend('1 mL/min','2 mL/min','3 mL/min','4 mL/min','5 mL/min','6 mL/min','7 mL/min'...
,'8 mL/min','9 mL/min','10 mL/min','Location','NorthWest')
```
```Pressure Drop as a Function of Diameter

Pipe Diameter 		Slope(dPdrop/dQ)

0.125000 		  16.658174

0.187500 		  16.658124

0.250000 		  16.658113

0.375000 		  16.658108

0.500000 		  16.658107

0.750000 		  16.658106

```

## Pressure Resolution

```Flow_Gauge_Acc = .0025; % +/- .25% full scale
PerFullScale = 10*Flow_Gauge_Acc; % mL/min
Pressure_Res = PerFullScale*Slope;
fprintf('Recommended Minimun Pressure Resolution: %g psi\n\n',Pressure_Res);
```
```Recommended Minimun Pressure Resolution: 0.416453 psi

```

## Vary Effective Area: D = 9 mm

```figure('Units','normalized','Position',[0 0 1 1])
for step = 1:1:7;
D4 = [100 120 130 147 150 170 200]*10^-9;
Q = (0:Q_Step:10)*(1.667*10^-8); % m^3/s
Q_NTube_Multi = Q/N;
P_Multi = ((Q_NTube_Multi*128*mu*L4)/(pi*D4(step)^4));

hold on
Line_Shape = ['-','-','-','-','-',':',':',':',':',':'];
Line_Color = ['b','r','c','g','k','b','r','c','g','k'];
plot(Q/(1.667*10^-8),P_Multi/6894.76,Line_Color(step),...
'LineStyle',Line_Shape(step),'LineWidth',1.5)

end
hold off

title('P vs Flow Rate with Lines of Constant Pore Diameter and 9 mm Effective Diameter')
xlabel('Flow Rate (mL/min)')
ylabel('Pressure Drop (Psi)')
grid on
legend('100 nm','120 nm','130 nm','147 nm (Current)','150 nm','170 nm','200 nm','Location','NorthWest');
```

## Vary Effective Area: D = 8 mm

```Pore_Den = N/(9*10^-3); % pores/m
Effective_Diameters = 8*10^-3; % m
N_New = Effective_Diameters*Pore_Den;
figure('Units','normalized','Position',[0 0 1 1])
for step = 1:1:7;
D4 =[100 120 130 147 150 170 200]*10^-9;
Q = (0:Q_Step:10)*(1.667*10^-8); % m^3/s
Q_NTube_Multi = Q/N_New;
P_Multi = ((Q_NTube_Multi*128*mu*L4)/(pi*D4(step)^4));

hold on
Line_Shape = ['-','-','-','-','-',':',':',':',':',':'];
Line_Color = ['b','r','c','g','k','b','r','c','g','k'];
plot(Q/(1.667*10^-8),P_Multi/6894.76,Line_Color(step),...
'LineStyle',Line_Shape(step),'LineWidth',1.5)

end
hold off

title('P vs Flow Rate with Lines of Constant Pore Diameter at 8 mm Effective Diameter')
xlabel('Flow Rate (mL/min)')
ylabel('Pressure Drop (Psi)')
grid on
legend('100 nm','120 nm','130 nm','147 nm (Current)','150 nm','170 nm','200 nm','Location','NorthWest');
```

## Vary Effective Area: D = 10 mm

```Pore_Den = N/(9*10^-3); % pores/m
Effective_Diameters = 10*10^-3; % m
N_New = Effective_Diameters*Pore_Den;
figure('Units','normalized','Position',[0 0 1 1])
for step = 1:1:7;
D4 = [100 120 130 147 150 170 200]*10^-9;
Q = (0:Q_Step:10)*(1.667*10^-8); % m^3/s
Q_NTube_Multi = Q/N_New;
P_Multi = ((Q_NTube_Multi*128*mu*L4)/(pi*D4(step)^4));

hold on
Line_Shape = ['-','-','-','-','-',':',':',':',':',':'];
Line_Color = ['b','r','c','g','k','b','r','c','g','k'];
plot(Q/(1.667*10^-8),P_Multi/6894.76,Line_Color(step),...
'LineStyle',Line_Shape(step),'LineWidth',1.5)

end
hold off

title('P vs Flow Rate with Lines of Constant Pore Diameter at 10 mm Effective Diameter')
xlabel('Flow Rate (mL/min)')
ylabel('Pressure Drop (Psi)')
grid on
legend('100 nm','120 nm','130 nm','147 nm (Current)','150 nm','170 nm','200 nm','Location','NorthWest');
```