0% found this document useful (0 votes)
16 views11 pages

Propellants 1

شرح معادلات تحكم

Uploaded by

fhmyalbrty3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views11 pages

Propellants 1

شرح معادلات تحكم

Uploaded by

fhmyalbrty3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 11

properties (Access = public)

FT,p_1,option,minitial,deltav,F_choice

end

methods (Access = private)

% Bell nozzle and Chamber function

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);

% Angles for First Curve


Angle_FC=-3*pi/4;
FC_step=(-pi/2-Angle_FC)/9;
theta_FC=(-3*pi/4):FC_step:(-pi/2);

% Coordinates for First Curve


x_FC=cos(theta_FC)*1.5*Rt;
y_FC=sin(theta_FC)*1.5*Rt+(1.5*Rt+Rt);
x_FC1 = x_FC;
y_FC1 = y_FC;
% Angle for Second Curve
Angle_SC=-pi/2;
SC_step=((theta_n-pi/2)-Angle_SC)/9;
theta_SC=-pi/2:SC_step:(theta_n-pi/2);

% Coordinates for Second Curve


x_SC=cos(theta_SC)*0.382*Rt;
y_SC=sin(theta_SC)*0.382*Rt+(0.382*Rt+Rt);
x_SC1 = x_SC;
y_SC1 = y_SC;
theta_e=15*pi/180;

% Angle for Third Curve


x_TC=x_SC1(1,10);
y_TC=y_SC1(1,10);
y_exit=Dia_exit/2;
matrix_y=[2*y_TC 1 0; 2*y_exit 1 0; y_TC^2 y_TC 1];
matrix_x=[1/tan(theta_n); 1/tan(theta_e) ;x_TC];
x_exit= matrix_y^-1*matrix_x;
a=x_exit(1,1);
b=x_exit(2,1);
c=x_exit(3,1);
yn=y_TC:.01:y_exit;
xn= a*(yn).^2+b*yn+c;

% Coordinate of Third Curve


Rao_x=[x_FC1 x_SC1 xn];
Rao_y=[y_FC1 y_SC1 yn];
rao=[Rao_x Rao_y];

%Final nozzle plot


plot(app.UIAxes, Rao_x, Rao_y,Rao_x,-Rao_y);

%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

%Conical nozzle and Chamber function

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

%Final nozzle plot


plot(app.UIAxes,comb_twox,comb_twoy,comb_twox,-comb_twoy)
end

%Injector design function


function [delPo,delPf,Vo,Vf,n,n1,do,df] = Injector(app,m_dot,r,po,pf)

%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

Cd=0.87; %Discharge coefficient (no unit)


LPc=0.15*app.p_1.Value; %Lower threshold 15%of Chamber
pressure (CHANGE)
HPc=0.25*app.p_1.Value; %Higher threshold 25%of Chamber
pressure (CHANGE)
mo = (m_dot*r)/(r+1) ; %Mass flow rate of oxidizer kg/s
mf = m_dot/(r+1) ; %Mass flow rate of fuel kg/s
Qo=mo/po ; %Volumetric flow rate of oxidizer
m3/s
Qf=mf/pf ; %Volumetric flow rate of fuel m3/s
O = 0 ; %Variable to stop the loop
F = 0 ; %Variable to stop the loop
n=0 ;
n1=0 ; %No. of holes

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

%Tank design function


function
[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)

%Description:

pi=3.14;

%Determination of mass of propellants


mfinal=app.minitial.Value/(exp(app.deltav.Value/(go*Isp)));
%Ideal rocket equation
mprop=app.minitial.Value-mfinal;
mfuel=mprop/r;
%Fuel mass
mox=mprop-mfuel;
%Oxidizer mass

%Volume of tanks with 10% extra as ullage volume


volox=1.1*(mox/po);
%Volume of oxidizer
volfuel=1.1*(mfuel/pf);
%Volume of fuel
Vp=volox+volfuel;
%Total Voulme

%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)

%Dimensions and mass of the tanks


rs_fuel=((3/4)*volfuel/pi)^(1/3); %Radius of
fuel
rs_ox=((3/4)*volox/pi)^(1/3); %Radius of
oxidizer
ts_fuel=((maxop_fuel*rs_fuel)/(2*Max_allowable_stress)); %thickness
of sphere 2 endcaps of fuel
ts_ox=((maxop_ox*rs_ox)/(2*Max_allowable_stress)); %thickness
of sphere 2 endcaps of ox
ms_ox=(((4/3)*pi*(rs_ox+ts_ox)^(3)-volox)*rho);
ms_fuel=(((4/3)*pi*(rs_fuel+ts_fuel)^(3)-volfuel)*rho);
mtank_ox=ms_ox; %mass of
each oxidizer tank
mtank_fuel=ms_fuel; %mass of
each fuel tank

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

%PUMP POWER FOR OXIDIZER


a=mass_flow_rate_of_oxidizer;
b=100*100000;
%pressure rise in oxidizer pump (100 bar)
d=0.8;
%pump efficiency
S=(a*b)/(po*d);
%Pump power for oxidizer

%PUMP POWER FOR FUEL


e=mass_flow_rate_of_fuel;
f=115.5*100000;
%pressure rise in oxidizer pump (100 bar)

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

%MASS FLOW RATE OF TURBINE


j=0.7;
%turbine Efficiency
k=1.02;
%coefficient of pressure
l=1000;
%inlet temperature
m=20;
%turbine pressure rat
J=(T/(j*k*l*(1-(1/m)^((g-1)/g))))/60;
%Mass Flow Rate of turbine
end

%Pressure feed function


function [V,Mp,Rpt,Tpt,Mpt]=
pressurefeed(app,Vp,po,pf,Max_allowable_stress,delPo,delPf)

%Description:

Pox=po*8.314*90; %Oxidizer tank pressure


Pfuel=pf*8.314*293; %Fuel tank pressure

Pp=Pox+Pfuel; %Total pressure of propellant tanks


(pascals)
Pg=2000000; %Initial pressure of Pressurant gas
(Pg)

%Calculating Volume of the pressurant tank


Vg=Pp*Vp/Pg;
Ullage_volume = 0.1*Vg;
V= Vg+ Ullage_volume; %Total Pressurant gas tank
volume

%Finding mass of pressurant gas


R=0.08206; %R is the Gas constant L atm K^-1 mol^-1
T=4; %T is temperature of Helium gas K
n=(Pg*9.86923e-6*V*1000)/(R*T); %No of moles (n)=(Pg*V)/(R*T)
Mp=n*4.002602*0.001*100; %Mass of gas

%Pressure calculations
pi=3.14;
rho_he=999.84; %Density of helium

delpinj=(delPo+delPf)/2; %change injection pressure


(Humble) Pa
sf=2; %safety factor
maxop_pre=2.5*(1e5+delpinj)*sf; %max expected operating
pressure (burst)

%Tank mass and dimensions


Rpt=((3/4)*V/pi)^(1/3); %Radius
Tpt=((maxop_pre*Rpt)/(2*Max_allowable_stress)); %Thickness
Mpt=(((4/3)*pi*(Rpt+Tpt)^(3)-V)*rho_he); %Mass

end

end

% Callbacks that handle component events


methods (Access = private)

% Callback function: CalculateButton, ExpansionRatioEditField


function CalculateButtonPushed(app, event)

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

% Callback function: not associated with a component


function ShowPropellantsCheckBoxValueChanged(app, event)
value = app.ShowPropellantsCheckBox.Value;
if(value==1)
app.TextArea_4.Visible='on';
else
app.TextArea_4.Visible='off';
end

end
end

% Component initialization
methods (Access = private)

% App creation and deletion


methods (Access = public)

% Construct app
function app = Copy_of_appp

% Create UIFigure and components


createComponents(app)

% Register the app with App Designer


registerApp(app, app.STARSUIFigure)

if nargout == 0
clear app
end
end

% Code that executes before app deletion


function delete(app)

% Delete UIFigure when app is deleted


delete(app.STARSUIFigure)
end

end

You might also like