Question

using matlab code to solve the Colebrook Equation: 1/sqrtf= −2.0 ??? ((?/?)/3.7)+2.51/??√?) The following situation should...

using matlab code to solve the Colebrook Equation: 1/sqrtf= −2.0 ??? ((?/?)/3.7)+2.51/??√?) The following situation should be considered: 3. Given Q, L, hf, ρ, µ, and ?, compute the diameter d of the pipe (sizing problem). 4. Given Q, d, hf, ρ, µ, and ?, compute the pipe length L.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Validation: Example problem: kg Q=0.342m/sec E = 0.06 L=100m p=950- h; Ns 8m u = 0.0199 d = 0.3m m m

function d=pipedia(Q,L,hf,rho,mu,e)
d=0.1;
A=(pi/4)*d.^2;
V=Q/A;
Re=rho*V*d/mu;
f=hf*(2*9.81*d)/(L*V.^2);
LHS=1/sqrt(f);
RHS=-2*log(((e/d)/3.7)+(2.51/(Re*sqrt(f))));
while round(LHS,1)~=round(RHS,1)
d=d+0.01;
A=(pi/4)*d.^2;
V=Q/A;
Re=rho*V*d/mu;
f=hf*(2*9.81*d)/(L*V.^2);
LHS=1/sqrt(f);
RHS=-2*log(((e/d)/3.7)+(2.51/(Re*sqrt(f))));
end
end
  

Matlab Result:

>> D=pipedia(0.342,100,8,950,0.019,0.06)

D =

0.3200

function L=pipelength(Q,d,hf,rho,mu,e)
L=1;
A=(pi/4)*d.^2;
V=Q/A;
Re=rho*V*d/mu;
f=hf*(2*9.81*d)/(L*V.^2);
LHS=1/sqrt(f);
RHS=-2*log(((e/d)/3.7)+(2.51/(Re*sqrt(f))));
while round(LHS,2)~=round(RHS,2)
L=L+0.1;
A=(pi/4)*d.^2;
V=Q/A;
Re=rho*V*d/mu;
f=hf*(2*9.81*d)/(L*V.^2);
LHS=1/sqrt(f);
RHS=-2*log(((e/d)/3.7)+(2.51/(Re*sqrt(f))));
end
end
  

Matlab Result:

>> L=pipelength(0.342,0.32,8,950,0.019,0.06)

L =

98.5000

Add a comment
Know the answer?
Add Answer to:
using matlab code to solve the Colebrook Equation: 1/sqrtf= −2.0 ??? ((?/?)/3.7)+2.51/??√?) The following situation should...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT