Shock Interaction & Supersonic Inlet: Group Blackcird
Shock Interaction & Supersonic Inlet: Group Blackcird
INLET
TEACHING MODULES
GROUP BLACKCIRD
Overview......................................................................................................... 3
1.0 Introduction
Have you ever wondered what is that cone shape thing that form on the body of a supersonic aircraft as
shown in the Figure 1.1? If you are so lucky to see this phenomenon before, you already knew what shock
wave looks like. Shock waves are formed when an aircraft reached the speed of sound and drastic changes
of the properties of air that flow through it [1].
There are so many types of shock wave such as normal shock wave, oblique shock wave and curved shock
wave. Each shock wave has different effect on the airflow and their interaction will be another case to
study. The study of oblique shock waves is actually a useful tool that can be applied to solve real-life
problems. For example, there is a constraint for an aircraft to fly at supersonic speed as its turbojet engine
compressors are unable to handle supersonic air flow [2]. In order to solve this problem, normal shock
waves are introduced at the inlets of engines to bring the supersonic air flow to subsonic.
The application of shock wave can once again be seen in the Lockheed SR-71 Blackbird, which is a
supersonic aircraft capable of cruising at speeds in excess of Mach 3.2. This aircraft has applied a design
on its engine to make use of the shock wave in helping the aircraft to increase the total pressure recovery
[3]. In aerospace industries, everything had to be extremely precise and accurate, especially in the design
and calculation results. Since it is time consuming and inaccurate for a designer to do manual calculation,
computational analysis would be a better approach in this case.
Computational analysis such as MATLAB provides an accurate result for users, but it also requires a user
to be competent in his or her coding and programming skill so that he or she is able to develop the program.
Since it is strenuous for a user who has no experience in programming language to use MATLAB and
learn the programming languages, the most effective way is to use a user-friendly program, that is the
Graphical User Interface (GUI).
3
2.0 Graphical User Interface (GUI)
First of all, what is GUI? It is abbreviation of Graphical User Interface which is an interface that allows
users to interact or communicate with electronic devices by using icons or any other indicators [4]. It also
prevents users from learning a programming language or type commands in order to run the applications
[5].
As mentioned in Introduction section, GUI makes our life more convenient in the way of proceeding
complicate calculation. Basically, it can do more than that. Besides of simpler and easier to be used, GUI
provides better visualisation effect compared to those tedious and complicate programs. Furthermore, it
has higher reliability as it provides higher accuracy solution compared to manual calculation which having
higher risk of making errors. For instance, oblique shock problems involve monotonous calculation if the
calculation is done manually. Manual calculations consume users’ time and causing higher possibility to
make errors. Therefore, by using GUI, users can solve problems in shorter time and therefore having
higher efficiency.
After knowing the benefits of developing GUI, it’s time for us to learn the way to develop it. Before that,
as this module is written for readers to discover MATLAB GUI based on real-life problem and shock
waves interaction problem. It is important for readers to know the basic steps of develop MATLAB GUI
to solve these two problems. These basic steps are drawing flowchart, writing MATLAB program and
finally build MATLAB GUI. In following sections, these steps will be explained in detail.
2.1 Flowchart
2.1.1 Introduction of Flowchart
Flowchart is a chart diagram that consist of a set of standard symbols to represent the sequence of coding
for instructions that able to feed into the computer. Flow chart is the fundamental step to write a program
no matter in Linux based programming, JavaScript, C & C++ based programming, Python.
Algorithm is a procedure for solving problems by writing a logical step-by-step method. An algorithm
includes calculations, reasoning and data processing. The main purpose of a flowchart is to analyze
different processes [6]. These symbols of coding able to perform specific logical and arithmetic operations
[7]. Flow chart also helps users or programmers to visualize the steps in a system includes loops, input,
output [8].
4
Figure 2.1: Example of a Basic Flow Chart
Start Symbol
It is an event symbol signals the first
step of a process. It is representing a
start point
Process Symbol
Decision Symbol
5
End Symbol
It is an event symbol stands for the
result of a process that have been
done.
- It is representing an end point.
Table 2.1 presenting the four basic symbols for a program flow chart. There are other symbols is required
to perform a more complex resolving or calculation depending on the requirement of programmers as
shown in table 2.2 [9].
Table 2.2: Symbols Other Than Basic Symbols that can be Used in Flow Chart Plotting [9]
Symbol Description
Flow Line
Used to indicate the flow of the logic by
connecting the symbols together in sequence
Input/Output
Used for input and output operation for data input
and result output.
On-page Connector
Used to join different flowline from different
processes in the same page
Off-page Connector
Used to connect flowchart portion to different page
of flow chart.
Predefined Process/Function
Used to represent a group of statements
performing one processing task
6
2.1.3 Assignment Symbols of Flowchart
The assignment symbol is used to assign or operate the value to the given variable. There are several groups
of operators can be used to giving the statement for programming.
i. Mathematical Operators
In our case, the operator of ‘-’ and ‘x’ are used for the statement of calculation.
In our case, the operator of ‘<’ is used for the statement of ‘Error’ and then making decision.
7
Figure 2.3: Relational Operator used in Flowchart.
In our case, the operator WHILE loop is used until the final output is fulfilling the given statement.
8
2.1.4 Flow Chart Planning
Programming is the process of taking an algorithm and encoding the it into a notation to make computer
to execute the programming language. Before writing a program, the programmer needs to construct a
procedure for solving the problem. The program that written without proper pre-planning such as flow
chart plotting may have high chances of errors. Also flow chart enable the programmer to debug their
coding when encountering problem.
There are some knowledges need to be known by the beginners before construct the programming to
resolve problem [10].
Sequence
The structure of coding sequence is important to construct a programming. All the statements are
placed one after the other and the execution takes place starting from up to down.
Branching (Selection)
A condition of making decision of either TRUE or FALSE. ‘IF-ELSE’ is used to represent the
branch control.
Loop (Repetition)
The loop or repetition allow a statement to be executed repeatedly based on the loop condition
such as WHILE, FOR loops. The statements will end it process while it is fulfilling the loop
condition that defined before hands.
After the programmer understand the procedure of construct a programming, next step will be the writing
algorithm to resolve the problem:
Step 1
The algorithm input such as formula of calculation is defined by programmer before process in
calculation. In our case, for example, the calculation of Mach number across the normal shock of
given Mach number is defined and calculated.
Step 2
The variables of algorithm need to be defined. In our case, the specific heat ratio (), initial Mach
number (M1) and initial Pressure (P1) are defined for opposed wedges problem.
Step 3
Outline the operations of algorithm. This step is processing the input variable and store the value
in new variable. In our case, the maximum value of 2 and 3 is calculated and displayed before
proceeding to next process.
9
2.1.5 Example of Flowchart
For the GUI development of this project, the coding is first done in the MATLAB program before transfer
to the GUI program. Although there is a way to directly write and edit the code in the GUI program, it is
still advisable for a new GUI developer to first develop the code in MATLAB program. There are some
differences in the way a syntax is write inside the input of the MATLAB program and GUI program. Since
the calculation of shock wave interaction involves many steps and complex calculation, there are high
possibility for an error to occur. Hence the use of MATLAB syntax would be a more familiar syntax for
new GUI user in the process of identification of the bug and debug.
2.
4. An example of new GUI created is shown in Figure 2.8. The point at the right bottom can be dragged
to resize the dimension of the interface. The panel at the left is the component palette, where each
component is labelled in Figure 2.9.
11
Select
Axes Panel
5. To edit the properties of a component, the component icon is double-clicked, and the property inspector
as shown in Figure 2.10 will pop out. Here, the basic properties of the component such as string, font
size, colour and so on, can be edited. Note that the tag of the component under the identifiers is
important as it is associated with the syntax in the editor.
12
2.2.2 Axes
“Axes” in the component palette can be used to display plots, charts or images in the user interface. In
our project, “Axes” are used to display images.
The tag of the “Axes” is identified in its property inspector, or it can be modified according to own
desire as long as it is same in the syntax used in editor later.
1. Figure 2.13 shows an example of syntax that used to display a JPG image named “shock-
interaction.jpg” through an “Axes” component with the tag “axes1”.
13
Figure 2.13: Syntax used to insert image into Axes.
“Static Text” components can be used to display texts or variable outputs, while “Edit Text” can be used
to let users input strings or to display outputs. The strings displayed by the “Static Text” cannot be edited
by the users, but users can edit in the “Edit Text” components. As mentioned above, the tag of the
component will decide its function according to the syntax in editor.
14
Figure 2.15: Properties inspector of Edit Text.
Generally, “Push Button” is used to execute the commands typed in the syntax. Clicking “Push Button”
in interface will execute the decided function.
1. To decide the function of a “Push Button” component, relevant syntax need to be typed under its
callback function. To locate the callback function in editor, the “Push Button” component in GUIDE
is right-clicked and “View Callbacks > Callback” is chosen.
Figure 2.17: Example syntax used to determine the function of a Push Button.
3. As a result, the calculated value will be displayed in the “Edit Text” component with the tag
“delta_max23” after the push button is clicked, providing values are input in the components with tags
“M1”, “P1” and “y” by the user.
2.2.5 Panel
Panels and button groups are containers that arrange components into groups.
1. For instance, in Figure 2.19, there are four “Static Text” components in Panel 3 which are the
instructions given to users, M1, P1 and γ, and there is one “Push Button” component with the string
“Next”. When Panel 3 is moved, all the components within the panel will move together.
16
Figure 2.19: Panels shown on interface.
“Pop-up Menu” which is also known as drop-down menu, provides options to be selected by users.
17
Figure 2.21: Property inspector of Pop-up Menu.
1. Options to be displayed in the “Pop-up Menu” component is specified by setting the String property
to the desired items. The “String” window will pop out after the icon indicated by the red box in
Figure 2.21 is clicked.
2. The options can be typed in the pop-up “String” window as shown in Figure 2.22.
3. Under the callback function of “Pop-up Menu”, the visibilities of panels for each problem can be set.
By setting type of problem with different digits, condition can be set.
18
Figure 2.23: Syntax typed to change the visibilities of panels for each problem.
4. Based on Figure 2.23, if 1 (opposed wedges problem) is selected, the visibilities of the panels for
opposed wedges problem will be set as “ON” while the visibilities of the panels for real-life problem
will be set as “OFF” . If 2 (real-life problem) is selected, the visibilities of the panels for opposed
wedges problem will be set as “OFF” while the visibilities of the panels for real-life problem will be
set as “ON”.
19
Figure 2.24: Name of tag of each panel for shock interaction problem.
5. Figure 2.24 visualises the interface that is shown to users when “Opposed Wedges Problem” is
selected, while Figure 2.25 visualises the interface when “Real Life Problem” is selected.
20
3.0 Applications
This section will cover the application of MATLAB GUI on two examples and one real life example,
which both related to oblique shock. After covering this section, the reader will understand the importance
and the beauty of MATLAB GUI in solving the oblique shock problems. Two examples are referred from
example 6.18 and example 6.20, from the book of compressible fluid flow, written by Patrick H. Oosthuizen
and William E. Carscallen [11]. The real-life example is designed according to the journal published by
Hongjun Ran and Dimitri Mavris, entitled “Preliminary Design of a 2D Supersonic Inlet to Maximize Total
Pressure Recovery” [12].
Before applying MATLAB GUI to solve for oblique shock problem, the fundamental understandings
towards an oblique shock, specifically oblique shock interaction must be strong and crystal clear. The
theory behind will be illustrated together with the given examples. Generally, to solve any problem, the
questions must be understood, strategized and then finally solved.
3.1.1 Understanding
The upstream flow in the tunnel is a supersonic flow and it forms an oblique shock due to the deflections
of walls (upper and lower wall) towards the flow. Across the oblique shock, the flow is still supersonic, but
the pressure of the downstream flow will increase. The direction of downstream flow, behind the oblique
shock will be parallel to the wall. Note that the oblique shock created due to the deflection of upper wall
and lower wall will interact or intersect and then reflected as shown in Figure 3.1. Hence, the upstream
flow passes two oblique shocks either from region 1 to 2 to 4, or 1 to 3 to 4. In this case, there is a slipline
produced between the region 4a and 4b shown in Figure 3.2. The velocity, density and entropy between
these two regions are not the same but the pressure and direction of the flow above and below the slipline
must be the same.
21
Figure 3.2: Interaction of oblique shock waves.
3.1.2 Strategy
Region 1 to 2:
1. With given value of M1 and δ12, β12 can be found using oblique shock chart.
2. 𝑀𝑁1 = 𝑀1 sin 𝛽12
3. Find 𝑀𝑁2 by using normal shock table based on value of 𝑀𝑁1 (as 𝑁1 is normal to shock wave
in region 1-2)
4. 𝑀𝑁2 = 𝑀2 sin(𝛽12 − δ12 ). 𝑀2 can be obtained.
𝑃
5. Find 𝑃2 by using normal shock table.
1
22
Region 1 to 3:
respectively.
9. Find the value of P42 and P43.
10. Iterate the calculation until P42 = P43
3.1.3 Results
Iteration procedure is needed to be proceeded by guessing the slipline again if P42 is not equals to P43 . It is
repeated until the P42 = P43 , which indicates the correct slipline angle. This iteration process is tedious and
require a large amount of time. Therefore, MATLAB GUI introduced to increase the efficiency when
solving this oblique shock interaction problem. Figure 3.6 shows the application of MATLAB GUI in
solving example 6.18, which is developed for solving opposite wedge problem. The pressure of the
downstream flow at region 4 can be found directly by simply entering the input variable of Mach no,
pressure of upstream flow at region 1, specific heat ratio and the turning angle for upper and lower wall.
Figure 3.6: MATLAB GUI for opposite wedge problem (example 6.18)
24
Table 3.1: Comparison of pressure downstream and slipline angle between MATLAB GUI and manual calculation
for example 6.18
Percentage error
Region 4 MATLAB GUI Manual calculation
(%)
Pressure
133.5 134.4 0.67
downstream (kPa)
Slipline angle (°) 3.98 3.9 2.01
Based on Table 3.1, it is observed that the exact slipline angle that calculated manually varies from
MATLAB GUI. This leads to a deviation in pressure of the downstream flow. The results from MATLAB
GUI is more reliable as there is limitation in manual calculation, i.e. when obtaining the shock angle from
oblique shock chart. This in turns justified that MATLAB GUI has higher accuracy of results compared
to manual calculation.
Figure 3.7: MATLAB GUI for opposite wedge problem (example 6.20)
25
Table 3.2: Comparison of Mach no, pressure downstream and slipline angle between MATLAB GUI and manual
calculation for example 6.20
Region 4 MATLAB GUI Manual Calculation Percentage error (%)
Mach no 1.649 1.637 0.73
Pressure downstream
523 526 0.57
(kPa)
Slipline angle (°) 5.82 5.8 0.34
As a summary for Example 6.18 and 6.20, both require iteration process to obtain the pressure of the
downstream flow due to intersection of shock waves. Henceforth, the calculation steps become lengthy
and time consuming. Besides, the accuracy of the results is reduced. However, with the development of
MATLAB GUI, all these problems can be easily solved.
26
3.3.1 Strategy
Region 1 to 2:
1. Given 𝑀0 & δ1 , find β1 from oblique shock chart.
2. Using the equation 𝑀𝑁𝑜 = 𝑀𝑜 sin β1 , find 𝑀𝑁𝑜 .
𝑃01
3. From the normal shock table, 𝑀𝑁1 and can be obtained.
𝑃0
4. 𝑀1 can be obtained from 𝑀𝑁1 = 𝑀1 sin(β-δ).
Region 2 to 3:
• Across the second oblique shock:
𝑃
• 𝑀2 and 𝑃02 can be found using the same approach as region 1 to 2.
01
Region 3 to 4:
• Across the normal shock:
𝑃03
• Using the value 𝑀2 calculated from region 3 to 4, find 𝑀3 and from normal shock table.
𝑃02
27
Region 4 to 5:
• Across the normal shock:
𝑃
• Using the value 𝑀3 calculated from region 3 to 4, find 𝑀4 and 𝑃04 from normal shock table.
03
3.3.2 Results
Table 3.3 above justified that higher number of oblique shock waves result in greater total pressure recovery
for a supersonic inlet. The total pressure recovery in terms of percentage are shown higher in design 2
(94.2%) compared to design 1 (85.9%).
Nevertheless, if the number of oblique shocks is increased, the flow becomes more complex and less
satisfactory because of the boundary layer and the interaction between the boundary layer and the shocks.
The other drawback is the inlet length will increase with an increase in the number of oblique shocks and
hence increase in inlet length [12].
Now, MATLAB GUI for this type of problem is developed and utilized to calculate the total pressure
recovery. Figure 3.10 show the developed MATLAB GUI to tackle the given real-life problem.
28
The results obtained from MATLAB GUI are compared with the results that calculated manually and
shown in Table 3.4.
Table 3.4: Comparison of total pressure recovery in terms of percentage between MATLAB GUI and manual
calculations
Supersonic inlet MATLAB GUI (%) Manual Calculations Percentage
(%) difference (%)
Design 1 87.3 85.9 1.60
Design 2 94.9 94.2 0.74
4.0 Summary
According to comparison of calculated results between manual calculation and MATLAB GUI, we can
notice that MATLAB GUI gives results with higher precision. In engineering world, accuracy and
precision play a crucial role. Inaccuracy can cause undesirable situation to occur such as aircraft failure,
machine failure and destruction of building. Once again, importance of developing a GUI is manifested.
After going through this module, readers can be considered as a beginner of MATLAB GUI developer. In
fact, there are other programming languages such as Java, C++ and Python which can be used to build
GUI. Exposure to building GUI through MATLAB makes developers familiar with the process and hence
understanding of other GUI developing programming languages can be faster. In addition, GUI is used in
a myriad of applications such as smartphones, gaming devices, industrial controls and computers.
Therefore, a competent GUI developer can apply his or her GUI developing skill on these fields and stands
a higher chance to be employed compared to those who has no experience on it.
There are some recommendations for readers. Firstly, interchange of interfaces for real-life problem and
shock waves interaction problem in this module is through changing the visibility of each panels. The
panels for each problem should be grouped together in order to make changing of visibility of panels more
convenient. Besides that, a main menu window which provide choices between two problems can be
created for a better display.
29
5.0 References
[1] Shock Waves. (n.d.). Retrieved from https://howthingsfly.si.edu/aerodynamics/shock-waves
[2] Tedeschi, D. (2002, November). How Things Work: Supersonic Inlets. Retrieved from
https://www.airspacemag.com/military-aviation/how-things-work-supersonic-inlets-
35428453/?page=1
[3] Anderson, T. (2014). SR-71 Inlet Design Issues And Solutions. Retrieved from
https://www.enginehistory.org/members/Convention/2014/Presentations/SR-71InletDesign.pdf
[4] What is a GUI (Graphical User Interface)? (2018, November 13). Retrieved from Computer Hope:
https://www.computerhope.com/jargon/g/gui.htm
[5] MATLAB GUI - MATLAB & Simulink. (n.d.). Retrieved from MathWorks:
https://www.mathworks.com/discovery/matlab-gui.html
[6] Explain Algorithm and Flowchart with examples. Retrieved from https://www.edrawsoft.com/explain-
algorithm-flowchart.php
[8] Flowchart Programming. Visualise your program or algorithm as a flowchart before you write code. Retrieved
from https://www.smartdraw.com/flowchart/flowchart-programming.htm
[10] Ravi K. Walia. Assistant Professor & Incharge Computer & Instrumentation Centre Dr. Y. S. Parmar
University of Horticulture & Foresty, Nauni Solan INDIA (HP). Algorithm & Flowchart Manual for
Students. Retrieved from http://www.yspuniversity.ac.in/cic/algorithm-manual.pdf
[11] Patrick H. Oosthuizen, William E. Carscallen. (1997). Compressible Fluid Flow. New York, NY:
McGraw-Hill.
[12] Hongjun Ran, Dimitri Mavris. (2005). Preliminary Design of a 2D Supersonic Inlet to Maximize
Total Pressure Recovery. Retrieved from
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.559.484&rep=rep1&type=pdf
30