Colebrook equation and approximation
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I was wondering if anyone could help me answer this question
The velocity of a fluid in a pipe of circular cross section is given by
v(r) = vmax(1 − r/R)^1/γ
where r denotes the radial position (r = 0 corresponds to the centre of the pipe and r = R
corresponds to the surface of the pipe), vmax is the maximum velocity, R is the radius of the
pipe and γ is a coefficient that depends upon the Reynolds number, the radius of the pipe
and the material of the pipe. The expression of γ is given by the following approximation of
the Colebrook equation
γ = − (1/√0.25) log10( e/7.4R + 5.7/Re^0.9)
where e is the roughness of the pipe and Re denotes the Reynolds number.
(a) Create a Matlab function that, given the roughness e, the radius of the pipe R and the
Reynolds number Re, returns the coefficient γ.
(b) Create a Matlab function that, given the roughness e and the maximum velocity vmax,
plots, in a single figure, the velocity for 0 ≤ r ≤ R, for two pipes of radius R1 = 0.1m
and R2 = 0.7m respectively, with a Reynolds number Re = 10,000.
The figure must contain all the necessary information to be self-explanatory and at least
50 points must be used to produce the plots of the velocity for each pipe
function velocity(e,vmax)
R1 = 0.1;
R2 = 0.7;
Re = 10000;
y1 = -(1/sqrt(0.25))*log((e/7.4*R1)+(5.7/Re^0.9));
y2 = -(1/sqrt(0.25))*log((e/7.4*R2)+(5.7/Re^0.9));
r1 = linspace(0,R1,50);
r2 = linspace(0,R2,50);
v1 = vmax(1-r1/R1)^(1/y1);
v2 = vmax(1-r2/R2)^(1/y2);
error message says : Array indices must be positive integers or logical values.
Do i need to make a matrices of 0 to make it work?
1 Commento
Steven Lord
il 18 Lug 2022
This sounds like a homework assignment. If it is, show us the code you've written to try to solve the problem and ask a specific question about where you're having difficulty and we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the free MATLAB Onramp tutorial to quickly learn the essentials of MATLAB.
If you aren't sure where to start because you're not familiar with the mathematics you'll need to solve the problem, I recommend asking your professor and/or teaching assistant for help.
Risposte (1)
Torsten
il 18 Lug 2022
Modificato: Torsten
il 18 Lug 2022
Part a) γ = − (1/√0.25) log10( e/7.4R + 5.7/Re^0.9)
Part b) v = vmax(1 − r/R)^1/γ ; plot(r,v)
What's the problem ? You already wrote down the correlations. Make an attempt to translate them to MATLAB code.
3 Commenti
Torsten
il 18 Lug 2022
e = 0.001;
vmax = 1.0;
velocity(e,vmax)
function velocity(e,vmax)
R1 = 0.1;
R2 = 0.7;
Re = 10000;
y1 = -(1/sqrt(0.25))*log((e/7.4*R1)+(5.7/Re^0.9));
y2 = -(1/sqrt(0.25))*log((e/7.4*R2)+(5.7/Re^0.9));
r1 = linspace(0,R1,50);
r2 = linspace(0,R2,50);
v1 = vmax*(1-r1/R1).^(1/y1);
v2 = vmax*(1-r2/R2).^(1/y2);
plot(r1,v1)
hold on
plot(r2,v2)
end
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
