%Matlab bell yb1=linspace(R_n,R_m,np); yb2=linspace(R_m,R_f,np); xb1=(con_b1(1).*yb1.^2)+(con_b1(2).*yb1)+con_b1(3); xb2=(conb2(1).*yb2.^2)+(conb2(2).*yb2)+conb2(3); xDoubleB=[xc1(1:nc1-1)

%Matlab Design Bell Nozzle
and Dual Bell Nozzle from Rao approximation

 clear all;clc;

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

%% Atmospheric Properties
at 3k, 15k

gamma=1.405;

R=288;

%P_atm=1    2

P_atm=7.011e4 1.212e4;        

T_atm=300;   %k

 

%% Chamber Properties temp,
press

P_c=4e6;   %Pascal

T_c=3000;   %k

R_t=0.1;   %m

A_t=(((2*R_t)^2)*pi)/4;       %m*m                                       

M_t=1;

P_t=P_c*(1+((gamma-1)/2)*M_t^2)^(-gamma/(gamma-1));                    

T_t=T_c*(1/(1+((gamma-1)/2)*M_t^2));                              

V_t=M_t*sqrt(gamma*R*T_t); 

 

%% Exit Properties using
isotropic relations

M_e=zeros(1,length(P_atm));

A_e=zeros(1,length(P_atm));

P_e=zeros(1,length(P_atm));

T_e=zeros(1,length(P_atm));

V_e=zeros(1,length(P_atm));

D_e=zeros(1,length(P_atm));

R_e=zeros(1,length(P_atm));

for i=1:length(P_atm)

   
M_e(i)=sqrt((2/(gamma-1))*(((P_c/P_atm(i))^((gamma-1)/gamma))-1));

   
A_e(i)=(A_t/M_e(i))*((1+((gamma-1)/2)*M_e(i)^2)/((gamma+1)/2))^((gamma+1)/(2*(gamma-1)));
%m^2

   
P_e(i)=P_t*(1+((gamma-1)/2)*M_e(i)^2)^(-gamma/(gamma-1));                              %Pa

   
T_e(i)=T_t*(1/(1+((gamma-1)/2)*M_e(i)^2));                                         %K

    V_e(i)=M_e(i)*sqrt(gamma*R*T_e(i));   %m/s

    D_e(i)=sqrt(4*A_e(i)/pi);   %m

    R_e(i)=D_e(i)/2;

end

 

 

%% Rau Nozzle
Approximation:(Length is approximated by cone at 15 degrees)

%assume theata at exit and
point n

Theata_e=5;

Thaeta_N=30;

% Length of Nozzle

for i=1:length(A_e)

   
Ln(i)=(0.8*(sqrt(A_e(i)/A_t)-1)*R_t)/tand(15);

end

%Beginning Point for
Parabola portion

x_N=0.382*R_t*sind(Thaeta_N);

R_n=-sqrt(((0.382*R_t)^2)-x_N^2)+1.382*R_t;

An=(((2*R_n)^2)*pi)/4;

%Solving(abc constants)

for i=1:length(R_e)

    A{i}=2*R_n 1 0; R_n^2 R_n 1; R_e(i)^2
R_e(i) 1;

    b=1/tand(Thaeta_N); x_N; Ln(i);

a_b_c{i}=(A{i}^-1)*b;

end

cons1=a_b_c{1};

cons2=a_b_c{2};

 

%parabolic EQN

np=1000;

yp1=linspace(R_n,R_e(1),np);

yp2=linspace(R_n,R_e(2),np);

xp1=(cons1(1).*yp1.^2)+(cons1(2).*yp1)+cons1(3);

xp2=(cons2(1).*yp2.^2)+(cons2(2).*yp2)+cons2(3);

 

%First circle

nc2=100;

xc2=linspace(0,xp1(1),nc2);

x2c2=linspace(0,xp2(1),nc2);

yc2=-sqrt(((0.382*R_t)^2)-xc2.^2)+1.382*R_t;

y2c2=-sqrt(((0.382*R_t)^2)-x2c2.^2)+1.382*R_t;

 

%Second circle

nc1=50;

x1=-sind(15)*1.5*R_t;

xc1=linspace(x1,0,nc1);

yc1=-sqrt(((1.5*R_t)^2)-xc1.^2)+2.5*R_t;

 

%co-ordinates of x,y

x=xc1(1:nc1-1) xc2(1:nc2-1)
xp1;

y=yc1(1:nc1-1) yc2(1:nc2-1)
yp1;

z=zeros(1,length(x));

x2=xc1(1:nc1-1) x2c2(1:nc2-1)
xp2;

y2=yc1(1:nc1-1) y2c2(1:nc2-1)
yp2;

z2=zeros(1,length(x));

 

 

 

%% Double bell nozzle rao
approximation  

 

%Angle to define inflation
point

Theata_M=25;

Theata_DBe=13;

%Length and radius at exit

Lm=(0.7*(sqrt(A_e(1)/A_t)-1)*R_t)/tand(15);

Lf=(.8*(sqrt(A_e(2)/A_t)-1)*R_t)/tand(15);

R_m=sqrt(A_e(1)/A_t)*R_t;

R_f=sqrt(A_e(2)/A_t)*R_t;

%Parabolic coefficents

Ab1=2*R_n, 1 0;R_n^2, R_n,
1;R_m^2, R_m, 1;

bb1=1/tand(Thaeta_N); x_N; Lm;

con_b1=(Ab1^-1)*bb1;

 

Ab2=R_m^2, R_m, 1;2*R_m, 1,
0;2*R_f, 1, 0;

bb2=Lm; 1/tand(Theata_M);
1/tand(Theata_DBe);

conb2=(Ab2^-1)*bb2;

 

%co-ordinate system of x,y
for dual bell

yb1=linspace(R_n,R_m,np);

yb2=linspace(R_m,R_f,np);

xb1=(con_b1(1).*yb1.^2)+(con_b1(2).*yb1)+con_b1(3);

xb2=(conb2(1).*yb2.^2)+(conb2(2).*yb2)+conb2(3);

 

xDoubleB=xc1(1:nc1-1)
xc2(1:nc2-1) xb1(1:np-1) xb2;

yDoubleB=yc1(1:nc1-1)
y2c2(1:nc2-1) yb1(1:np-1) yb2;

zDoubleB=zeros(1,length(xDoubleB));

 %Data for solid works

csvwrite(‘DoubleB.txt’,xDoubleB’,
yDoubleB’, zDoubleB’)

figure(1)

plot(x,y,’linewidth’,1.5)

hold on

plot(x2,y2,’linewidth’,1.5)

plot(xDoubleB, yDoubleB,’linewidth’,1.5)

legend(‘3k altitude
Bell’,’15K altitude
Bell’,’Double-Bell’,’location’,’best’)

title(‘Nozzle
Geometries of bell and dual bell ‘)