Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C PROGAMMING QUESTION: Introduction - Critical Area & Mach Number In this assign

ID: 3685204 • Letter: C

Question

C PROGAMMING QUESTION:

Introduction - Critical Area & Mach Number
In this assignment you will be tasked to find the Mach Numbers related to a given critical area
ratio. The critical area ratio is a given area A over the critical area A* for any given flow. A* is the
minimum area in which Mach 1 is achieved with maximum mass flow rate dm/dt in [kg/s]. This
characteristic A* combined with the Temperature and Pressure constants at flow stagnation is
what gives rise to the critical area ratio versus Mach number function.
The function is given as follows:

A/A* = (1/M)[(2/(gamma +1))*(1+ ((gamma-1)M2)/2)](gamma+1)/(2(gamma-1))

A is cross sectional area of flow
A* is critical area for Mach 1 and maximum mass flow rate M is Mach number
is the specific heat ratio Cp/Cv for air, nominally = 1.4
The area ratio function is a very important function as it relates the change in area for a given
shaped nozzle with the properties of an ideal isentropic air flow. It allows the aerodynamicist to
determine the given Mach number of a compressible fluid flow as it passes through a
converging/diverging nozzle. This relation only works for a nozzle with gently changing cross
sectional area in order for flow to be considered isentropic. Thus, with known geometrical units,
we can determine the speed of flow at any point. Unfortunately, since the function is a higher
order function it is hard to analytically find the M roots associated with a given ratio. This is where
we apply root finding numerical methods to solve for M. An interesting aspect of the function is
that for a given ratio, you will find two Mach numbers which are respectively subsonic and
supersonic states for the flow. This means that the flow has two choices, either to stay subsonic
while passing the throat or pursue supersonic state. This is beyond the scope of this exercise but,
to give you an idea, the M-state is a property of pressure gradient. The pressure gradient
determines the transition and it depends on pressure ratio P*/Po=0.5283. This means for
subsonic to supersonic transition, P* must be about half of Po.
Tasks:
- In order to better understand the function. You are first to output the values of A/A* in
a chart with Mach numbers ranging from 0.01 to 6.5. This can be done using a
spreadsheet charting function that is available in spreadsheet applications such as Excel
- You then need to create a root finding algorithm which will determine the associated
Mach numbers related to a user given A/A* ratio.
[hint] The graph helps you compare your root findings with the actual curve to see if it
makes sense. The derivative of A/A* is zero at M=1 ***

The output should look like this:
A/A*= …
Msubsonic=…
Msupersonic=…

Requirements
The programs must be written in C
Use meaningful variable names
Comment and indent your code. It is your responsibility to make it readable to the
grader.

Explanation / Answer


table

//#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
//#include <string.h>
// #include <conio.h>
// aim: find the Mach number for a critical area
// input: critical area
// output: Mach number
// formula: Mach number = object speed / sound speed
// transonic speed happends before the sound speed
// Subsonic Mach is less than unity < 1
// Transonic mach is just equal to unity = 1
// Supersonic Mach is greater than unity > 1
// Hyper sonic mach = the fastest = above the value of 4.99
//

void findMach()   {
printf(" A / A * values from the excel spread sheet=");
printf(" Mach SubSonic = ");
printf(" Mach SuperSonic = ");


}

int main()
{

findMach();

return 0; // exit
} // end of main()

Mach M Mach Numbers Area A A* Pt Total Pressure Total Temperature Tt Gas Constant R Specific Heat Ratio Gamma 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2