1

In fluid flow problems, the flow velocity in a long horizontal pipe depends on the pipe...

Question

In fluid flow problems, the flow velocity in a long horizontal pipe depends on the pipe...

In fluid flow problems, the flow velocity in a long horizontal pipe depends on the pipe material, pipe geometry and fluid pro
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 is the roughness of the pipe material and D is the pipe diameter. Note that ruis dimensionless and hence both & and D should be expressed in the same units. Re is Reynolds number which can be calculated from: (2) Where p is the fluid density, u is the fluid viscosity. A cast iron pipe that is 14.64 cm in diameter is 3.435 km long (3435 m). It is to convey octane. The estimated friction factor fis 0.023. a. Determine the velocity of the flow using secant method with an accuracy of 0.001%. By first solving for Re in (1) and then obtaining the required velocity in (2) b. In another part of the same code, Manipulate equation (1) to have f = F(Re) and plot fversus Re for the interval 3000 S Re S 500,000 For octane: p=701 kg/ mp=0.51x10 N.s/m² For cast iron: e=0.025 cm Note: in Python, In(2) is coded log (2) while the logarithm to the base of 10 like log(2) is coded log10(2) Make sure all units are consistent. Save your file as $123456.py where 123456 is your student ID.

Answers

https://trinket.io/python3/88d3a020eb

import matplotlib.pyplot as plt
import numpy as np
import math
def f(x):
e=0.025;
p=701;
mu=0.51e-3;
D=14.64;
tf=e/D;
fp=0.023
return 1/np.sqrt(fp)+2*np.log(tf/3.7065-5.0452*np.log((tf**1.3098)/2.8257+5.8506*(x**(-0.8981)))/x);
def fun(x):
e=0.025;
p=701;
mu=0.51e-3;
D=14.64;
tf=e/D;
yy=-2*np.log(tf/3.7065-5.0452*np.log((tf**1.3098)/2.8257+5.8506*(x**(-0.8981)))/x);
return 1.0/(yy*yy);
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("Reynolds number =",
round(x0, 6));
print("No. of iterations = ", n);
  
else:
print("Can not find a root in ",
"the given inteval");
return x0;
# Driver code
  
# initializing the values
x1 = 10;
x2 = 1000;
E = 0.001e-2;
Re=secant(x1, x2, E);
Re=np.linspace(3000,500000);
ff=fun(Re);
plt.plot(ff,Re);
plt.show();


Similar Solved Questions

1 answers
TOON 150 N 450 N 1000 N/M Question 6 (20 points) Draw the shear and moment...
TOON 150 N 450 N 1000 N/M Question 6 (20 points) Draw the shear and moment diagrams for the beam. The supports at A and B are a thrust bearing and journal bearing, respectively itors 0.5 m A B tim -2m- IM...
1 answers
When the financial executive estimates the cash flows of a project for a capital budgeting analysis,...
When the financial executive estimates the cash flows of a project for a capital budgeting analysis, there is a degree of uncertainty surrounding the estimates. In this context, which of the following statements is true? a) Recognizing the uncertainty surrounding the estimates, the financial executi...
1 answers
What volume of 0.955 M HCl, in milliliters, is required to titrate 2.152g of Na2CO3 to the equivalent point
what volume of 0.955 M HCl, in milliliters, is required to titrate 2.152g of Na2CO3 to the equivalent point? Na2CO3(aq) + 2HCl(aq) 2NaCl(aq) + CO2(g) + H2O(1) can this please be explained in simple step by steps? i am sick and i am having trouble understanding anything....
1 answers
A client becomes angry when refused permission to hand-carry medical records when moving out of state....
A client becomes angry when refused permission to hand-carry medical records when moving out of state. What alternatives can an employee suggest?...
1 answers
Which of the following explains the role of substance P in the pain pathway? a) It...
Which of the following explains the role of substance P in the pain pathway? a) It controls which pain signals reach the brain. b) It modifies sensory information in the spinal cord. c) It has the same function as an endogenous opioid. d) It transmits pain impulses from the brain to the spinal cord....
1 answers
Worksheet 9a (Intro) 11. Place the following elements in order of increasing ionization energy a. Ba,...
Worksheet 9a (Intro) 11. Place the following elements in order of increasing ionization energy a. Ba, Sr, Ca CatSraba b. K, Ca, As AsecaLK c. Si, Na, Mg sengena d. Sn, Sb, I T.Sbisn e. K, Ca, Rb Ribica,k f. S, As, Sn Sri As, 8. Kr. Ba, Zn, Sc, Br Ba, Kr, Br, zn, so 12. Rank the following elements in...
1 answers
Determine the critical energy gaps for a semiconductor that provide complete transmission and complete absorption of...
Determine the critical energy gaps for a semiconductor that provide complete transmission and complete absorption of photons in the visible spectrum....
1 answers
What is a Market Profile
What is the name of a segmentation criteria where a segment must be large enough to support developing a specifc marketing mix?...
1 answers
8. Draw an energy flow diagram for a person running. Include where they get their energy...
8. Draw an energy flow diagram for a person running. Include where they get their energy from and where the energy goes. Draw arrows between all energy boxes to signify HOW the energy is converted. 9. If you have a 100 g cup of hot tea (water) at 100 C sitting and 10 calories leave the cup every 5 s...
1 answers
6. With respect to database systems, which of the following statement(s) is (are) true? a. The...
6. With respect to database systems, which of the following statement(s) is (are) true? a. The physical view of data is how people conceptually organize and understand the relationships among data items. b. The DML builds the data dictionary, creates the database, describes logical views for each us...
1 answers
Consider a system of charged particles for which the ratio of charge to mass, q_i /...
Consider a system of charged particles for which the ratio of charge to mass, q_i / m_i, is the same for each particle. Show that the total dipole moment can be written as p = (q_i / m_i) M R_cm where M is the total mass of the system and R_cm is the position vector of the center of mass. Show that,...
1 answers
Looking at the diagram of transcription in eukaryotes and using the information provided, how could the...
Looking at the diagram of transcription in eukaryotes and using the information provided, how could the expression of lactase RNA be turned on and off by transcription factors, activators and repressors? Styles Font Paragraph Activators bind to genes at Rapressors bind to genes seauences and at ...
1 answers
What is the equivalent capacitance of the three capacitors in the figure?(Figure 1) Express your answer...
What is the equivalent capacitance of the three capacitors in the figure?(Figure 1) Express your answer in microfarads. 30 μF...

-- 0.013063--