Ae 3610 - Midterm - Luke Halladay

Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

Luke Halladay: AE 3610 Midterm 1

AE 3610 Midterm: Investigation of Flow


Over a Vortex Sheet

Luke Halladay

11/4/2022

Western Michigan University


AE 3610 - Aerodynamics I
Fall 2022

Professor Tianshu Liu


Luke Halladay: AE 3610 Midterm 2

Contents
1 Technical Abstract ....................................................................................................................... 3
2 Introduction .................................................................................................................................. 4
3 Method ......................................................................................................................................... 4
4 Algorithm ..................................................................................................................................... 5
5 Result and Discussion ................................................................................................................ 11
6 Conclusion ................................................................................................................................. 16
7 Appendix A: MATLAB Code ................................................................................................... 17

Figures
Figure 1: 3D Velocity Distribution #1 .......................................................................................... 11
Figure 2: 3D Velocity Distribution #2 .......................................................................................... 12
Figure 3: Surface Normal Velocity Optimization ......................................................................... 13
Figure 4: Vortex Strength Distribution ......................................................................................... 13
Figure 5: Velocity Vector Field .................................................................................................... 14
Figure 6: Vortex Sheet Streamlines .............................................................................................. 14
Luke Halladay: AE 3610 Midterm 3

1 Technical Abstract
This project produces a simulation of the thin airfoil theory by creating a thin sheet of vortices in
a uniform flow field. The simulation uses a MATLAB script and generates a flow field using
elemental solutions to the Laplace equation (∇2 𝜙 = 0), namely uniform flow and the vortex
solution. This project has been pursued because of the importance of computational simulations
in the complex field of aerodynamics, as well as helping demonstrate an application of the
elemental Laplace solutions in the thin airfoil theory for how aircraft generate lift. The success of
the simulation is dependent on whether the results are realistic and reasonable. One challenge is
that some quantities in fluid dynamics are difficult to approach with physical intuition, such as
circulation. In these cases, reasonable results can be seen from other results (for example the
circulation of a lifting cylinder), in addition to the comparison of the MATLAB simulation with
a reference script provided by the instructor.
Luke Halladay: AE 3610 Midterm 4

2 Introduction
The purpose of this research project is to investigate the theoretical phenomena of flow over a
vortex sheet at an angle of attack (AOA) with the airspeed velocity upstream. With given
parameters of the velocity upstream (𝑈∞ ), the AOA (𝛼), the chord length of the sheet (c), the
sheet’s leading-edge coordinates (𝑥0 , 𝑦0 ), and the total number of vortices along the sheet (N),
the objective was to produce a simulation in the MATLAB program to determine the theoretical
flow field, vortex strength distribution, total circulation, and the sectional lift coefficient of the
sheet. The model was to be based on the set of equations that governs the theoretical models for
the phenomena, as well as a given reference program titled “Vortex_Sheet.m” that also
references other MATLAB programs. Along with the given parameters, the set of equations
included parameters that can be adjusted to fit the results of the simulation to what would be
expected from the boundary conditions developed in class.
The theoretical models developed in the program are important in the study of aerodynamics and
mesh with important theories such as the thin airfoil theory. In the remainder of this report, the
methods, simulation, and results will be discussed in further detail.

3 Method
The methodology of this research is largely focused on a simulation of flow over a vortex sheet
in the MATLAB program. Based on the vortex sheet and thin airfoil theory developed during the
class, along with the related equations and reference program, the simulation was constructed in
MATLAB to determine the various results, such as the total circulation and sectional lift
coefficient for the sheet. The research also included plotting/graphing the vector field and
streamlines developed for the velocity vector field created by the elemental solutions of the
Laplace equation. Particularly, the solutions used were uniform flow and the vortex. To produce
these plots, files provided by the instructor for MATLAB were referenced and will be discussed
later in this report.
Luke Halladay: AE 3610 Midterm 5

4 Algorithm
In this section I will describe the methods taken in the MATLAB program to produce the
simulation results. Sections of the code may be referenced and/or shown, for the full code of the
program, please refer to Appendix A. Furthermore, this algorithm is based on the given reference
program from the class materials called “Vortex_Sheet.m.”
The first step taken in the code is to create a flow field, which in this case was 500 by 500 units
in size. Then the variables for the following parameters were defined given parameters: the chord
length of the sheet (c), the sheet’s leading-edge coordinates (𝑥0 , 𝑦0 ), vortex separation given by
∆𝑥 = 𝑐/(𝑁 − 1), and the total number of vortices along the sheet (N). Below is the code for
those actions:
clear all
close all

% flow field size

Nx=500;
Ny=500;

% parameters

c=200; % chord length


N=100; % number of vortices
x_0=200; % leading edge x-coordinate
y_0=250; % leading edge y-coordinate
dx=c/(N-1); % vortex separation

Following this, the location of each vortex in the flow field was defined for the sheet. Since the
y-coordinates do not change, each was set to the same as the leading edge. For the x-coordinates,
the algorithm adds the vortex separation defined above to the previous x-coordinate to find the
new one using the equation 𝑥𝑖 = 𝑥0 + (𝑖 − 1)∆𝑥:
% set location for each vortex in field

for i=1:N

x_v(i)=x_0+(i-1)*dx;
y_v(i)=y_0;

end

Next, the given parameters of the velocity upstream (𝑈∞ ) and the AOA (𝛼) are defined and then
the flow field is updated using the following equations for freestream velocity and their resulting
formulas that satisfy the Laplace equation (∇2 𝜙 = 0):
𝑢𝑥,0 = 𝑈∞ cos(𝛼) and 𝑢𝑦,0 = 𝑈∞ sin⁡(𝛼)
𝜙 = 𝑈∞ 𝑥 = 𝑈∞ (r)cos(𝜃) and 𝜓 = 𝑈∞ 𝑦 = 𝑈∞ (r)sin(𝜃)
Luke Halladay: AE 3610 Midterm 6

The algorithm is also defined that calculates the flow field at each point defined at the start of the
program. The two ‘for’ loops move through each of the 500 units in length with their
corresponding 500 units in height. For each of these locations, the coordinate is set, and the
vector is produced based on the elemental flow solutions on the previous page. These vectors are
then stored at the bottom of the code with two newly defined variables: Ux and Uy. Also note
that I defined alpha in two ways, the first “alpha_d” is the AOA in degrees and the second
“alpha_r” is the AOA in radians for ease of use when the cosine and sine functions are called in
the program. As before, the code is below:
% set up uniform flow parameters

alpha_d=-5; % AOA in degrees


alpha_r=-5*(pi/180); % AOA in radians
U_inf=50; % free-stream velocity

% calculate the uniform flow velocity field

for i=1:Nx

for j=1:Ny

x_1=i;
y_1=j;
ux_add=U_inf*cos(alpha_r);
uy_add=U_inf*sin(alpha_r);
Ux_uni(j,i)=ux_add;
Uy_uni(j,i)=uy_add;

end

end

Ux=Ux_uni;
Uy=Uy_uni;

Following this, the vortex strength distribution parameters were defined in the program, these
include amplitude (𝐴𝑚 ), normalized x-coordinate (𝑥̅𝑖 = (𝑥𝑖 − 𝑥0 )/2), epsilon which keeps the
program from attempting to divide by zero should the conditions exist, and lastly 𝑛, which is an
adjustable parameter that was manually check to be the optimal exponent for approaching the
boundary conditions for the vortex solution. Then, using another ‘for’ loop the vortex strength
distribution (𝛾𝑖 ) was calculated for each vortex along the sheet using the following equation
given in the research description:
𝛾𝑖 = 2𝛼𝑈∞ (𝑥̅𝑖 )−𝑛 (1 − 𝑥̅𝑖 )
A slightly different equation appears in the code, which changes the coefficients to one variable,
which is the amplitude, and adds epsilon:
𝛾𝑖 = 𝐴𝑚 (𝑥̅𝑖 + 𝜀)−𝑛 (1 − 𝑥̅𝑖 )
Luke Halladay: AE 3610 Midterm 7

Following this, three ‘for’ loops are used to generate the flow field effect of each vortex. The
first loop cycles through each vortex, and the internal set loops through each coordinate of the
flow field similar to the uniform flow field loops. In this case, the flow field is calculated using
the elemental solutions from the vortex solution, given by the following equations:
𝛾𝑖
𝑢𝑐,𝑖 = −
2𝜋𝑟𝑖
𝑢𝑥,𝑖 = −𝑢𝑐,𝑖 sin⁡(𝜃𝑖 ) and 𝑢𝑦,𝑖 = 𝑢𝑐,𝑖 cos⁡(𝜃𝑖 )
Where 𝑢𝑐,𝑖 is the circumferential velocity of each vortex. In addition, the polar variables 𝑟𝑖 and 𝜃𝑖
are given by the following relations to the cartesian coordinate system:

𝑟𝑖 = √(𝑥 − 𝑥𝑖 )2 + (𝑦 − 𝑦𝑖 )2
𝑦 − 𝑦𝑖
𝜃𝑖 = arctan⁡ ( )
𝑥 − 𝑥𝑖
Where the coordinate of the vortex is (𝑥𝑖 , 𝑦𝑖 ), and the coordinate of some point in the flow field
is (𝑥, 𝑦). Starting by defining the vector between the vortex coordinate at the point in space that
the flow is to be determined, the script moves to calculate the relevant variables. Specifically,
within the loops, each of the above variables (𝑟𝑖 , 𝜃𝑖⁡ 𝑢𝑐,𝑖 , 𝑢𝑥,𝑖 , 𝑢𝑦,𝑖 ) are calculated for each vortex
and location in the flow field and are added to the “Ux_vor” and “Uy_vor” vector fields. Finally,
the velocity fields calculated for each vortex are combined with the uniform flow field using the
superposition principle:
𝑢𝑥 = 𝑢𝑥,0 + ∑𝑁 𝑁
𝑖=1 𝑢𝑥,𝑖 and 𝑢𝑦 = 𝑢𝑦,0 + ∑𝑖=1 𝑢𝑦,𝑖

The following block of code is quite lengthy, so it is available for viewing on the next page:
Luke Halladay: AE 3610 Midterm 8

% vortex sheet strength distribution parameters

Am=2*U_inf*abs(alpha_r);
x_bar=(x_v-x_0)/c;
epsilon=0.01; % parameter to keep from dividing by zero
n=0.8215;

for j=1:N

% vortex sheet strength distribution

gamma(j)=Am*((x_bar(j)+epsilon)^-n)*(1-x_bar(j));

end

% circumferential velocity calculation

r_0=1; % vortex radial size

for k=1:N

for i=1:Nx

for j=1:Ny

% calculate vortex flow velocity field

x_1=i-x_v(k);
y_1=j-y_v(k);

r=((x_1)^2+(y_1)^2)^0.5;
theta=atan2(y_1,x_1);

u_c=gamma(k)/(2*pi*(r_0+r));

ux_add=-u_c*sin(theta);
uy_add=u_c*cos(theta);

Ux_vor(j,i)=ux_add;
Uy_vor(j,i)=uy_add;

end

end

Ux=Ux+Ux_vor;
Uy=Uy+Uy_vor;

end
Luke Halladay: AE 3610 Midterm 9

Next, the program calculates the normal velocity component of the sheet 𝑢𝑦 , to verify that the
algorithm fulfills the non-penetration boundary conditions for the solutions utilized. More
specifically (as defined in the research assignment), this is the calculated absolute value or norm
‖𝑢𝑦 ‖, which is defined as the mean value of 𝑢𝑦 on the vortex sheet. In the code, this was done
by taking the velocity along the vertical direction directly above the flat plat and then averaging
the data set.
In this part of the research, we were asked to vary the value of parameter 𝑛 manually to achieve
results for the norm ‖𝑢𝑦 ‖ as close to the boundary conditions as possible. The manual
optimization procedure was completed, and the value of 𝑛 seen in the above code is the result of
that process.
Following this, the total circulation Γ is calculated by taking the integral of the 𝛾𝑖 (𝑥) over the
vortex sheet. This process required defining the vortex strength distribution function again as a
function of 𝑥. Then, using the Kutta-Joukowski Theorem with Γ the algorithm computes the
sectional lift coefficient of the flat plate. Using the two following equations:
𝐿′
𝐿′ = 𝜌∞ 𝑈∞ Γ and 𝐶𝑙 = 1
𝜌 (𝑈 )2
2 ∞ ∞

The unknown values can be substituted out, and the sectional lift coefficient 𝐶𝑙 can be calculated
in the program:

𝐶𝑙 =
𝑈∞
% calculate the surface normal velocity

Uy_upper=Uy(249,x_0:400)/U_inf;
Uy_lower=Uy(251,x_0:400)/U_inf;
x_upper=1:length(Uy_upper);
norm_Uy=abs(mean(Uy_upper));

% calculate the total circulation from gamma function

dd=10^-5;
gamma_func=@(x)Am*((x+epsilon).^-n).*(1-x);
total_circ=integral(gamma_func,0,1,'RelTol',0,'AbsTol',1e-12);

Cl=(2*total_circ)/U_inf; % determine sectional lift coefficient

The last action performed by the algorithm is to plot three figures. These actions required the
code to call some functions that were defined in the MATLAB code package provided by the
instructor. The first figure uses various functions to plot the velocity vector field, the second
figure uses similar commands to plot the streamlines of the flow field, and the last figure simply
plots the calculated vortex strength distribution across the vortex plate. The code for these
actions is provided on the next page. Lastly, three-dimensional plots for the velocity field were
generated in MATLAB using the “curveFitter” application outside of the script.
Luke Halladay: AE 3610 Midterm 10

% plotting from "Vortex_Sheet.m"

% plot velocity vectors

figure(1);
gx=30;
offset=1;
h = vis_flow (Ux, Uy, gx, offset, 3, 'm');
set(h, 'Color', 'blue');
xlabel('x (pixels)');
ylabel('y (pixels)');
axis image;
set(gca,'YDir','reverse');
hold on;
title('Velocity Vectors');

x_LE_TE=[200;400];
y_LE_TE=[250;250];
plot(x_LE_TE,y_LE_TE,'-','LineWidth',2);
hold off;

% plot streamlines

figure(2);
[m,n]=size(Ux);
[x,y]=meshgrid(1:n,1:m);
dn=10;
dm=10;
[sx,sy]=meshgrid(1:dn:n,1:dm:m);
h=streamslice(x, y, Ux, Uy, 4);
set(h, 'Color', 'black');
xlabel('x (pixels)');
ylabel('y (pixels)');
axis image;
set(gca,'YDir','reverse');
hold on;
title('Streamlines');

x_LE_TE=[200;400];
y_LE_TE=[250;250];
plot(x_LE_TE,y_LE_TE,'-','LineWidth',2);
hold off;

% plot vortex strength distribution

figure(3);
plot(x_bar,gamma);
xlabel('x/c');
ylabel('Vortex Strength (gamma)');
grid;
title('Distribution of Vortex Sheet Strength');
Luke Halladay: AE 3610 Midterm 11

5 Result and Discussion


Meaningful information can be gathered from the results of this research project. Utilizing the
methods and algorithms described in the previous sections of the report I was able to produce
data in the simulation for the flow field around the vortex sheet, normal velocity (𝑢𝑦 ) to the
surface, vortex strength distribution (𝛾𝑖 ), total circulation (Γ), and the sectional lift coefficient
(𝐶𝑙 ). This information is supplemented by various plots of the flow field that was generated in
MATLAB using algorithms and commands.
The produced flow field is two-dimensional, with the velocity having two components: (𝑢𝑥 , 𝑢𝑦 ).
As described in the previous section, the MATLAB program was successful in calculating the
velocity flow field around the vortex sheet. Below is a plot of the magnitude of the wind velocity
against the coordinate in the velocity field:

Figure 1: 3D Velocity Distribution #1

The program produces a 500 by 500 matrix of data for the x and y velocity, which would be
difficult to display in other manners. As can be seen in the above chart, a large portion of the
velocity field is close to the magnitude of the freestream velocity which was 50 m/s, as defined at
the beginning of the code. Although, around the more immediate location of the vortex sheet the
velocity of the fluctuates quite dramatically due to the changing circumferential velocity along
the plate.
On the next page is another view of the plot from above:
Luke Halladay: AE 3610 Midterm 12

Figure 2: 3D Velocity Distribution #2

Further results also include the value of the normal velocity to the vortex sheet. The results for
𝑢𝑦 should be near to zero to meet the non-penetration boundary conditions of our mathematical
model. As discussed in the algorithm, this value was calculated as the mean of the normal
velocities along the plate. Along with this calculation, came a manual optimization procedure for
the user-defined exponent 𝑛 in the equation for the vortex strength distribution:
𝛾𝑖 = 2𝛼𝑈∞ (𝑥̅𝑖 )−𝑛 (1 − 𝑥̅𝑖 )
For this portion of the research, I varied the value of 𝑛 from 0.4 to 1, while plotting the resultant
curve of ‖𝑢𝑦 ‖ as a function of 𝑛. As can be seen from the graph below, the value of the surface
normal velocity seems to converge toward a value of zero around the 𝑛 value near 0.8, or more
specifically 𝑛 = 0.8215, which is the value of 𝑛 that I used for the calculation of the flow field
data discussed in this report.
The chart of the normal velocity against the value of 𝑛 is available on the following page:
Luke Halladay: AE 3610 Midterm 13

Normal Velocity Component (Uy) vs. "n" Value


0.09

Normal Velocity Component


0.08
0.07
0.06
0.05
0.04
0.03
0.02
0.01
0
0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 1.05
"n" Value

Figure 3: Surface Normal Velocity Optimization

The resulting vortex strength distribution that was calculated using the value of 𝑛 = 0.8215 is
plotted below against the plate x over chord length. As expected, it shows an exponential relation
with the x-coordinate of the plate. The vortex strength begins quite high at a value of about 400,
and exponentially decreases toward an asymptote at the end of the vortex sheet.

Figure 4: Vortex Strength Distribution

Furthermore, using the results from above, according to the algorithm described in previous
sections of the report, the velocity vector field and streamlines can be plotted for the resultant
flow field around the vortex sheet. On the following page is the vector field:
Luke Halladay: AE 3610 Midterm 14

Figure 5: Velocity Vector Field

As would be expected, the uniform flow velocity dominates most of the field; however, the
vortices along the plate produce a perturbation in the field that is visible in the vector direction
and magnitude. The streamlines also yield similar information, but is perhaps easier to
distinguish the effects of the vortex sheet on the uniform flow:

Figure 6: Vortex Sheet Streamlines


Luke Halladay: AE 3610 Midterm 15

Following this, the total circulation can be calculated by integrating the function of the vortex
strength distribution over the vortex sheet. The total circulation is an important value for
determining the lift and lift coefficient.
𝑥
Γ = ∫ [2𝛼𝑈∞ (𝑥̅𝑖 )−𝑛 (1 − 𝑥̅𝑖 )] 𝑑𝑥
0

In our case, how the program was constructed the bounds would be from zero to one (can be
seen in the chart above). The integration resulted in a total circulation value of:
Γ = 20.3022
As mentioned, the circulation is an important piece of information for calculating the lift of the
vortex sheet using the Kutta-Joukowski Theorem. As part of the research, we are asked to
determine the sectional lift coefficient. Using the following equations, the value for the sectional
lift coefficient can be determined using values calculated in the MATLAB simulation:
𝐿′
𝐿′ = 𝜌∞ 𝑈∞ Γ and 𝐶𝑙 = 1
𝜌∞ (𝑈∞ )2
2

𝜌∞ 𝑈∞ Γ 2Γ
𝐶𝑙 = =
1 2 𝑈∞
2 𝜌∞ (𝑈∞ )
After additional calculations in the software, the result was a sectional lift coefficient value of:
𝐶𝑙 = 0.8121
Overall, the results of the MATLAB simulation and research project seem to be reasonable, and
within general expectations. Outside of some minor alterations to the program created for the
project that led to slightly different results, the calculations above are also quite near to what the
values that the provided reference program “Vortex_Sheet.m” produced. The generated flow
field also seems reasonable, at least for the simplifying assumptions we have made such as
inviscid and incompressible flow. From physical intuition, the ad-hoc function for the vortex
strength distribution could also make some sense, the vortices might lose strength as the air
moves along the vortex sheet, which perhaps could help represent a loss of kinetic energy
through interactions with the plate surface as well as other air in the flow field to give the
simulation results that are closer to reality. The result of the vortex strength distribution
calculations matches with what would be expected from the equation form, as in an exponential
decrease of the value over distance. The value for total circulation also seems to be reasonable
and leads to a somewhat realistic coefficient of lift. I believe the value for the sectional lift
coefficient seems to be a bit higher than I might expect, but it may be due to the simplifying
assumptions mentioned before that lead to what an ideal result might look like.
Principally, this project illustrates the application and development of the thin airfoil theory. The
vortices are developed over a wing in the boundary layer, and in this theory are idealized into a
thin row of vortices. These results show the development of the theory in MATLAB simulation,
as well as the effects of the vortices on the ability of the wing to generate lift.
Luke Halladay: AE 3610 Midterm 16

6 Conclusion
In aerodynamics, the theories relating to the generation of lift are complicated and often require
computer simulations to assist in generating useful information such as potential flow and
velocity fields. In our level of incompressible fluid dynamics, there are multiple simplifications
that lead to the equations and theories that are utilized. As such, it is important to study results
from these calculations or simulations, as well as work on them so that we can represent reality
as closely as possible. One important theory is the thin airfoil theory. This theory applies the
vortex elemental solution from the Laplace equation to the boundary layer that develops when a
wing is moving through the air. Part of the theory is making a simplifying assumption to one thin
sheet of vortices rather than vortices all around a complex geometrical shape.
Throughout this research, a simulation was produced in MATLAB that constructs a
mathematical model of a thin sheet of vortices, essentially a baseline to the thin airfoil theory.
The mathematical model in MATLAB produced a velocity flow field around a flat vortex sheet,
which has a finite number of vortices along it. Results from the simulation included the vortex
strength distribution (from an ad-hoc function), total circulation, and sectional lift coefficient. In
general, the results seem reasonably within expectations. On the whole, this research project
helped portray the effects of vortices produced in the boundary layer of a wing, and how using
some of the fundamental theories of incompressible aerodynamics, the lift on a thin sheet can be
estimated from the vortex approximation of the boundary layer, which is a large part of the thin
airfoil theory.
Luke Halladay: AE 3610 Midterm 17

7 Appendix A: MATLAB Code


clear all
close all

% flow field size

Nx=500;
Ny=500;

% parameters

c=200; % chord length


N=100; % number of vortices
x_0=200; % leading edge x-coordinate
y_0=250; % leading edge y-coordinate
dx=c/(N-1); % vortex separation

% set location for each vortex in field

for i=1:N

x_v(i)=x_0+(i-1)*dx;
y_v(i)=y_0;

end

% set up uniform flow parameters

alpha_d=-5; % AOA in degrees


alpha_r=-5*(pi/180); % AOA in radians
U_inf=50; % free-stream velocity

% calculate the uniform flow velocity field

for i=1:Nx

for j=1:Ny

x_1=i;
y_1=j;
ux_add=U_inf*cos(alpha_r);
uy_add=U_inf*sin(alpha_r);
Ux_uni(j,i)=ux_add;
Uy_uni(j,i)=uy_add;

end

end

Ux=Ux_uni;
Uy=Uy_uni;

% vortex sheet strength distribution parameters


Luke Halladay: AE 3610 Midterm 18

Am=2*U_inf*abs(alpha_r);
x_bar=(x_v-x_0)/c;
epsilon=0.01; % parameter to keep from dividing by zero
n=0.8215;

for j=1:N

% vortex sheet strength distribution

gamma(j)=Am*((x_bar(j)+epsilon)^-n)*(1-x_bar(j));

end

% circumferential velocity calculation

r_0=1; % vortex radial size

for k=1:N

for i=1:Nx

for j=1:Ny

% calculate vortex flow velocity field

x_1=i-x_v(k);
y_1=j-y_v(k);

r=((x_1)^2+(y_1)^2)^0.5;
theta=atan2(y_1,x_1);

u_c=gamma(k)/(2*pi*(r_0+r));

ux_add=-u_c*sin(theta);
uy_add=u_c*cos(theta);

Ux_vor(j,i)=ux_add;
Uy_vor(j,i)=uy_add;

end

end

Ux=Ux+Ux_vor;
Uy=Uy+Uy_vor;

end

% calculate the surface normal velocity

Uy_upper=Uy(249,x_0:400)/U_inf;
Uy_lower=Uy(251,x_0:400)/U_inf;
x_upper=1:length(Uy_upper);
norm_Uy=abs(mean(Uy_upper));
Luke Halladay: AE 3610 Midterm 19

% calculate the total circulation from gamma function

dd=10^-5;
gamma_func=@(x)Am*((x+epsilon).^-n).*(1-x);
total_circ=integral(gamma_func,0,1,'RelTol',0,'AbsTol',1e-12);

Cl=(2*total_circ)/U_inf; % determine sectional lift coefficient

% plotting from "Vortex_Sheet.m"

% plot velocity vectors

figure(1);
gx=30;
offset=1;
h = vis_flow (Ux, Uy, gx, offset, 3, 'm');
set(h, 'Color', 'blue');
xlabel('x (pixels)');
ylabel('y (pixels)');
axis image;
set(gca,'YDir','reverse');
hold on;
title('Velocity Vectors');

x_LE_TE=[200;400];
y_LE_TE=[250;250];
plot(x_LE_TE,y_LE_TE,'-','LineWidth',2);
hold off;

% plot streamlines

figure(2);
[m,n]=size(Ux);
[x,y]=meshgrid(1:n,1:m);
dn=10;
dm=10;
[sx,sy]=meshgrid(1:dn:n,1:dm:m);
h=streamslice(x, y, Ux, Uy, 4);
set(h, 'Color', 'black');
xlabel('x (pixels)');
ylabel('y (pixels)');
axis image;
set(gca,'YDir','reverse');
hold on;
title('Streamlines');

x_LE_TE=[200;400];
y_LE_TE=[250;250];
plot(x_LE_TE,y_LE_TE,'-','LineWidth',2);
hold off;

% plot vortex strength distribution

figure(3);
Luke Halladay: AE 3610 Midterm 20

plot(x_bar,gamma);
xlabel('x/c');
ylabel('Vortex Strength (gamma)');
grid;
title('Distribution of Vortex Sheet Strength');

You might also like