Velocity profile over a cross section of pipe in which the flow is fully defined

Velocity profile over a cross-section of pipe in which the flow is fully defined 


from numpy import *

from matplotlib.pyplot import *
from math import *
p1 = eval(input('enter the pressure P1(N) '))
p2 = eval(input('enter the pressure P2(N) '))
mu = eval(input('enter the viscosity (Ns/m2) '))
R = eval(input('enter the radius of the pipe in m(meter) '))
l = eval(input('enter the length of the pipe in m(meter) '))
if p1<p2:
    p1,p2 = p2,p1
if p1==p2:
    print("since  p1 is equal to p2 no graph can be plot")
n =200;
r = linspace(-R,R,n)
vmax = (p1-p2)*R**2/(4*mu*l)
v = vmax*(1-(r**2)/R**2)
t = (p1-p2)*r/(2*l)
scatter(v,r)
xlabel('velocity in m/s')
ylabel('diameter in meter')
title('velocity profile over a cross section of pipe in which the flow is fully defined')

show()



Post a Comment

0 Comments