Rocket Engine Injector Modeling


2004

(1) Simulation
(Application Window)

rocket engine injector modeling

(2) Source Code (Written in MatLab M file)

The application is composed by total  eight files.

(2-0) InjectorCal

function InjectorCal(action)

switch action
  
case 'statrt'
   set(gcbf, 'WindowButtonMotionFcn', 'temperature move')
   set(gcbf, 'WindowButtonUpFcn', 'temperature stop')
   temperature move
  
case 'move'
   currentPoint=get(gca,'CurrentPoint');
   newY=currentPoint(3);
   fah=min(240,max(-40,newY));
   cels=fah-32*(5/9);
   roc=cels*fah;
   LocalSetDisplay(fah,cels)
  
case 'stop'
   set(gcbf,'WindowButtonMotionFcn','')
   set(gcbf,'WindwoButtonUpFcn','')
  
case 'fahrenheit'
   fah=eval(get(gcbo,'String'));
   fah=min(240,max(-40,fah));
   cels=(fah-32)*(5/9);           %She does not know input, cels
%  roc=cels*fah;
   LocalSetDisplay(fah,cels)
  
case 'celsius'
   cels=eval(get(gcbo,'String'));
   cels=min(120,max(-40,cels));
   fuHanl=findobj(gcbf,'Tag','FuelRau');
   fuString=get(fuHanl,'String');
   fuelden=eval(fuString);
   fah=fuelden+cels*(9/5)+32;
%  roc=cels*fah;
   LocalSetDisplay(fah,cels)
  
case 'rocket'
   ceHanl=findobj(gcbf,'Tag','celsiustext');
   faHanl=findobj(gcbf,'Tag','fahrenheittext');
   ceString=get(ceHanl,'String');
   faString=get(faHanl,'String');
   ce=eval(ceString);
   fa=eval(faString);
   roc=ce*fa;
   LocalSetDisplay1(roc)
  
%case 'deltaP'
%   del_p=f*(L/d)*(rau*v_l^2/2/g_l);
  
%case 'mfro'
%   mfr_o=C_d_o*rau_o*A_o*sqrt(2*del_p_o/rau_o);
%   LocalSetDisplay(mfro)
  
%case 'mfrf'
%   mfr_f=C_d_o*rau_f*A_f*sqrt(2*del_p_f/rau_f);
  
%case 'Qo'
%   Q_o=mfro/rau_o;
  
%case 'Qf'
%   Q_f=mfrf/rau_f;
  
%case 'mr'
%   mixratio=mfr_o/mfr_f;
  
%case 'vel'
%   v_o=Q_o/A_o;
%   v_f=Q_f/A_f;
  
end

function LocalSetDisplay(fah,cels)

mix=fah+cels;
pointerHandle=findobj(gcbf,'Tag','redline');
set(pointerHandle,'YData',[-40 fah])
fahHnd1=findobj(gcbf,'Tag','fahrenheittext');
set(fahHnd1,'String',sprintf('%3.1f',fah))
celsHnd1=findobj(gcbf,'Tag','celsiustext'); %At Tag celsiustext will be target
set(celsHnd1,'String',sprintf('%3.1f',cels))
%rocHanl=findobj(gcbf,'Tag','rockettext');
%set(rocHanl,'String',sprintf('%5.1f',roc))
mixHanl=findobj(gcbf,'Tag','MixtureRatio');
set(mixHanl,'String',sprintf('%6.3f',mix))

function LocalSetDisplay1(roc)

rocHanl=findobj(gcbf,'Tag','rockettext');
set(rocHanl,'String',sprintf('%5.1f',roc))

(2-1) InjectorCD

function [C_d]=InjectorCD(injector,diameter)

C_dmatrix=[0.65 0.65 0.65 0.61 0.61 0.61
   0.00 0.70 0.72 0.00 0.00 0.00
   0.00 0.88 0.90 0.00 0.00 0.00
   0.70 0.82 0.76 0.84 0.84 0.00
   0.00 0.20 0.00 0.00 0.00 0.55];
  
C_d=C_dmatrix(injector,diameter);                     % (row,colum)=(Injector type, Diameter size)

(2-2) InjectorDe

function fig = InjectorDe()
% This is the machine-generated representation of a Handle Graphics object
% and its children.  Note that handle values may change when these objects
% are re-created. This may cause problems with any callbacks written to
% depend on the value of the handle at the time the object was saved.
% This problem is solved by saving the output as a FIG-file.
%
% To reopen this object, just type the name of the M-file at the MATLAB
% prompt. The M-file and its associated MAT-file must be on your path.
%
% NOTE: certain newer features in MATLAB may not have been saved in this
% M-file due to limitations of this format, which has been superseded by
% FIG-files.  Figures which have been annotated using the plot editor tools
% are incompatible with the M-file/MAT-file format, and should be saved as
% FIG-files.

load InjectorDe

h0 = figure('Units','points', ...
    'Color',[0.8 0.8 0.8], ...
    'Colormap',mat0, ...
    'FileName','C:\MATLAB_SR11\work\InjectorDe.m', ...
    'PaperPosition',[18 180 576 432], ...
    'PaperUnits','points', ...
    'Position',[6 46.5 749.25 511.5], ...
    'Tag','Fig1', ...
    'ToolBar','none');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'ListboxTop',0, ...
    'Position',[138.75 117 72.75 28.5], ...
    'String','0.000130588', ...
    'Style','edit', ...
    'Tag','qf');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'ListboxTop',0, ...
    'Position',[47.25 117.75 74.25 26.25], ...
    'String','0.111914100', ...
    'Style','edit', ...
    'Tag','mdotf', ...
    'UserData','[ ]');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[146.25 162 58.5 41.25], ...
    'String','Volume Flow Rate Fuel[m^3/s]]', ...
    'Style','text', ...
    'Tag','StaticText3');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[57.75 162 58.5 24], ...
    'String','Mass Flow Rate Fuel [kg^3/s]', ...
    'Style','text', ...
    'Tag','StaticText2');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[90 410.25 56.25 18.75], ...
    'String','Injector', ...
    'Style','text', ...
    'Tag','StaticText1');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[498.75 413.25 56.25 18.75], ...
    'String','Fuel', ...
    'Style','text', ...
    'Tag','StaticText1');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[624.75 413.25 56.25 18.75], ...
    'String','Oxidizer', ...
    'Style','text', ...
    'Tag','StaticText1', ...
    'UserData','[ ]');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'ButtonDownFcn','  ', ...
    'Position',[29.25 330 177 66.75], ...
    'String',mat1, ...
    'Style','listbox', ...
    'Tag','Listbox1', ...
    'Value',1);
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'Position',[473.25 331.5 111 66.75], ...
    'String',mat2, ...
    'Style','listbox', ...
    'Tag','Listbox4', ...
    'Value',1);
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'Position',[599.25 331.5 111 66.75], ...
    'String',mat3, ...
    'Style','listbox', ...
    'Tag','Listbox5', ...
    'Value',1);
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'Position',[219.75 332.25 45.75 66.75], ...
    'String',mat4, ...
    'Style','listbox', ...
    'Tag','Listbox2', ...
    'UserData','[ ]', ...
    'Value',5);
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[214.5 411 56.25 34.5], ...
    'String','Fuel Tube Diameter [mm]', ...
    'Style','text', ...
    'Tag','StaticText1');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[-182.25 175.5 66.75 30.75], ...
    'Tag','Pushbutton1');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'Callback','InjectorTest clear', ...
    'ListboxTop',0, ...
    'Position',[554.25 21 66.75 30.75], ...
    'String','Clear', ...
    'Tag','Pushbutton1');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'Callback','close(gcf)', ...
    'ListboxTop',0, ...
    'Position',[651 21.75 66.75 30.75], ...
    'String','Close', ...
    'Tag','Pushbutton1');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'Callback','InjectorTest run', ...
    'ListboxTop',0, ...
    'Position',[457.5 21.75 66.75 30.75], ...
    'String','Run', ...
    'Tag','Pushbutton1');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[234.75 162 58.5 34.5], ...
    'String','Fuel Velocity at Injector Face [m/s]', ...
    'Style','text', ...
    'Tag','StaticText2');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[519 126 58.5 24], ...
    'String','Stream Direction Angle (del)', ...
    'Style','text', ...
    'Tag','StreamDirection');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'ListboxTop',0, ...
    'Position',[228 117 72.75 28.5], ...
    'String','4.1105', ...
    'Style','edit', ...
    'Tag','vf');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'ListboxTop',0, ...
    'Position',[511.5 87 72.75 28.5], ...
    'String','0.72', ...
    'Style','edit', ...
    'Tag','TanDel', ...
    'UserData','[ ]');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[245.25 286.5 56.25 35.25], ...
    'String','Angle of Fuel Impingement [Degree]', ...
    'Style','text', ...
    'Tag','StaticText1');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'Callback','               ', ...
    'ListboxTop',12, ...
    'Position',[219 214.5 111 66.75], ...
    'String',mat5, ...
    'Style','listbox', ...
    'Tag','Listbox6', ...
    'UserData','[ ]', ...
    'Value',13);
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'ListboxTop',0, ...
    'Position',[602.25 87 72.75 28.5], ...
    'String','3.63', ...
    'Style','edit', ...
    'Tag','Ratio');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'ListboxTop',0, ...
    'Position',[228.75 24 72.75 28.5], ...
    'String','2.2875', ...
    'Style','edit', ...
    'Tag','vo');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[609.75 126 58.5 24], ...
    'String','Mixture Ratio', ...
    'Style','text', ...
    'Tag','StaticText2');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[235.5 69 58.5 36], ...
    'String','Oxidizer Velocity at Injector Face [m/s]', ...
    'Style','text', ...
    'Tag','StaticText2');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[58.5 69 58.5 38.25], ...
    'String','Mass Flow Rate Oxidizer [kg^3/s]', ...
    'Style','text', ...
    'Tag','StaticText2');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[147 69 58.5 39], ...
    'String','Vloume Flow Rate Oxidizer[m^3/s]', ...
    'Style','text', ...
    'Tag','StaticText4');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'ListboxTop',0, ...
    'Position',[48 24.75 74.25 26.25], ...
    'String','0.406209438', ...
    'Style','edit', ...
    'Tag','mdoto', ...
    'UserData','[ ]');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'ListboxTop',0, ...
    'Position',[139.5 24 72.75 28.5], ...
    'String','0.000294355', ...
    'Style','edit', ...
    'Tag','qo');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'Callback','                                  ', ...
    'ListboxTop',12, ...
    'Position',[348 215.25 111 66.75], ...
    'String',mat6, ...
    'Style','listbox', ...
    'Tag','Listbox7', ...
    'UserData','[ ]', ...
    'Value',13);
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[375 287.25 56.25 38.25], ...
    'String','Angle of Oxidizer Impingement [Degree]', ...
    'Style','text', ...
    'Tag','StaticText1');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'Callback',' ', ...
    'ListboxTop',0, ...
    'Position',[318 116.25 72.75 28.5], ...
    'String','  100', ...
    'Style','edit', ...
    'Tag','DePrFu', ...
    'UserData','[ ]');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[325.5 161.25 58.5 24], ...
    'String','Propellant Pressure Drop', ...
    'Style','text', ...
    'Tag','PrDrFu');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[87.75 291 58.5 24], ...
    'String','Discharge Coefficient', ...
    'Style','text', ...
    'Tag','DiCo');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'Callback',' ', ...
    'ListboxTop',0, ...
    'Position',[81 246 72.75 28.5], ...
    'String','0.61', ...
    'Style','edit', ...
    'Tag','DisCo', ...
    'UserData','[ ]');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.807843137254902 0.807843137254902 0.807843137254902], ...
    'ListboxTop',0, ...
    'Position',[23.25 222.75 187.5 15.75], ...
    'String','Note: Cd=0 means no data. Please, wait updating.', ...
    'Style','text', ...
    'Tag','Warning Meg');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[290.25 411.75 56.25 30], ...
    'String','Oxidizer Tube Diameter [mm]', ...
    'Style','text', ...
    'Tag','StaticText1');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'Position',[295.5 333 45.75 66.75], ...
    'String',mat7, ...
    'Style','listbox', ...
    'Tag','Listbox8', ...
    'UserData','[ ]', ...
    'Value',6);
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'Position',[358.5 333 45 95.25], ...
    'String',mat8, ...
    'Style','listbox', ...
    'Tag','Listbox3', ...
    'Value',1);
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'Position',[411.75 332.25 45 95.25], ...
    'String',mat9, ...
    'Style','listbox', ...
    'Tag','ListboxOL', ...
    'Value',1);
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'ListboxTop',0, ...
    'Position',[498.75 264.75 59.25 25.5], ...
    'String','19', ...
    'Style','edit', ...
    'Tag','FuVeTu');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'ListboxTop',0, ...
    'Position',[621.75 264.75 59.25 25.5], ...
    'String','15', ...
    'Style','edit', ...
    'Tag','OxVeTu');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[505.5 297 45.75 28.5], ...
    'String','Fuel Velocity', ...
    'Style','text', ...
    'Tag','StaticText5');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'ListboxTop',0, ...
    'Position',[628.5 298.5 45.75 24], ...
    'String','Oxidizer Velocity', ...
    'Style','text', ...
    'Tag','StaticText5');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'ListboxTop',0, ...
    'Position',[413.25 439.125 45.75 24.75], ...
    'String','Oxidizer Tube Length', ...
    'Style','text', ...
    'Tag','StaticText5');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[357.75 438.75 45.75 25.5], ...
    'String','Fuel Tube Length', ...
    'Style','text', ...
    'Tag','StaticText5');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'ListboxTop',0, ...
    'Position',[318.75 25.5 69.75 26.25], ...
    'Style','edit', ...
    'Tag','DePrOx');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[333 60 45 42], ...
    'String','Oxidizer Pressure Drop', ...
    'Style','text', ...
    'Tag','StaticText6');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[0.87843137254902 0.874509803921569 0.8901960784313731], ...
    'ListboxTop',0, ...
    'Position',[615.75 223.5 81.75 23.25], ...
    'String','Friction Loss Coefficient', ...
    'Style','text', ...
    'Tag','StaticText7');
h1 = uicontrol('Parent',h0, ...
    'Units','points', ...
    'BackgroundColor',[1 1 1], ...
    'ListboxTop',0, ...
    'Position',[622.5 185.25 67.5 27.75], ...
    'String','0.2', ...
    'Style','edit', ...
    'Tag','FrLoCo');
if nargout > 0, fig = h0; end

(2-3) InjectorDeCd

(2-4) InjectorDia


(2-5) InjectorEle


(2-6) Injectorisd


(2-7) InjectorPu


function InjectorPu(action)

switch action
  
case 'clear'
   ceHanl=findobj(gcbf,'Tag','celsiustext');
   faHanl=findobj(gcbf,'Tag','fahrenheittext');
   ceString=get(ceHanl,'String');
   faString=get(faHanl,'String');
   clear(faString)
   clear(ceString)
  
case 'run'
   InjectorCD
   Display(m_dot_o,m_dot_f,Q_o,Q_f,v_o,v_f,r,tandel);
  
end

function Display(m_dot_o,m_dot_f,Q_o,Q_f,v_o,v_f,r,tandel)

Dismdoto(m_dot_o);
Dismdotf(m_dot_f);
DisQo(Q_o);
DisQf(Q_f);
Disvo(v_o);
Disvf(v_f);
Disr(r);
Distandel(tandel);

function Dismdoto(m_dot_o)
MdotoHanl=findobj(gcbf,'Tag','');
set(MdotoHanl,'String',sprintf('%5.2f',m_dot_o);

function Dismdotf(m_dot_f)
MdotfHanl=findobj(gcbf,'Tag','');
set(MdotfHanl,'String',sprintf('%5.2f',m_dot_f);

function DisQo(Q_o)
QoHandl=findobj(gcbf,'Tag','');
set(QoHandl,'String',sprintf('%4.2f',Q_o);

function DisQf(Q_f)
QfHandl=findobj(gcbf,'Tag','');
set(QfHandl,'String',sprintf('%4.2f',Q_f);

function Disvo(v_o)
VoHandl=findobj(gcbf,'Tag','');
set(VoHandl,'String',sprintf('%4.2f',v_o);

function Disvf(v_f)
VfHandl=findobj(gcbf,'Tag','');
set(VfHandl,'String',sprintf('%4.2f',v_f);

function Disr(r)
RHandl=findobj(gcbf,'Tag','');
set(RHandl,'String',sprintf('%0.2f',r);

function Distandel(tandel)
TandelHanl=findobj(gcbf,'Tag','');
set(TandelHanl,'String',sprintf('%2.2f',tandel);