Week 7 - Simulation of a 1D Supersonic nozzle flow simulation using Macormack Method
- To simulate the isentropic flow through a Quasi 1D subsonic-supersonic nozzle.
- Derive both the conservation and non-conservation forms of the governing equations and solve them using MacCormack’s technique.
- To determine the steady-state temperature distribution for the flow-field variables and investigate the difference between the two forms of governing equations by comparing their solutions.
- To show the following plots inside the report
- Stead-state distribution of primitive variables.
- Time-wise variation of primitive variables.
- Variation of mass flow rate distribution inside the nozzle at different time steps during the time-marching process.
- Comparison of normalized mass flow rate distributions of both forms.
Highlights:
- Perform a grid independence test on the solution and explain all your findings.
- The code must be modular. Write separate functions to solve both forms.
- Discuss all the plots that will be provided with observed inferences.
SOLUTION
Considerations

- Consider a steady, isentropic flow through the Convergent- Divergent nozzle as shown in the figure above.
- The flow at the inlet of the nozzle comes from a reservoir where pressure and temperature are denoted by Po and To. These are stagnation values.
- At the throat, sonic values of pressure and temperature are denoted by P* and T* respectively.
- The area at the sonic throat is denoted as A*.
- In the subsonic inlet, it is assumed that the cross-sectional area of the reservoir is large so the velocity is considered very small.
- In the divergent nozzle, the flow expands isentropically to supersonic speed at the exit.
- At the supersonic outlet, the exit pressure, temperature, velocity, and Mach number are denoted by Pe, Te, Ve, and Me
- Force exerted on the gas to accelerate through the nozzle depends on the pressure ratio. Pressure ratio = P0/Pe
- It is assumed that the flow is Quasi 1D flow. This means that the flow properties will vary primarily along one direction i.e. x-direction only.
MacCormack Technique
It is an explicit finite difference technique which is second-order accurate in both space and time. The solution is obtained through three steps:
- Predictor Step
Forward differencing schemes are used for spatial derivatives, and calculate the solution gradient following which we obtain an intermediate solution (with initial conditions and calculated solution gradient)
- Corrector Step
Backward differencing schemes are used for spatial derivatives, and calculate the solution gradient following which we obtain a corrected solution (predicted values and solution gradient)
- Final Solution
The average for the two solution gradients (the predictor as well as corrector) is taken and from the initial state, the averaged solution gradient is added to obtain the final solution.
Setup
- The governing equations are to be couched in terms of partial differential equations suitable for the time-marching solution of quasi-one-dimensional flow.
- The finite-difference expressions pertaining to MacCormack’s technique as applied to be set up.
- Other details for numerical solutions such as the calculation of the time step and the treatment of boundary conditions are to be formulated.
Conservation
Conservation form refers to an arrangement of an equation or system of equations, usually representing a hyperbolic system, which emphasizes that a property represented is conserved.
EULERIAN APPROACH →→ CONSERVATIVE FORM
The eulerian approach refers to a fixed coordinate system in space and time and the particles are studied with respect to this fixed system.
When the fundamental principles are derived using this approach we get a conservative form.
Non Conservation form
LAGRANGIAN APPROACH →→ NON-CONSERVATIVE FORM
In the Lagrangian approach, the fluid particles are followed as they travel through the flow. Fundamental principles derived from this approach non-conservation form of equations are obtained.
Governing flow equations
- Non-dimensional variables
For nozzle flows, the flow field variables are frequently expressed in terms of nondimensional variables. The non-dimensional variables vary between 0 and 1, which is an aesthetic advantage when presenting the results.
Non-dimensional temperature and density

Let L denote the length of the nozzle
Dimensionless length

Speed of sound in the reservoir ao, where 
Dimensionless velocity

Dimensionless time

Dimensionless area


Main code

