Modify the Haaland Function

19 ビュー (過去 30 日間)
Michael Floyd
Michael Floyd 2019 年 11 月 2 日
回答済み: JESUS DAVID ARIZA ROYETH 2019 年 11 月 2 日
I've been asked to modify the Haaland Function. I'm fairly new to matlab, and would appreciate the help.

回答 (1 件)

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH 2019 年 11 月 2 日
here the solution:
function f=Haaland(releps,Re)
if Re<=2300 %if Re <= 2300
f=64/Re;
else % if Re > 2300
answer=0.25/(log10(releps/3.7+5.74/Re^0.9))^2; %calculate f using Swamee..
f2=@(x) 1/sqrt(x)+2*log10(releps/3.7+2.51/(Re*sqrt(x))); %Funcion ColeBrook
f=fsolve(f2,answer); %solve function
end
end

カテゴリ

Help Center および File ExchangeFluid Dynamics についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by