Sei sulla pagina 1di 4

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Profili%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear all

x_rid=0:0.0001:1;
Cl=0.96571;
%x_rid_percent=x_rid./100;

y_rid=-(Cl/(4*pi))*((1-x_rid).*log(1-x_rid)+x_rid.*log(x_rid));

x_le=0.05;
y_le=y_rid(x_rid==x_le); %calcolare la funzione in un punto.
dx_rid=diff(x_rid);
l=find(x_rid==x_le);%trovare la posizione di una componente in un vettore.
dy_rid=diff(y_rid);
Dfapp=dy_rid./dx_rid;
D_le=Dfapp(l-1);%derivata numerica (approssimata) calcolata al leading edge."s-1"
perch il comando diff genera vettori di ordine "n-1".

x_te=0.95;
y_te=y_rid(x_rid==x_te); %calcolare la funzione in un punto.
t=find(x_rid==x_te);%trovare la posizione di una componente in un vettore.
D_te=Dfapp(t-1);%derivata numerica (approssimata) calcolata al leading edge."s-1"
perch il comando diff genera vettori di ordine "n-1".

thetacamber=(atan(D_le)-atan(D_te))*180/pi;
theta=atan(Dfapp); %in radianti

x_spes=[0 0.005 0.0075 0.0125 0.0250 0.05 0.075 0.1 0.15 0.2 0.25 0.3 0.35
0.4:0.05:1];
delta=2*[0 0.772 0.932 1.169 1.547 2.177 2.647 3.040 3.666 4.143 4.503 4.760 4.924
4.996 4.963 4.812 4.530 4.146 3.682 3.156 2.584 1.987 1.385 0.810 0.306 0];

x_suction=zeros(1,numel(x_spes));
y_suction=zeros(1,numel(x_spes));

for i=6:numel(x_spes-1)
xi=x_spes(i);
hid=find(x_rid<=xi+0.00001 & x_rid>=xi-0.00001);%%IMPORTANTE per evitare errori
numerici%%
hid=hid-1;

x_suction(1,i)=x_spes(i)-sin(theta(hid))*delta(i)/(2*100);

y_suction(1,i)=y_rid(hid)+cos(theta(hid))*delta(i)/(2*100);

end

x_pressure=zeros(1,numel(x_spes));
y_pressure=zeros(1,numel(x_spes));

for i=6:numel(x_spes-1)
xi=x_spes(i);
hid=find(x_rid<=xi+0.00001 & x_rid>=xi-0.00001);%%IMPORTANTE per evitare errori
numerici%%
hid=hid-1;

x_pressure(1,i)=x_spes(i)+sin(theta(hid))*delta(i)/(2*100);

y_pressure(1,i)=y_rid(hid)-cos(theta(hid))*delta(i)/(2*100);

end

figure(1)

plot(x_rid,y_rid);
hold on

plot(x_suction,y_suction);

plot(x_pressure,y_pressure);

axis([0.05 0.95 -0.2 0.2]);

ax=gca; %%NB%%
ax.XGrid = 'on';
ax.YGrid= 'on';
ax.GridAlpha = 0.5;
ax.XMinorGrid = 'on';
ax.YMinorGrid = 'on';
ax.MinorGridAlpha = 0.4;

xlabel('x_r_i_d');
ylabel('y_r_i_d');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%NEW VERSION%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%NEW VERSION%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%
Clear all

x_rid=0:0.000001:1;

%%%%%%%%%%%%%%%%%%%%%%%INIZIO INPUT%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Cl1=0.8;%Cl dello span_1
r_span=0.228495; %raggio a cui si colloca lo span in metri.
gamma=42.4575;%in deg
lz=0.027961;%corda assiale in metri
l=0.0379;%corda in metri
%%%%%%%%%%%%%%%%%%%%%FINE INPUT%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

y_rid1=-(Cl1/(4*pi))*((1-x_rid).*log(1-x_rid)+x_rid.*log(x_rid));

x_le=0.05;
%y_le=y_rid1(x_rid==x_le);
x_te=0.95;
%y_te=y_rid1(x_rid==x_te);
dx_rid=diff(x_rid);
dy_rid1=diff(y_rid1);
Dfapp1=dy_rid1./dx_rid;

x_rid_new=0:0.000001:(1-0.000001);

D_le1=interp1(x_rid_new,Dfapp1,x_le);
D_te1=interp1(x_rid_new,Dfapp1,x_te);
thetacamber1=(atan(D_le1)-atan(D_te1))*180/pi;

theta1=atan(Dfapp1); %in radianti

x_spes=[0 0.005 0.0075 0.0125 0.0250 0.05 0.075 0.1 0.15 0.2 0.25 0.3 0.35
0.4:0.05:1];
delta=2*[0 0.772 0.932 1.169 1.547 2.177 2.647 3.040 3.666 4.143 4.503 4.760 4.924
4.996 4.963 4.812 4.530 4.146 3.682 3.156 2.584 1.987 1.385 0.810 0.306 0];

x_suction1=zeros(1,numel(x_spes));
y_suction1=zeros(1,numel(x_spes));
y_camberline=zeros(1,numel(x_spes));
beta=zeros(1,numel(x_spes));

for i=1:numel(x_spes)

beta(1,i)=interp1(x_rid_new,theta1,x_spes(i));%zeta theta calcolata per le


ascisse in cui sono definiti gli spessori

x_suction1(1,i)=x_spes(i)-sin(beta(1,i))*delta(i)/(2*100);

y_camberline(1,i)=interp1(x_rid,y_rid1,x_spes(i));%y_camberline y_rid1 calcolata


per le ascisse in cui sono definiti gli spessori

y_suction1(1,i)=y_camberline(1,i)+cos(beta(1,i))*delta(i)/(2*100);

end

x_pressure=zeros(1,numel(x_spes));
y_pressure=zeros(1,numel(x_spes));

for i=1:numel(x_spes)

beta(1,i)=interp1(x_rid_new,theta1,x_spes(i));%zeta theta calcolata per le


ascisse in cui sono definiti gli spessori

x_pressure(1,i)=x_spes(i)+sin(beta(1,i))*delta(i)/(2*100);

y_camberline(1,i)=interp1(x_rid,y_rid1,x_spes(i));
y_pressure(1,i)=y_camberline(1,i)-cos(beta(1,i))*delta(i)/(2*100);

end

gammarad=gamma*pi/180;
betarad=beta+gammarad;%angolo della camberline dall'orizzontale per bladegen

Mprime=zeros(1,numel(x_spes));

for j=1:numel(x_spes)

Mprime(1,j)=(x_spes(j)*l*cosd(gamma))/(r_span);
end

filename1='profili_progetto_naca65_camberline.xlsx'; %esportare le variabili


desiderate in excel
A=[x_spes',y_camberline'];
xlswrite(filename1,A);

filename2='profili_progetto_naca65_suctionside.xlsx';
B=[x_suction1',y_suction1'];
xlswrite(filename2,B);

filename3='profili_progetto_naca65_pressureside.xlsx';
D=[x_pressure',y_pressure',];
xlswrite(filename3,D);

C=[Mprime',betarad'];

%filename='betacamber.txt';
betacamber=fopen('betacamber.txt','wt');
fprintf(betacamber,'%8.7g %8.7g\n',C);
fclose(betacamber);