-
Notifications
You must be signed in to change notification settings - Fork 6
/
sweepangle_fuselage.m
74 lines (44 loc) · 2.09 KB
/
sweepangle_fuselage.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
function SweepAngle = sweepangle_fuselage(SweepParameters, Epsilon)
%SWEEPANGLE_CONSTANT Straight swept leading edge.
% Returns the wing spanwise slope angle vector corresponding to a basic,
% spanwise constant dihedral angle. DihedralParameters is simply that
% constant dihedral angle in this case. Use this as a template for
% user-defined dihedral functions.
% INPUTS: SweepParameters - sweep angle (constant along the span)
% Epsilon - vector of spanwise stations (along the
% non-dimensional spanwise variable Epsilon).
% OUTPUT: SweepAngle - vector (same length as Epsilon) of spanwise
% leading edge sweep angles.
BaselineSweep = SweepParameters(1);
WingletSpanRatio = SweepParameters(2);
WingletInflexionRatio = SweepParameters(3);
WingletSweepAmplitude = SweepParameters(4);
RootFwdFilletRatio = SweepParameters(5);
RootFwdFilletMaxAdditionalSweep = SweepParameters(6);
FuselageSide = SweepParameters(7);
% Baseline sweep
SweepAngle = BaselineSweep*ones(size(Epsilon));
BaseEpsilon = Epsilon;
% Winglet / wingtip rake
if WingletSpanRatio > 0
i1 = 1;
while Epsilon(i1) < WingletSpanRatio, i1 = i1 + 1; end
% Reset Epsilon datum to the start of the winglet
Epsilon = Epsilon - Epsilon(i1);
Epsilon(1:i1-1) = 0;
i2 = i1;
while Epsilon(i2) < (1-WingletSpanRatio)*WingletInflexionRatio, i2 = i2 + 1; end
Epsilon(i2+1:end) = 0;
% Epsilon(i1) ---> 0
% Epsilon(i2) ---> 2pi
SweepAngle = SweepAngle + (sin(2*pi*Epsilon/Epsilon(i2)-pi/2)+1)*WingletSweepAmplitude;
end
%Root fillet
if RootFwdFilletRatio > 0
Epsilon = BaseEpsilon;
AddSweep = ((RootFwdFilletRatio - (Epsilon-FuselageSide))/RootFwdFilletRatio)*RootFwdFilletMaxAdditionalSweep;
AddSweep(Epsilon > RootFwdFilletRatio + FuselageSide) = 0;
%AddSweep(Epsilon < FuselageSide) = 0;
AddSweep(Epsilon < FuselageSide) = 90*(Epsilon(Epsilon < FuselageSide)/FuselageSide).^2;
SweepAngle = SweepAngle + AddSweep;
end