Converging-Diverging Nozzle Pressure Delineations

In this post, I will be explaining (and providing) some code that I use to find the pressure ratio delineations for converging-diverging (CD) nozzles.  If you are new to the subject of CD nozzles, it would be helpful to check out this video that I have made regarding CD nozzle operating states.  The math behind this blog post can be found in this video.  You can download the code used in the example by clicking on the download form below.  You will also need to download the ISENTROPIC_FLOW and NORMAL_SHOCK functions listed below, or you can get them from my GitHub repository.

CD_Nozzle_Delineations.m
CD_Nozzle_Delineations.m
ISENTROPIC_FLOW.m
ISENTROPIC_FLOW.m
NORMAL_SHOCK.m
NORMAL_SHOCK.m

For this example, we will be assuming a nozzle area ratio of 3 (A_e/A_t = 3) and a specific heat ratio of 1.4 (\gamma = 1.4).  In the subsequent equations, there are lots of terms that include \gamma, and the location of parentheses can be sort of confusing.  What I like to do is to define some of those convenient parameters before we move on in the program.  In the code below, you can see where we define A_e/A_t and \gamma, and below that, the convenient parameters.

% Knowns
Ae_At = 3;
g     = 1.4;

% Convenient parameters
gm1   = g-1;
gp1   = g+1;
gogm1 = g/gm1;
gm1o2 = gm1/2;
gogp1 = g/gp1;

Continue reading Converging-Diverging Nozzle Pressure Delineations