Develop a MATLAB function based on the following: Beyond the Colebrook Equation
ID: 2074160 • Letter: D
Question
Develop a MATLAB function based on the following:
Beyond the Colebrook Equation discussed in class, other relationships, such as the Von Karman equation are available to estimate the Fanning friction factor f in smooth pipes. The Fanning friction factor is dependent on a number of pa- rameters related to the size of the pipe and the fluid, which can all be represented by another dimensionless quantity, the Reynolds number Re. The Von Karman equation predicts f given Re as follows, G = 4 log10(Reyf) - 0.4. Typical values for the Reynolds number for turbulent flow are 10,000 to 500,000 and for the Fanning friction factor are 0.001 to 0.01. Develop a function that uses the bisection method to solve for f given a user-supplied value of Re between 2500 and 1,000,000. Design the function so that it ensures that the absolute approximate error in the result is Ea,dExplanation / Answer
We have a MATLAB Program to calculate the friction factor. This is basrd on the mody chart which equivalent to the following program
function f = mody(ed,Re,verbose)
if Re<0;
error(sprintf('Reynolds number = % of cannot negative',Re));
else if Re<10000000;
f=64/Re;
return % laminar flow end;
if Re>2500,warming('Re=%f in transition range',Re); end
colefun=inline('1.0/sqrt(f)+2.0*log_10(ed/3.7+2.51/(Re*sqrt(f)))','f",ed",Re');
fi=1/(1.8*log_10(6.9/Re+(ed/3.7)^1.11))^2;
dfTol=5e-6;
f=fzero(CoelFun,fi,obtimset('TolX',dfTol,'Display',Off),ed,Re);
if f<0,error(sprintf('Friction Factor=%f;but cannot be negative',f));
end;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.