-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathfriction_coeff.m
36 lines (33 loc) · 982 Bytes
/
friction_coeff.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
% Aircraft design tool
%
% Copyright (C) 2022 Mario Bras
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License version 3 as
% published by the Free Software Foundation.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <https://www.gnu.org/licenses/>.
function cf = friction_coeff(x, v, a, rr, mm)
if (v > 0)
re = reynolds(x, v, rr, mm);
if is_laminar(re)
cf = 1.328 / sqrt(re);
else
m = v / a;
cf = 0.455 / log10(re)^2.58 / (1 + 0.144 * m^2)^0.65;
end
else
cf = 0;
end
function test = is_laminar(re)
if re < 5e5
test = true;
else
test = false;
end