# Airfoil pressure distribution using joukowski transform

#### kronecker77

I am given a project to transform an airfoil from a cylinder using joukowski transform. The cylinder is in zeta plane and the airfoil is in z plane. I did the plotting and i got the airfoil shape using matlab. but i want to know how to plot the pressure distribution over the airfoil.

The inputs to my program are:

Velocity, Angle of attack, coordinates of center of circle(zeta plane), radius of circle(zeta plane).
Can somebody please tell me how to plot pressure distribution for an airfoil?

I am using Matlab to do the stuff but i m getting weird plots for pressure distribution. Please help me of someone can...deadline near

Related Aerospace and Astronautics Engineering News on Phys.org

#### mugaliens

Have you tried http://www.desktopaero.com/appliedaero/airfoils1/airfoilpressures.html" [Broken]?

Last edited by a moderator:

#### Brian_C

Do your own work. This is easy stuff.

#### kronecker77

Do your own work. This is easy stuff.
I m stuck somewhere as i m not that good in programming. I know the physics behind that but i m not able to write a computer program for that.

#### kronecker77

Ah the Joukowski airfoil, once my bane. Are you having trouble solving for the pressure, or just displaying it?

I'm not real familiar with Matlab, I do most of my programming just in Fortran, so if it's displaying the results, perhaps the Math & Science Software board might be more appropriate.

Otherwise, check out:
http://en.wikipedia.org/wiki/Joukowsky_transform
http://www.grc.nasa.gov/WWW/K-12/airplane/map.html
Thank u for ur help. I m having problems in plotting the graphs.

#### Cyrus

What exactly do you need to do in terms of your code?

#### kronecker77

I m stuck on how to write the loops for the points on airfoil where i have to plot the pressuer values

#### Cyrus

I m stuck on how to write the loops for the points on airfoil where i have to plot the pressuer values
You can use code tags by typing in:

Code:
<copy paste your code here>[code]

Replace the second code with /code for it work properly. Then you can explain what you are doing and what is going wrong. I've read about doing what you're asking in several books, but I have not implemented it, so I'll try and give a stab at it because I'd like to see it work. My background is flight dynamics and controls, not aerodynamics, so we need to be careful in doing things right. You will also have to supply me with the equations you are using, and what books they are coming from.

#### kronecker77

Code:
clear all
close all
clc

v_inf = input('  Enter the Speed [m/s]: ');
v = v_inf/v_inf;
alpha = input('  enter angle of attack [deg]: ');
alpha = alpha*pi/180;
s_x = input('  Circle Origin, X_0 [m]: ');
s_y = input('  Circle Origin, Y_0 [m]: ');
s = s_x + 1i*s_y;
r = input('  Radius [m]: ');

rho = 1.225;

% TRANSFORMATION PARAMETER
lambda = s_x + sqrt(r^2-s_y^2)%% this is the "C" in the currie book

% CIRCULATION
%  beta = (alpha);
%  k = 2*r*v*sin(beta);
%  Gamma = k/(2*pi) %CIRCULATION

%COMPLEX ASYMPTOTIC SPEED
w = v * exp(1i*alpha);

%TOLLERANCE
% toll = +5e-4;

% GENERATING MESH
x = meshgrid(-10:.2:10);
y = x';

% COMPLEX PLANE
z = x + 1i*y;

% Inside-circle points are Excluded!
for a = 1:length(x)
for b = 1:length(y)
if abs(z(a,b)-s) <=  r
z(a,b) = NaN;
end
end
end

% JOUKOWSKI TRANSFORMATION,
J = z+lambda^2./z;

%GRAPHIC - Circle and Joukowski Airfoil
angle = 0:.1:2*pi;
z_circle = r*(cos(angle)+1i*sin(angle)) + s;
z_airfoil = z_circle+lambda^2./z_circle;

%Lift from KUTTA JOUKOWSKI THEOREM
% L = v_inf*rho*Gamma;
% L_str = num2str(L);

%COEFFICIENT OF LIFT
Cl=2*pi*(r./lambda)*sin(alpha+s_y./r)

%Circulation necessary to satisfy Kutta Condition

Kutta_C = 4*pi*v_inf*r*sin(alpha+asin(s_y/r))

%Chord Length
c_length = max(real(z_airfoil))-min(real(z_airfoil))

%camber(curvature)
h = 2*s_y

%thickness t??
t = max(imag(z_airfoil))-min(imag(z_airfoil))

% complex POTENTIAL
%f =w*(z) + (v*exp(-(1i)*alpha)*r^2)/lambda + 1i*k*log(z);

% Coefficient of lift from circulation
%lift force, Y = pro*v_inf*circulation
%C_lift = Y/(1/2)*pro*v_inf^2*l
C_lift = 2*Kutta_C/(v_inf*c_length)

%Coefficient of lift from thickness, chord length and curvature approach in
%currie

Curr_cl = 2*pi*(1+0.77*(t/c_length))*sin(alpha+2*(h/c_length))

w_tilde = v_inf.*exp(-i.*alpha) + i.*Kutta_C./(2*pi.*((r-s)-z)) + v_inf.*(r.^2)*exp(i.*alpha)./(((r-s)-z).^2);
w = w_tilde./(1 + (z-(r-s)).^2/(s.^2));
value = abs(w.^2);

%aphi = (s.^2 - lambda^2)/s.^2;
%PLOTTING SOLUTION
figure(1)
hold on
%contour(real(z),imag(z),real(f),[-10:.5:10]);
fill(real(z_circle),imag(z_circle),'b')
axis equal
axis on
axis([-10 10 -10 10])
title(strcat('Circle'));

figure(2)
hold on
% contour(real(J),imag(J),real(f),[-10:.5:10])

fill(real(z_airfoil),imag(z_airfoil),'b')
axis equal
axis on
axis([-10 10 -10 10])
title('Transformed Airfoil');

P_airfoil = 99500 + 0.5*1.225*((v_inf.^2) - (abs(w).^2));
%Pressure distribution
figure
a = linspace(0,c_length,101);
Cp = (P_airfoil - 99500)./(0.5*1.225*((v_inf.^2) - (abs(w).^2)));
plot(a,Cp);
%Coefficient of pressure

% cp = 1 - 4*sin(t).^2 + 2* G / (pi*a*V_i) *sin(t) - (2* G/ (pi*a*V_i) )^2 ;

[code]

this program takes the coordinates of a cylinder in one plane and transforms it into an airfoil using the joukowski tranformation. The pressure distribution part is at the end. This is not working. I have no ideas on how to appraoch that. Sorry if i sound ignorant.

#### Cyrus

First thing I will say, is ditch the user input at the command window. Have a variable for speed and AoA. Just set those variables before you hit run. You only really want user input if you are making something for other people to run. Every time you have to test your program, you waste time entering in values.

#### Phrak

Code:
clear all
close all
clc...[code]

Actually, the way to do it is a

[ code ] tag
followed by a slashed code tag
[ /code ]

and leave out the spaces I've used to disable it.

#### Cyrus

Can you explain this first block of code

Code:
v_inf = input(' Enter the Speed [m/s]: ');
v = v_inf/v_inf;
alpha = input(' enter angle of attack [deg]: ');
alpha = alpha*pi/180;
s_x = input(' circle Origin, X_0 [m]: ');
s_y = input(' Circle Origin, Y_0 [m]: ');
s = s_x + 1i*s_y;
r = input(' Radius [m]: ');
What is v, and why don't you just define it as 1?
Also, what is s_x, s_y, and s?

#### kronecker77

s_x and s_y are the coordinates of the center of the circle and r is the radius of the circle in a complex plane which i have to transform to an airfoil using joukowski transform.

s is he distance of the center of the circle from the origin. The imaginary part is there because this is a complex plane.

i can define v as 1 but this doesnot make any difference

#### Cyrus

s_x and s_y are the coordinates of the center of the circle and r is the radius of the circle in a complex plane which i have to transform to an airfoil using joukowski transform.

s is he distance of the center of the circle from the origin. The imaginary part is there because this is a complex plane.

i can define v as 1 but this doesnot make any difference
If v is one, then define:

'v=1'

it is a bad habbit to do what you did because when someone looks at your code they are goign to wonder why you are dividing a variable by itself, and takes more computational power to perform a division operation than a declaration. These kinds of things are big no-nos in blade element or CFD code, where you have to do lots of operations/loops.

Edit: Also, why do you have '1i'?

I would rewrite your block of code as follows:

Code:
%Convert degrees to radian
d2r = pi/180; s

%Define freestream velocity
v_inf = 30;  %[m/s]
v = 1;

%Define AoA
alpha = 5*d2r;

%Define transform coordinates
s_x = 0.2; %[m]
s_y = 0.2 %[m]
s = s_x + i*s_y;
r = 2; %[m]

Last edited:

#### kronecker77

First thing I will say, is ditch the user input at the command window. Have a variable for speed and AoA. Just set those variables before you hit run. You only really want user input if you are making something for other people to run. Every time you have to test your program, you waste time entering in values.
Thank you for that advice. I will implement that.

#### kronecker77

If v is one, then define:

'v=1'

it is a bad habbit to do what you did because when someone looks at your code they are goign to wonder why you are dividing a variable by itself, and takes more computational power to perform a division operation than a declaration. These kinds of things are big no-nos in blade element or CFD code, where you have to do lots of operations/loops.
True. M on a learning curve at the moment. Ur advices are helpful.

#### Cyrus

I corrected your spelling above. I edited my post, but lets move on to the next block of code.

#### Cyrus

Moving to the next block of code, can you explain what's going on here:

Code:
rho = 1.225;

% TRANSFORMATION PARAMETER
lambda = s_x + sqrt(r^2-s_y^2)%% this is the "C" in the currie book

% CIRCULATION
% beta = (alpha);
% k = 2*r*v*sin(beta);
% Gamma = k/(2*pi) %CIRCULATION

%COMPLEX ASYMPTOTIC SPEED
w = v * exp(1i*alpha);

%TOLLERANCE
% toll = +5e-4;

% GENERATING MESH
x = meshgrid(-10:.2:10);
y = x';

% COMPLEX PLANE
z = x + 1i*y;

#### kronecker77

Hi,

I just realized the flaw in my code. Thank you all for your help.

#### Cyrus

Hi,

I just realized the flaw in my code. Thank you all for your help.
Would you mind going over your code anyways?

#### kronecker77

Hi,
Sure, i will message u back in a day or two. At present i m struggling with a boundary layer velocity profile problem. I have everything. Only problem is in visualizing how to plot the velocity profiles.
The problem is about using blasius solution to plot the velocity profiles of u and v with respect to (x,y) location for a flat plate.
Can you help me with that Sir?