The code is given below.
import numpy as np
import matplotlib.pyplot as plt
# Given data
rho = 701 # [kg/m^3]
mu = 0.51e-3 # [Ns/m^2]
eps = 0.025e-2 # [m]
D = 14.64e-2 # [cm]
L = 3435 # [m]
def f(R):
rf = eps/D
f = (-2*np.log10(rf/3.7065 - 5.0452/R*np.log10(rf**1.1098/2.8257 + 5.8056*R**-0.8981)))**-2 - 0.023
return f
def secant(x1, x2, E):
n = 0; xm = 0; x0 = 0; c = 0;
if (f(x1) * f(x2) < 0):
while True:
# calculate the intermediate value
x0 = ((x1 * f(x2) - x2 * f(x1)) /
(f(x2) - f(x1)))
# check if x0 is root of
# equation or not
c = f(x1) * f(x0)
# update the value of interval
x1 = x2
x2 = x0
# update number of iteration
n += 1
# if x0 is the root of equation
# then break the loop
if (c == 0):
break
xm = ((x1 * f(x2) - x2 * f(x1)) /
(f(x2) - f(x1)))
if(abs(xm - x0) < E):
break
#print("Root of the given equation =", round(x0, 6))
#print("No. of iterations = ", n)
else:
print("Can not find a root in ",
"the given inteval")
return x0
# initializing the values
x1 = 1e5
x2 = 5e5
E = 0.001e-2
Re = secant(x1, x2, E)
# Velocity
V = mu*Re/rho/D
print("Reynolds Number =", round(Re, 2))
print("Velocity = ", round(V,4)," m/s")
R = np.linspace(3e3,5e5,1000)
plt.plot(R,f(R)+0.023)
plt.xlabel("Reynolds Number")
plt.ylabel("Friction Factor")
plt.grid(True)
plt.show()
Output
Please rate the solution if found satisfactory.
use python program In fluid flow problems, the flow velocity in a long horizontal pipe depends...
In fluid flow problems, the flow velocity in a long horizontal pipe depends on the pipe material, pipe geometry and fluid properties in addition to the pump power. For a horizontal pipe with a pump, the friction factor can be obtained from many correlations such as Colebrook-White Equation: 1.1098 :-2 log 3.7065 r) 5.0452 -log Re +5.8506 (Re) -0.8981 -) 2.8257 (1) In which, fis the friction factor and is the roughness ratio given by: given by: PDV Re Where...
In fluid flow problems, the flow velocity in a long horizontal pipe depends on the pipe material, pipe geometry and fluid properties in addition to the pump power. For a horizontal pipe with a pump, the friction factor can be obtained from many correlations such as Colebrook-White Equation: 7--2109 (5.0452 3.7065 Re log --) +5.8506 (Re)-6.8901 (1) 2.8257 In which, fis the friction factor and mi is the roughness ratio given by: given by: Re = obv Where is the...
solve using paython In fluid flow problems, the flow velocity in a long horizontal pipe depends on the pipe material, pipe geometry and fluid properties in addition to the pump power. For a horizontal pipe with a pump, the friction factor can be obtained from many correlations such as Colebrook-White Equation: 1.1998 5.0452 (6) log Re 28257 -)} (1) 3.7065 7--2 log +58506 (Re)-0.3981 In which, f is the friction factor and is the roughness ratio given by: given by:...
Engineering economy In fluid flow problems, the flow velocity in a long horizontal pipe depends on the pipe material, pipe geometry and fluid properties in addition to the pump power. For a horizontal pipe with a pump, the friction factor can be obtained from many correlations such as Colebrook-White Equation: 2.100 =-2 logo 5.0452 Re log + 5.8506 (Re)-a) (1) 3.7065 2.4257 In which, fis the friction factor and ris the roughness ratio given by: given by: pDV Where is...
anbox (31184010sents * Microsoft Word - 1-friction facto X Downloads/midcomp.pdf In fluid flow problems, the flow velocity in a long horizontal pipe depends on the pipe material, pipe geometry and fluid properties in addition to the pump power. For a horizontal pipe with a pump, the friction factor can be obtained from many correlations such as Colebrook-White Equation: 5.0452 Re IOR 2.8257 PDV 1 = -2 108 3.7065 +5.8506 (Re)-0.0001 (1) In which, fis the friction factor and pris the...
Please help with the following matlab code and please show all work. Thank you! Viscous losses in a pipe are expressed in terms of a friction factor, f. It is important to know the frictional forces in pipe flow because they result in pressure loss which must be accounted for in the piping system. For turbulent low in pipes, the friction factor is caleulated using the Colebrook e/D 2.51 where e is the roughness height, D is the pipe diameter...
Please solve a,b,c,d,e,f 1) A water fountain is to be installed at a remote location by attaching a cast iron pipe directly to a water main through which water is flowing. The entrance to the pipe is sharp-edged 15m (K-0.5), and the 15m long piping system involves three 90 bends without vanes (K1.1), a fully open gate valve (K.-0.2), and a fully open angle valve (K-5). If the diameter of the pipe is 2 em and the system is to...
Use the moody diagram provided. You have riveted circular steel pipe that is 1.5ft in diameter. The roughness is ε=0.003ft. Water at T=60oF flowing through the pipe. What is the relative roughness, ε/D, of the pipe? What is the kinematic viscosity of the water in ft2/s? What is the velocity for the Reynold’s number to be Re=1000? Ans 0.00811ft/s What is the velocity needed for the Reynold’s number to be Re=30,000? Ans 0.243ft/s What is the velocity for the Reynold’s...
A 1-mile long 12-inch diameter asphalt dipped cast iron pipe (e = 0.00085 ft) conveys 60°F water at 3 cfs. Determine (a) friction factor f using the Moody Diagram, (b) f using the Colebrook equation, (c) head loss over the 1 mile distance, (d) slope of the EGL. Problem 2 A 1-mile long 12-inch diameter asphalt dipped cast iron pipe (e = 0.00085 ft) conveys 60℉ water at 3 cfs Determine (a) friction factor fusing the Moody Diagram, (b) fusing...
1. Determining fluid flow through pipes and tubes has great relevance in many areas of engineerin gase g and science. In engineering, typical applications include the flow of liquids and s through pipelines and cooling systems. Scientists are interested in topics ranging from flow in blood vessels to nutrient transmission through a plant's vascular system. The resistance to flow in such conduits is parameterized by a dimensionless number called the friction factor. For turbulent flow, the Colebrook Equation provides a...