Homework 8 Solution

advertisement
Homework 8 Solution Manual
A) 5 points
Figure 1
As can be seen in Fig.1, if less than 40 panels are used, the maximum velocity (and velocity at maximum
thickness) depends on number of panels used. The maximum velocity is highest when seven panels are
used and oscillates slightly between seven and 40 panels. After 40 panels, the maximum velocity
remains constant at approximately 1.15. Therefore all computations should be done with at least 40
panels. Matlab code for this part is presented in Fig2 and 3.
i = 0;
for N = 1:100
i = i+1;
mid = int16(N/4+1)
S = ellipse_examp (N)
Smax(i) = max (S)
Smid(i) = S(mid)
end
plot (1:100, Smax)
title ('Max Velocity vs Number of Panels')
xlabel('Number of Panels')
ylabel('Max Velocity')
Figure 2. MATLAB CODE for part A
function [Speed] = ellipse_examp (N)
% example
% % flow over an ellipse
ep = .15; % thickness/chord of ellipse
%N=50;
th=linspace(0,2*pi,N+1);
x=-cos(th);
y=ep*sin(th);
NOTHING ELSE WAS CHANGED IN THE PROVIDED CODE
Figure 3: Ellipse code turned into a function. No real changes were made to the ellipse code.
B) 5 points
The solution is presented in figure 4. Note that e = thickness to chord ratio. b = how much
the oval was stretched in the x direction and compressed in the y direction.
>
Figure 4
C) 5 points
Figure 5a. Analytical and Numerical Solution Plots. 5b. Zoomed in on on the graph.
Max Numerical
1.1502
Max Analytical
1.1500
Figure 6
According to Figure 5, numerical and analytical solutions are very close. Because numerical
solution was evaluated at only a few distinct points, numerical plot is not as smooth as the
analytical plot. Figure 6 shows that numerical and analytical solutions disagree by just 0.02%.
The code for this part is presented in Figure 7.
i = 0;
e = 0.15;
b = -(e -1) / (e+1);
N = 200
for th = 0:2*pi/N:2*pi- 2*pi/N
i = i+1;
x = 1*cos (th);
y = e * sin (th);
uu (i) = 2
xx(i) = x;
yy(i) = y;
/ ( (1+b) * sqrt (1 + (e ^4)* (x ^2 )/ (y ^2)));
end
%plots
plot (xx, uu,xc, Speed)
axis ([ -1.5, 1.5, -0.1, 1.5])
xlabel ('x')
ylabel ('Speed')
legend ('Analytical Solution', 'Numerical Solution')
'Max Numerical '
max (Speed)
'Max Analytical'
(1+e)
Figure 7
Download