from __future__ import division
#Basis 1 kg of solids
feed_rate_solid = 1.33# #Mass rate of feed of solids in kg/sec
U = 1.5# #Mass rate of solids in the underflow in kg/sec
Y = [5.0,4.2,3.7,3.1,2.5]#
print"\n concentration(Y) (kg water/kg solids):\n"
for y in Y:
print"%.1f\n"%(y)
print"\n water to overflow (Y-U) (kg water/kg solids):\n"
O=[]
for y in Y:
O.append(y - 1.5)##Amount of water to overflow in kg water/kg solids
for o in O:
print"\n %.1f\n"%(o)
Uc = [2.00*10**(-4),1.20*10**(-4), 0.94*10**(-4), 0.70*10**(-4), 0.50*10**(-4)]
print"\n sedimentation rate uc (m/sec):\n"
for uc in Uc:
print" %f \n"%(uc)#
X =[1.75*10**4, 2.25*10**4, 2.34*10**4, 2.29*10**4, 2.00*10**4]##X = (Y-U)/Uc
print" \n\n(Y-U)/Uc (s/m):\n"
for x in X:
print"\n %d\n"%(x)#
z = max(X)# #prints the maximum value of X
print"\nMaximum value of (Y-U)/Uc = %ds/m"%(z)#
#Calculating the require darea of the thickener
A = z*1.33/1000# #1.33 is the mass feed rate of solids in kg/sec
#1000 is the density of water in kg/m**3
print"\n The required area of the thickener is :%.2fm**2\n"%(A)#
#Area of the tank required to give an underflow concentration of 1200kg/m**3 for a feed rate of 2 m**3/min
#Initial height of slurry in the tank
H = [900, 800, 700, 600, 500, 400, 300, 260, 250, 220, 200, 180]
uc = [13.4, 10.76, 8.6, 6.6, 4.9, 3.2, 1.8 ,1.21, 1.11, 0.80, 0.60, 0.40]
i=0#
c=[];x=[];sed=[];y=[];z=[]
while i<12:
c.append(200*900/H[(i)])
x.append(1000*(1/c[i]-1/1200))
sed.append(c[(i)]*uc[(i)]/(1000*60))
y.append(uc[(i)]*10**(-3)/((1/c[(i)]-1/1200)*60))
z.append(1/y[(i)])
i=i+1#
print"\nH(mm)"
for h in H:print"%d \t"%(h),#
print
print"\nc(kg/m**3):\n"
for cc in c:print"%d \t"%(cc),
print
print"\nSedimentation flux(kg.s/m**2):\n"
for xx in x:print"%.4f \t"%(xx),
print
print"uc/(1/c-1/1200)\nkg.sec/m**2:\n"
for yy in y:print"%.4f \t"%(yy),
print
print"1000*(1/c-1/cu)\nm**3/kg*10**3\n"
for xx in x:print"%.3f \t"%(xx),
print
print"\n\n(1/c-1/1200)/uc\n m**2.kg/sec\n"
for zz in z:print"%.1f \t"%(zz),
print
m1=max([18.7, 20.1, 21.3, 22.7, 23.8, 26.0, 27.8, 30.3, 30.0, 29.2, 27.8, 25.0])
print"\n\nthe maximum value of (1/c-1/1200)/uc is %.1f m**2*kg/s"%(m1)#
A = 2*200*30.3/60#
print"\n The area required is A = Qc[(1/c-1/cu)/uc]max = %dm**2"%(A)
from sympy import symbols,solve
#Assumption: Resistance force F on an isolated sphere is given by Stoke's law:F = 3*pi(meu)d*u
C = symbols('C')
x=solve(-4.8*C+(1-C))[0]
print"\n concentration is:%.3f"%(x)
#terminal falling velocity u can be calculated by force balance
#u = d**2*g/(18*meu)*(ps-p)
def terminal_velocity():
d = 10**(-4)# #diameter is in meters
g = 9.81# #acceleration due to gravity is in m/sec**2
meu = 10**(-3)# #viscosity is in N.s/m**2
ps = 2600# #density is in kg/m**3
p = 1000# #density is in kg/m**3
u = (d**2)*g*(ps-p)/(18*meu)#
return u
def si_max():
u=terminal_velocity()
print"\n The terminal falling velocity is %.5f m/sec"%(u)#
si=u*x*(1-x)**(4.8)#
return si
si = si_max()#
print"\nThe maximum value is %.3f *10**(-4) m**3/m**2sec"%(si*10**4)