import math
D = 38.*10**-3; #in m
U = 1. #in m/s
density = 998. #in kg/cubic m
viscosity = 8.*10**-4 #in Pa-s
DC = 1. #in m
N = 10.
e = 4.*10**-6; #in m
Re = (density*U*D)/viscosity;
print "Reynolds number = %f"%(Re)
f = (4*math.log10((e/D)/3.7+(6.81/Re)**0.9))**-2;
print "friction factor = %f"%(f);
L = 3.14*DC*N;
delta_Pstr = (2*f*U*density*L)/D;
print "pressure drop through straight pipe = %f Pa"%(delta_Pstr)
S = 1+3.54*(D/DC);
print "correction factor = %f"%(S)
delta_P = S*delta_Pstr
print "pressure drop of coil = %f Pa"%(delta_P)
import math
U = 0.5 #in m/s
N = 19.;
DT = 0.026 #in m
L = 2.7 #in m
DS = 0.2 #in m
e = 0.0002 #in m
density = 836. #in kg/cu m
viscosity = 0.00032 #in Pa s
Pr = 6.5;
Prw = 7.6;
HYDIA = (DS**2-N*DT**2)/(DS+N*DT);
Re = HYDIA*U*density/viscosity;
print "Reynolds number = %f"%(Re)
f = (4*math.log10((e/HYDIA)/3.7+(6.81/Re)**0.9))**-2;
print "friction factor = %f"%(f);
L = 3.14*DT*N;
delta_Pstr = (2*f*U*density*L)/HYDIA;
print "pressure drop through straight pipe = %f Pa"%(delta_Pstr)
S = (Prw/Pr)**0.33;
print "correction factor = %f"%(S)
delta_P = S*delta_Pstr
print "pressure drop of coil = %f Pa"%(delta_P)
import math
MH = 10. #in kg/s
MC = 12.5 #in kg/s
CPH = 4.2 #in kJ/kg
CPC = 4.2 #in kJ/kg
THI = 353. #in K
THO = 333. #in K
TCI = 300. #in K
U = 1.8 #in kW/sq m K
Q = MH*CPH*(THI-THO);
print "heat load = %f J"%(Q)
TCO = Q/(MC*CPC)+TCI;
print "cold fluid outlet temperature = %f K"%(TCO)
DT1 = THI-TCO;
DT2 = THO-TCO;
LMTD = (DT1-DT2)/math.log(DT1/DT2);
A = Q/(U*LMTD);
print "for co current flow area = %f sq m"%(A);
DT1 = THI-TCO;
DT2 = THO-TCI;
LMTD = (DT1-DT2)/math.log(DT1/DT2);
A = Q/(U*LMTD);
print "for counter current flow area = %f sq m"%(A);