Week 7 - Simulation of a 1D Super-sonic nozzle flow simulation using Macormack Method
Aim:
To simulate the isentropic flow through a quasi 1D subsonic-supersonic nozzle & solve the conservation and non-conservation forms of the governing equations using the MacCormack's technique.
To plot the following graphs
1. Steady-state distribution of primitive variables inside the nozzle
2. Time-wise variation of the primitive variables
3. Variation of Mass flow rate distribution inside the nozzle at different time steps during the time-marching process
4. Comparison of Normalized mass flow rate distributions of both forms
Theory
A convergent divergent nozzle is described in the problem, where inlet is subsonic and at the outlet velocity is subsonic.
At the throat we are assuming a mach number of 1.
The convergence(subsonic) section connected with reservoir, here mach number is less than one. At throat area, the thermodynamic properties will become critical property as Mach number equal to 1. The sonic flow at the throat means that the local velocity at this point is equal to the local speed of sound and at divergence section(supersonic) the flow expands isentropically to supersonic speed at the nozzle exit. The corresponding notations are clearly written in the figure itself.
The flow is locally subsonic in the convergence section of the nozzle, sonic at the throat and supersonic at the divergence section.
The governing continuity, momentum and energy equation for the quasi 1D steady isentropic flow can be expressed as


Steps for solving the Nozzle flow problem
Meshing
The given 1D domain is divided into n number of elements. For Nozzle flow problem the length of nozzle is chosen as 3 and the length is divided into 30 elements.
Discretization
The PDE is discretized and solved for the points in the domain. Maccormack method is used for discretizing the equation. Maccormack method gives better results for the hyperbolic equation and it is also called as a shock-capturing method. These methods can provide stable solutions in the presence of shock. Hence they are used in nozzle flow problems. In Maccormack method combination of both forward and backward differencing schemes can be used to solve for the primitive variables. Non-conservative and conservative form of governing equations are solved by using this method
The time step used for the simulation is

The minimum value of t is used such that the time marching solution is following the actual unsteady flow variation that exists in nature.
Steps involved in Maccormack method
- Predictor step(forward differencing)
- Solution update
- Corrector step( Backward differencing)
- Determining the average of the time derivative
- Final solution update
Non-conservative form of Governing equation
In the non-conservative form of governing equation the continuity, momentum and energy equations can be discretized directly to obtain the primitive variables such as density, velocity and temperature.


Main code










- The graphs are showing the steady-state distribution of density, velocity, temperature, and pressure along the nozzle length in x directions.
- Obtained graphs are in good agreement with the analytical solution.Both conservative and non-conservative, there is no variation in density and pressure.
- Value of velocity at the outlet is slightly high in conservative form solution than non-conservative form solution
- The value of temperature at the outlet is almost zero in conservative form solution and non-zero in non-conservative form solution(but variations are negligible)..
- Grid wise also, there is very negligible fluctuation in the flow variables value




| Conservative | ||
| n=31 | n=61 | |
| Node no. 16 (throat section) | Node no. 31 (throat section) | |
| Pressure(p/p0) | 0.553 | 0.561 |
| Velocity(v/v0) | 0.891 | 0.918 |
| Temperature(T/T0) | 0.849 | 0.846 |
| Density(p/p0) | 0.6631 | 0.641 |
| Mach number(M) | 0.977 | 0.9982 |
| Non-Conservative | ||
| n=31 | n=61 | |
| Node no. 16 (throat section) | Node no. 31 (throat section) | |
| 0Pressure(p/p0) | 0.539 | 0.5327 |
| Velocity(v/v0) | 0.921 | 0.9138 |
| Temperature(T/T0) | 0.841 | 0.8345 |
| Density(p/p0) | 0.64 | 0.6381 |
| Mach number(M) | 0.999 | 0.9995 |

From the results we can observe that ,
As the number of grid points increases, the steady-state numerical results approach analytical value.
We may evaluate the following a from both conservative and non-conservative perspectives.
Conservation form results in a superior mass flow distribution or mass conservation. This may be seen in the mass flow rate vs time step graph or the mass flow rate vs. distance graph, where the results appear to be more consistent for the conservative form. The conservative form has less variance than the non-conservative form and tends to keep a consistent line.
The non-conservative form results in a lower residual. In the sense that residual decay is an indication of numerical algorithm quality, the non-conservative form performs better.
For primitive variables, the non-conservative form appears to yield somewhat more accurate findings, whereas the conservative form appears to produce slightly more accurate results for flux variables. In either situation, the outcomes are good.