Beruflich Dokumente
Kultur Dokumente
%
% Author: Andrew Cox
% Version: 8/31/2012
clear;
clc;
close all;
%Get start time
t 0 = cputime;
%General variables
c = 1.000; %chord length
N = 200; %Positive integer number of points to use on one side
u inf = 1; %Strenght of the free stream velocity
aoa = 0*pi/180; %Angle between u inf and +xaxis in radians
%NACA inputs:
naca 1 = 0;
naca 2 = 0;
naca 3 4 = 24;
%Converting to useful airfoil measurements
m max = naca 1/100; %Maximum camber, in percent of chord
m x = naca 2/10; %Position of max camber, in tenths of chord
t max = c*naca 3 4/100; %Maximum thickness
%% Find the panel end points
% Define a vector of x coordinates
x = linspace(0, c, N); %Varied distances from 0 to chord along the airfoil
x = transpose(x);
%Calculate the height above mean chord line
y t = (t max/.2)*c*(.2969*sqrt(x/c) .126*(x/c) .3516*(x/c).2 + ...
.2843*(x/c).3 .1036*(x/c).4);
%Calculate the mean camber line
y c = zeros(length(x), 1);
y cPrime = zeros(length(x), 1); %the derivative of the y c line with ...
pect to x
theta = zeros(length(x), 1);
for i = 1:length(x)
if(x(i) < m x*c)
y c(i) = m max*(x(i)/m x2)*(2*m x x(i)/c);
y cPrime(i) = (2*m max*(c*m x x(i)))/(c*m x2);
theta(i) = atan2(2*m max*(c*m x x(i)), c*m x2);
else
y c(i) = m max*((c x(i))/(1 m x)2)*(1 + x(i)/c 2*m x);
y cPrime(i) = 2*m max*(c*m x x(i))/(c*(1 m x)2);
theta(i) = atan2(2*m max*(c*m x x(i)), c*(1 m x)2);
end
end
lowerPts = [x + y t.*sin(theta), y c y t.*cos(theta)];
upperPts = [x y t.*sin(theta), y c + y t.*cos(theta)];
%Make sure there is only one TE point and only one LE point
upperPts = upperPts(1:end1, :); %delete the TE point