-
Notifications
You must be signed in to change notification settings - Fork 0
/
runsingle.m
192 lines (146 loc) · 3.42 KB
/
runsingle.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
clear all
format compact
close all
% Freestream velocity
W = 1.0;
Minf = 0.0;
Sref = 1.0;
xlim = [-1.5 7];
rlim = [0 3];
nsurvey = 51;
nsl = 23;
drawplots = true;
ntstep = 7;
% 1 -- Sphere
% 2 -- BOR with aft cone
% 3 -- Ellipsoid
% 4 -- NACA 4-Digit duct
% 5 -- Bontempo body
% 6 -- NACA 4-Digit body
runcase = 4;
% Default to no kutta condition, turn on inside runcase setup.
kutta = false;
jtelow = -1;
jteup = -1;
if ( runcase == 1 )
% Construct a circle
ncirc = 36;
rad = 0.5;
xcen = 0.0;
[xep, rep, rad, Vex] = setupsphere( ncirc, rad, xcen );
name = 'Sphere';
elseif (runcase == 2)
% Construct example body
ncirc = 10;
nstraight = 22;
rad = 0.16;
len1 = 0.61;
len2 = rad / tan(15*pi/180);
xnose = 0.0;
[xep, rep, rad, Vex] = setupbody( ncirc, nstraight, rad, len1, len2, xnose );
name = 'Body';
elseif (runcase == 3 )
% Construct an ellipse
ncirc = 1501;
rada = 1.1;
radb = 0.374;
xcen = 0.0;
[xep, rep, rad, Vex] = setupellipsoid( ncirc, rada, radb, xcen );
name = 'Ellipsoid';
elseif (runcase == 4 )
naf = 151;
chord = 1.0;
alpha = 5; % Degrees about LE
xoff = 0.0; % X-Offset of LE
roff = 0.5; % R-Offset of LE
% NACA 4-Digit airfoil parameters
dig1 = 4;
dig2 = 4;
dig34 = 12;
flipaf = false;
% Airfoil point spacing
% 1 -- Cosine cluster LE, TE
% 2 -- Cosine cluster LE
% 3 -- Uniform
spacing = 1;
[xep, rep, rad, Vex] = setupNACAduct( naf, chord, alpha, xoff, roff, dig1, dig2, dig34, flipaf, spacing );
% Index for Kutta condition
jtelow = 1;
jteup = naf - 1;
kutta = true;
name = ['NACA ' num2str(dig1) num2str(dig2) num2str(dig34) ' Duct'];
elseif ( runcase == 5 )
npts = 151;
[xep, rep, rad, Vex] = setupbontempobody( npts );
name = 'Bontempo Body';
else
naf = 1501;
ibody = ( naf + 1 ) / 2;
chord = 1.0;
xoff = 0.0; % X-Offset of LE
% NACA 4-Digit airfoil parameters
dig1 = 0;
dig2 = 0;
dig34 = 20;
flipaf = false;
% Airfoil point spacing
% 1 -- Cosine cluster LE, TE
% 2 -- Cosine cluster LE
% 3 -- Uniform
spacing = 1;
[xep, rep, rad, Vex] = setupNACAduct( naf, chord, 0, xoff, 0, dig1, dig2, dig34, flipaf, spacing );
xep = xep(ibody:end);
rep = rep(ibody:end);
rep(1) = 0;
rep(end) = 0;
rad = rad(ibody:end);
Vex = Vex(ibody:end);
name = ['NACA ' num2str(dig1) num2str(dig2) num2str(dig34) ' Body'];
end
names{1} = name;
xepts{1} = xep;
repts{1} = rep;
kuttas{1} = kutta;
props{1} = false;
deltaCP{1} = 0.0;
jtels{1} = jtelow;
jteus{1} = jteup;
rads{1}=rad;
Vexs{1}=Vex;
dCP = .75;
% Disk radius
rdisk = 1.0;
% rdisk = 0.5;
rdisk = 0.46;
rdisk = 0.486144640095513 - 0.05; % 'on' duct lower surface.
% rdisk = 0.4128442572534;
% Disk location
% xstart = 1;
% xstart = 1.0;
xstart = 0.5;
%xstart = 0.99619469809175;
% xstart = 0.0;
rdisk = repts{1}(1);
xstart = xepts{1}(1);
% End of contracting streamtube
xend = 5;
% Vortex ring spacing
dxring = rdisk * 0.1;
% Number of vortex ring panels
npan = ( xend - xstart ) / dxring;
% Set up initial geometry
xpts = linspace( xstart, xend, npan + 1 );
rpts = rdisk * ones( size( xpts ) );
names{2} = 'Disk';
xepts{2} = xpts;
repts{2} = rpts;
kuttas{2} = false;
props{2} = true;
deltaCP{2} = dCP;
xdisk{2} = 0.5;
jtels{2} = 0;
jteus{2} = 0;
rads{2} = 0;
Vexs{2} = nan;
% Execute script
run('bor')