Propellants 1
Propellants 1
FT,p_1,option,minitial,deltav,F_choice
end
function[Me,e,Dia_exit,Th_Dia,Th_Area,m_dot,Cf,Ve,Isp,Dia_cc,L_cc,V_cc,V_cyl,L1,Thi
ckness,Mean_Diameter]= int_bell(app,T_1,R,M,g,L_starm,p_e,p_a)
%Description:
theta_conver=45;
Ve = (((2*g*R*T_1)/(M*g-M))*(1-(p_e/app.p_1.Value)^((g-1)/g)))^0.5;
%Exit velocity
Me = sqrt((2/(g-1))*((app.p_1.Value/p_e)^((g-1)/g)-1));
%Exit Mach number
e= (1/Me)*(((2/(g+1))*(1+((g-1)/2)*Me^2)))^((g+1)/(2*(g-1)));
%Expansion ratio
a = (2*g^2)/(g-1);
b = (2/(g+1))^((g+1)/(g-1));
c = 1-(p_e/app.p_1.Value)^((g-1)/g);
Cf = sqrt(a*b*c)+(((p_e-p_a)/app.p_1.Value)*(e));
%Thrust coeff
Th_Area = app.FT.Value/(app.p_1.Value * Cf);
%Throat area
A_exit = Th_Area * e;
%Exit area
Dia_exit=((4*A_exit)/3.14)^(0.5);
%Exit diameter
Th_Dia=((4* Th_Area)/3.14)^(0.5);
%Throat diameter
Rt= Th_Dia/2;
m_dot1 = (Th_Area*app.p_1.Value)/((R/M)*T_1)^0.5;
m_dot2 = g*((2/(g+1))^((g+1)/(g-1)));
m_dot = m_dot1 * m_dot2^0.5 ;
%Mass flow rate
Isp = app.FT.Value/(m_dot * 9.81);
%Specific impulse
%Nozzle plots
theta = 50; %deg
theta_n = theta*pi/180; %rad
area_ratio = A_exit/Th_Area;
Ln = (0.8*((area_ratio)^(0.5)-1)*(Rt))/tand(15);
%Combustion chamber
V_cc=L_starm*Th_Area; %Chamber volume
Dia_cc=((4*V_cc)/(2.5*3.14))^(1/3); %Chamber
diameter
L_cc=2.5*Dia_cc; %Chamber length
syms w z
equat1= w-(app.p_1.Value*0.000145*z)/16000==0;
equat2= z+w/2-(Dia_cc)==0;
[A,B]= equationsToMatrix([equat1,equat2],[w,z]);
R= linsolve(A,B);
Y = reshape(R.',1,[]);
Y1=vpa(Y);
Thickness= Y1(1,1); %Thickness of
chamber
Mean_Diameter=Y1(1,2); %Mean diameter
of chamber
L_conver=(Dia_cc-Th_Dia)/(2*(tand(theta_conver)));
%Length of convergent part (not the slant height, but straight one)
V_conver=(1/3)*3.14*L_conver*((Th_Dia/2)^2+(Dia_cc/2)*(Th_Dia/2)+
(Dia_cc/2)^2); %Volume of the convergent part
V_cyl=V_cc-V_conver;
% Volume of cylindrical part
L1=(V_cyl-V_conver)/((3.14/4)*Dia_cc^2);
%Length of cylindrical part
end
function[Me,e,Dia_exit,Th_Dia,Th_Area,m_dot,Cf,Ve,Isp,Dia_cc,L_cc,V_cc,V_cyl,L1,Thi
ckness,Mean_Diameter]= int_conic(app,T_1,R,M,g,L_starm,p_e,p_a)
%Description:
theta_conver=45;
Ve = (((2*g*R*T_1)/(M*g-M))*(1-(p_e/app.p_1.Value)^((g-1)/g)))^0.5;
%Exit velocity
Me = sqrt((2/(g-1))*((app.p_1.Value/p_e)^((g-1)/g)-1));
%Exit Mach number
e= (1/Me)*(((2/(g+1))*(1+((g-1)/2)*Me^2)))^((g+1)/(2*(g-1)));
%Expansion ratio
a = (2*g^2)/(g-1);
b = (2/(g+1))^((g+1)/(g-1));
c = 1-(p_e/app.p_1.Value)^((g-1)/g);
Cf = sqrt(a*b*c)+(((p_e-p_a)/app.p_1.Value)*(e));
%Thrust coeff
Th_Area = app.FT.Value/(app.p_1.Value * Cf);
%Throat area
A_exit = Th_Area * e;
%Exit area
Dia_exit=((4*A_exit)/3.14)^(0.5);
%Exit diameter
Th_Dia=((4* Th_Area)/3.14)^(0.5);
%Throat diameter
Rt= Th_Dia/2;
m_dot1 = (Th_Area*app.p_1.Value)/((R/M)*T_1)^0.5;
m_dot2 = g*((2/(g+1))^((g+1)/(g-1)));
m_dot = m_dot1 * m_dot2^0.5;
%Mass flow rate
Isp = app.FT.Value/(m_dot * 9.81);
%Specific impulse
%Nozzle plot
div = 15;
Ln= (sqrt(e)-1)*Rt/tand(15);
%First curve
theta_n=15;
angf_n=theta_n*pi/180;
covanF=-3*pi/4;
Fstep = ((angf_n-pi/2)- covanF)/9;
thetaFc= (covanF):Fstep:(angf_n-pi/2);
%coordinates
x_fc = cos(thetaFc)*1.5*Rt;
x_fcn= cos(angf_n-(pi/2))*1.5*Rt;
y_fc = sin(thetaFc)*1.5*Rt+(1.5*Rt+Rt);
y_fcn= sin(angf_n-(pi/2))*1.5*Rt+(1.5*Rt+Rt);
%second curve
ca = tan(angf_n);
cb = y_fcn-(ca*x_fcn);
stepc2 = (Ln-x_fcn)/9;
x_sc = x_fcn:stepc2:Ln;
y_sc = ca*x_sc+cb;
%Third curve
comb_twox =[x_fc x_sc] ;
comb_twoy = [y_fc y_sc];
%Combustion chamber
V_cc=L_starm*Th_Area; %Voume of
chamber
Dia_cc=((4*V_cc)/(2.5*3.14))^(1/3); %Diameter of
chamber
L_cc=2.5*Dia_cc; %Length of
chamber
syms w z
equat1= w-(app.p_1.Value*0.000145*z)/16000==0;
equat2= z+w/2-(Dia_cc)==0;
[A,B]= equationsToMatrix([equat1,equat2],[w,z]);
R= linsolve(A,B);
Y = reshape(R.',1,[]);
Y1=vpa(Y);
Thickness= Y1(1,1); %Thickness of
chamber
Mean_Diameter=Y1(1,2); %Mean diameter
of chamber
L_conver=(Dia_cc-Th_Dia)/(2*(tand(theta_conver)));
%Length of convergent part (not the slant height, but straight one).
V_conver=(1/3)*3.14*L_conver*((Th_Dia/2)^2+(Dia_cc/2)*(Th_Dia/2)+
(Dia_cc/2)^2); %Volume of the convergent part
V_cyl=V_cc-V_conver;
%Volume of cylindrical part
L1=(V_cyl-V_conver)/((3.14/4)*Dia_cc^2);
%Length of cylindrical part
%Description:
%Outer loop(while loop) for increasing n(hole count) then
%inner loop(for loop) for calculations at different diameter values
%when criteria is met the loop breaks by the use of if statement
% Outputs: Pressure drop , Velocity, Holes, Diameter of orifice
% Inputs: Mass flow rate, Mixture ratio, Chamber pressure, Density
while(F==0) %FUEL
n1=n1+10;
for df=0.5:0.25:5.0
af=(3.14/4)*(df*1e-3)^2;
Af=1.1*af*n1;
delPf=((Qf/(Cd*Af))^2)*(pf/2);
Vf=mf/(pf*Af);
if((LPc<=delPf)&&(delPf<=HPc))
F=1;
break
end
end
end
while(O==0) %OXIDIZER
n=n+10;
for do=0.5:0.25:5.0
ao=(3.14/4)*(do*1e-3)^2;
Ao=ao*n;
delPo=((Qo/(Cd*Ao))^2)*(po/2);
Vo=mo/(po*Ao);
if((LPc<=delPo)&&(delPo<=HPc))
O=1;
break
end
end
end
end
%Description:
pi=3.14;
%Pressure calculations
delpdyn_ox=0.5*po*100;
%change dynamic pressure
delpdyn_fuel=0.5*pf*100;
%change dynamic pressure
delpfeed=42500;
%change feed pressure
sf=2;
%safety factor
maxop_ox=sf*(app.p_1.Value+delpdyn_ox+delpfeed+delPo); %max
expected operating pressure (burst)
maxop_fuel=sf*(app.p_1.Value+delpdyn_fuel+delpfeed+delPf); %max
expected operating pressure (burst)
Totmassprop=mtank_ox+mtank_fuel+mfuel+mox;
end
%Turbopump function
function [S,Q,T,J]=turbopum(app,m_dot,po,pf,g,r)
%Description:
mass_flow_rate_of_fuel=m_dot/(r+1);
%Mass flow rate of fuel
mass_flow_rate_of_oxidizer=(m_dot*r)/(r+1);
%Mass flow rate of oxidizer
h=0.8;
%pump efficiency
Q=(e*f)/(pf*h);
%Pump power for fuel
%POWER OF TURBINE
i=0.975;
%mechanical efficiency of turbine
T=(S+Q)/i;
%Power of turbine
%Description:
%Pressure calculations
pi=3.14;
rho_he=999.84; %Density of helium
end
end
app.TabGroup2.Visible='on';
app.RunthetooltoseetheoutputsLabel.Visible='off';
R=8.314;
go=9.8;
app.FT.Value=app.ThrustinNEditField.Value;
app.p_1.Value=app.ChamberPressureinPaEditField.Value;
app.minitial.Value=app.InitialMassinKgEditField.Value;
app.deltav.Value=app.MissionDeltaVinmsEditField.Value;
app.option.Value=str2double(app.PropellantsDropDown.Value);
data=xlsread('PROPELLANT DATA.xlsx');
for i=1:1:12
if(i==app.option.Value)
M=data(i,3); %Molecula_Weight_gmol
r=data(i,4); %Mixtur_Ratio
T_1=data(i,5); %T_c K
g=data(i,6); %Gamma
C_starms=data(i,7); %C_starms;;
po=data(i,8); %Density_of_Oxidizer
pf=data(i,9); %Density_of_Fuel
L_starm=data(i,10); %L_star
end
end
if(app.BellCheckBox.Value==1)
if(app.SealevelCheckBox.Value==1)
p_a = 101325;
p_e = 121590;
[Me,e,Dia_exit,Th_Dia,Th_Area,m_dot,Cf,Ve,Isp,Dia_cc,L_cc,V_cc,V_cyl,L1,Thickness,M
ean_Diameter]= int_bell(app,T_1,R,M,g,L_starm,p_e,p_a);
else
p_a = 0;
p_e = 10000;
[Me,e,Dia_exit,Th_Dia,Th_Area,m_dot,Cf,Ve,Isp,Dia_cc,L_cc,V_cc,V_cyl,L1,Thickness,M
ean_Diameter]= int_bell(app,T_1,R,M,g,L_starm,p_e,p_a);
end
else
if(app.SealevelCheckBox.Value==1)
p_a = 101325;
p_e = 121590;
[Me,e,Dia_exit,Th_Dia,Th_Area,m_dot,Cf,Ve,Isp,Dia_cc,L_cc,V_cc,V_cyl,L1,Thickness,M
ean_Diameter]= int_conic(app,T_1,R,M,g,L_starm,p_e,p_a);
else
p_a = 0;
p_e = 10000;
[Me,e,Dia_exit,Th_Dia,Th_Area,m_dot,Cf,Ve,Isp,Dia_cc,L_cc,V_cc,V_cyl,L1,Thickness,M
ean_Diameter]= int_conic(app,T_1,R,M,g,L_starm,p_e,p_a);
end
end
[delPo,delPf,Vo,Vf,n,n1,do,df] = Injector(app,m_dot,r,po,pf);
app.TurbopumpFeedPanel.Visible='on';
app.PressureFeedPanel.Visible='on';
if(app.AluminiumCheckBox.Value==1)
Max_allowable_stress=137500000;
rho=2710;
[Totmassprop,ms_ox,ms_fuel,ts_ox,ts_fuel,rs_ox,rs_fuel,Vp,volox,volfuel,Max_allowab
le_stress]=
propellanttanks(app,pf,po,r,go,Isp,Max_allowable_stress,rho,delPo,delPf);
if(app.TurbopumpCheckBox.Value==1)
[S,Q,T,J]=turbopum(app,m_dot,po,pf,g,r);
app.PowerofturbineinWEditField.Value=T;
app.MassflowturbineinkgsEditField.Value=J;
app.PowerOxidizerpumpinWEditField.Value=S;
app.PowerFuelpumpinWEditField.Value=Q;
else
[V,Mp,Rpt,Tpt,Mpt]=
pressurefeed(app,Vp,po,pf,Max_allowable_stress,delPo,delPf);
app.Pressurizingtankvolumeinm3EditField.Value=V;
app.PressurizingtankmassinkgEditField.Value=Mpt;
app.TankthicknessinmEditField.Value=Tpt;
app.TankradiusinmEditField.Value=Rpt;
app.PressurizinggasmassinkgEditField.Value=Mp;
end
else
Max_allowable_stress=240000000;
rho=4420;
[Totmassprop,ms_ox,ms_fuel,ts_ox,ts_fuel,rs_ox,rs_fuel,Vp,volox,volfuel,Max_allowab
le_stress]=
propellanttanks(app,pf,po,r,go,Isp,Max_allowable_stress,rho,delPo,delPf);
if(app.TurbopumpCheckBox.Value==1)
[S,Q,T,J]=turbopum(app,m_dot,po,pf,g,r);
app.PowerofturbineinWEditField.Value=T;
app.MassflowturbineinkgsEditField.Value=J;
app.PowerOxidizerpumpinWEditField.Value=S;
app.PowerFuelpumpinWEditField.Value=Q;
app.PressureFeedPanel.Visible='off';
else
[V,Mp,Rpt,Tpt,Mpt]=
pressurefeed(app,Vp,po,pf,Max_allowable_stress,delPo,delPf);
app.Pressurizingtankvolumeinm3EditField.Value=V;
app.PressurizingtankmassinkgEditField.Value=Mpt;
app.TankthicknessinmEditField.Value=Tpt;
app.TankradiusinmEditField.Value=Rpt;
app.PressurizinggasmassinkgEditField.Value=Mp;
app.TurbopumpFeedPanel.Visible='off';
end
end
app.ExitMachnumberEditField.Value=Me;
app.ExpansionRatioEditField.Value=e;
app.ExitdiameterinmEditField.Value=Dia_exit;
app.ThroatAreainm2EditField.Value=Th_Area;
app.MassflowrateinkgsEditField.Value=m_dot;
app.CoefficientofThrustEditField.Value=Cf;
app.ExitVelocityinmsEditField.Value=Ve;
app.SpecificImpulseinsEditField.Value=Isp;
app.ThroatDiameterinmEditField.Value=Th_Dia;
app.DiameterinmEditField.Value=double(Dia_cc);
app.LengthinmEditField.Value=double(L_cc);
app.Volumeinm3EditField.Value=double(V_cc);
app.Volumeinm3EditField_2.Value=double(V_cyl);
app.LengthinmEditField_2.Value=double(L1);
app.ThicknessinmEditField.Value=double(Thickness);
app.MeanDiameterinmEditField.Value=double(Mean_Diameter);
app.PressureDropOxidizerinPaEditField.Value=delPo;
app.PressureDropFuelinPaEditField.Value=delPf;
app.VelocityfromOxidizerorificeinmsEditField.Value=Vo;
app.VelocityfromFuelorificeinmsEditField.Value=Vf;
app.NumberofOxidizerholesEditField.Value=n;
app.NumberofFuelholesEditField.Value=n1;
app.DiameterofOxidizerorificeinmEditField.Value=do;
app.DiameterofFuelorificeinmEditField.Value=df;
app.MassinkgEditField.Value=Totmassprop;
app.Volumeinm3EditField_3.Value=Vp;
app.MassinkgEditField_2.Value=ms_ox;
app.MassinkgEditField_3.Value=ms_fuel;
app.ThicknessinmEditField_2.Value=ts_ox;
app.ThicknessinmEditField_3.Value=ts_fuel;
app.Volumeinm3EditField_4.Value=volox;
app.Volumeinm3EditField_5.Value=volfuel;
app.RadiusinmEditField.Value=rs_ox;
app.RadiusinmEditField_2.Value=rs_fuel;
end
end
end
% Component initialization
methods (Access = private)
% Construct app
function app = Copy_of_appp
if nargout == 0
clear app
end
end
end