Skip to content

Commit 75c7db3

Browse files
committed
Add plot to unsteady example. Add .gitignore
1 parent f60465c commit 75c7db3

File tree

3 files changed

+37
-7
lines changed

3 files changed

+37
-7
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

tests/unsteady_pitch/pitch.m

+36-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
addpath('../../');
22

33
% User input: airfoil, onset flow, kinematics
4-
f = foil_naca4('0012',50,true);
4+
f = foil_naca4('0012',100,true);
55
Uinf = [1,0]; % onset flow
66
f.setPitchAxisOnChordLine(0); % pitch position as fraction of chord: 0=LE, 1=TE
77
k = 1; % reduced frequency
88
alpmax = 2.5*pi/180; % max angle of attack
9-
nosc = 3; % number of oscillations
10-
res = 50; % number of steps at fastest time scale
9+
nosc = 4; % number of oscillations
10+
res = 100; % number of steps at fastest time scale
1111

1212
% Kinematics
1313
spdinf = norm(Uinf);
@@ -87,8 +87,8 @@
8787
figure;
8888
hold on;
8989
fill(f.x/f.chord,f.y/f.chord,[.9 .9 .9]);
90-
xlabel('$x/c$','Interpreter','latex');
91-
ylabel('$y/c$','Interpreter','latex');
90+
%xlabel('$x/c$','Interpreter','latex');
91+
%ylabel('$y/c$','Interpreter','latex');
9292
ip = find(stepper.wake.nu > 0);
9393
in = find(stepper.wake.nu < 0);
9494
plot(stepper.wake.x(ip)/f.chord,stepper.wake.y(ip)/f.chord,'.r',...
@@ -99,7 +99,7 @@
9999
plot(cx,cy,'sk','MarkerSize',16);
100100
set(gca,'FontSize',14);
101101
axis('equal');
102-
grid on;
102+
%grid on;
103103
saveTightFigure('plots/wake.pdf');
104104

105105
figure;
@@ -109,4 +109,33 @@
109109
legend({'$C_L$','$C_M$','$10 C_D$'},'Interpreter','latex');
110110
set(gca,'FontSize',14);
111111
grid on;
112-
saveTightFigure('plots/aerodynamic_coefficients.pdf');
112+
saveTightFigure('plots/aerodynamic_coefficients.pdf');
113+
114+
%-------------------------------------------------------------
115+
% Wall picture
116+
%-------------------------------------------------------------
117+
figure;
118+
subplot(2,1,1);
119+
hold on;
120+
fill(-f.x/f.chord,f.y/f.chord,[.75 .75 .75]);
121+
text(-4.25,-1,'{\it Pitch oscillations about the leading edge of a NACA 0012 airfoil}');
122+
text(-4.00,-1.2,'{\it Michael J. Fairchild, Princeton University, 2016}');
123+
ip = find(stepper.wake.nu > 0);
124+
in = find(stepper.wake.nu < 0);
125+
plot(-stepper.wake.x(ip)/f.chord,stepper.wake.y(ip)/f.chord,'.r',...
126+
'MarkerSize',10);
127+
plot(-stepper.wake.x(in)/f.chord,stepper.wake.y(in)/f.chord,'.b',...
128+
'MarkerSize',10);
129+
set(gca,'FontSize',14);
130+
axis('equal');
131+
axis('off');
132+
133+
subplot(2,1,2);
134+
hold on;
135+
tt=t(I)/T;
136+
plot(tt,CL(I),'k-',tt,CM(I),'k--',tt,10*CD(I),'k-.','LineWidth',1.5);
137+
text(4.05,1.25,'$C_L$','Interpreter','Latex','FontSize',14);
138+
text(4.05,0.25,'$C_M$','Interpreter','Latex','FontSize',14);
139+
text(4.05,-.75,'$C_D$','Interpreter','Latex','FontSize',14);
140+
axis('off');
141+
saveas(gca, 'plots/naca0012pitch.pdf');
26.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)