import math
# Initialization of Variable
rho=998.
mu=1.002/1000
x=48/100.
u=19.6/100
x1=30/100.
b=2.6
#calculation
print "fluid in boundary layer would be entirely in streamline motion "
Re=rho*x*u/mu
print "reynolds no is %.2e"%(Re)
#part 2
Re1=rho*x1*u/mu
delta=x1*4.64*Re1**-.5
print "boundary layer width in (mm): %.4f"%(delta*1000)
#part3
y=0.5*delta #middle of boundary layer
ux=3/2*u*y/delta-.5*u*(y/delta)**3
print "velocity of water in (cm/s): %.4f"%(ux*100)
#part4
R=0.323*rho*u**2*Re1**-0.5
print "shear stress at 30cm in (N/m**2): %.4f"%R
#part5
Rms=0.646*rho*u**2*Re**-0.5
print "mean shear stress experienced over whole plate in (N/m**2) %.4f"%Rms
#part6
F=Rms*x*b
print "total force experienced by the plate in (N) %.4f"%F
import math
# Initialization of Variable
P=102.7*1000
M=28.8/1000
R=8.314
temp=273+18
Recrit=10.**5
u=18.4
b=4.7#width
x=1.3
mu=1.827/100000
#calculation
#part1
rho=P*M/R/temp
xcrit=Recrit*mu/rho/u
a=1-xcrit/1.65
print "%% of surface over which turbulent boundary layer exist is : %.4f"%(a*100)
#part2
Rex=rho*u*x/mu
thik=0.375*Rex**-.2*x
print "thickness of boundary layer in (cm): %.4f"%(thik*100)
y=0.5*thik
ux=u*(y/thik)**(1./7)
print "velocity of air at mid point is (m/s): %.4f"%ux
#part4
lthik=74.6*Rex**-.9*x
print "thickness of laminar boundary layer in (mm): %.4f"%(lthik*1000)
#part5
ub=u*(lthik/thik)**(1./7)
print "velocity at outer edge of laminar sublayer in (m/s): %.4f"%ub
#part6
R=0.0286*rho*u**2*Rex**-0.2
print "shearforce expericienced in (N/m**2) : %.4f"%R
#part7
x1=1.65 #length of plate
Rex1=rho*u*x1/mu
Rms=0.0358*rho*u**2*Rex1**-0.2
print "mean shearforce in (N/m**2): %.4f"%Rms
#part8
F=x1*Rms*b
print "total drag force expericienced by the plate is (N): %.4f"%F
import math
# Initialization of Variable
Q=37.6/1000000
d=3.2/100
mu=1.002/1000
rho=998.
pi=3.14
#calculation
#part1
u=4.*Q/pi/d**2.
Re=rho*u*d/mu
print "pipe flow reynolds no : %.4f"%Re
print "Water will be in streamline motion in the pipe"
#part2
a=-8.*u/d
print "velocity gradient at the pipe wall is (s**-1): %.4f"%a
#part3
Ro=-mu*a
print "Sherastress at pipe wall is N/m**2) %.2e"%(Ro)
#part4
Q=2.10/1000
u=4.*Q/pi/d**2
u=round(u*1000.)/1000.
print "new av. fluid velocity is (m/s): %.4f"%u
Re=rho*u*d/mu
phi=0.0396*Re**-0.25 #friction factor
phi=round(phi*10**5)/10.**5
delb=5*d*Re**-1*phi**-.5
print "thickness of laminar sublayer in (10**-6m): %.4f"%(delb*10**6)
#part5
y=30.*d/phi**0.5/Re #thickness
tbl=y-delb
print "thickness of buffer layer in (mm): %.4f"%(tbl*1000)
#part6
A=pi*d**2./4 #cross sectional area of pipe
dc=d-2*y #dia of turbulent core
Ac=pi*dc**2/4.
p=(1-A/Ac)*100.
print "percentage of pipe-s core occupied by turbulent core is (%%): %.4f"%p
#part7
uplus=5. #from reference
ux=uplus*u*phi**0.5
print "velocity where sublayer and buffer layer meet is (m/s): %.4f"%ux
#part8
yplus=30. #from reference
ux2=u*phi**0.5*(2.5*math.log(yplus)+5.5)
print "velocity where turbulent core and buffer layer meet is (m/s): %.4f"%ux2
#part9
us=u/0.81
print "fluid velocity along the pipe axis (m/s): %.4f"%us
#part10
Ro=phi*rho*u**2
print "shearstress at pipe wall (N/m**2): %.4f"%Ro