Shock Capturing Method
Shock Capturing Method
net/publication/347628655
CITATION READS
1 1,644
1 author:
SEE PROFILE
All content following this page was uploaded by Cahya Amalinadhi Putra on 23 December 2020.
27 April 2020
Abstract
This report deals with the quasi-one-dimensional flow through a convergent-divergent nozzle. The flow is governed by mass,
momentum, and energy conservation equation in compact form. By varying the nozzle exit static pressure, we can study the isentropic and
non-isentropic flow inside the convergent-divergent nozzle. In order to capture the shockwave, the equation is added with artificial
viscosity. Finally the numerical solutions is obtained by employing MacCormack scheme. The results later are compared with the analytic
solution.
1. Introduction Continuity:
V V 1 T T (2)
V
t x x t
Energy:
T T V ln A
V 1T V (3)
t x x x
S it Dit0.5 U it1 U it Dit0.5 U it U it1 (13)
VA e V 2 pVA
1 2
S it Dit 0.5 U it1 U it Dit0.5 U it U it1 (14)
0 With
1 A p it1 2 p it p it1
J p (7)
D t
Cx (15)
x
i 0.5
p it1 2 p it p it1
0
Cx is the artificial viscosity constant. The solution
MacCormack Scheme usually stable when Cx is less than 0.25.
At a given grid point at a given time step, the stability
constraint exist on this system is written as Initial and Boundary Conditions
The nozzle shape A(x) is the function of length. At time t
x
t ti C (8) = 0, the flow field (density and temperature) is assumed to
Vi t
t
i
be 1.
U 1, 2 2U 2, 2 U 3, 2 (19)
U
U it t U it t (9)
t ave
Depends on the exit static pressure, the outflow
boundary can be supersonic (for isentropic flow cases) and
1 U U
t t
U
t
subsonic (for non-isentropic flow cases). For supersonic
(10) outflow, all the variables can be extrapolated, while the
t ave 2 t i t i
subsonic outflow, 2 variables are specified and the other
one is extrapolated.
Predictor:
Subsonic:
U
t
F Fi
Qit
t
i 1
t
(11) U M ,1 2U M 1,1 U M 2,1 (20)
t i x
U M , 2 2U M 1, 2 U M 2, 2 (21)
Corrector:
U
t t
F i
t t
Fi t 1 t
Qi t t (12)
Supersonic:
Equation 20 and 21 with the addition of
t i x
U M ,3 2U M 1,3 U M 2,3 (22)
Artificial Viscosity
If the governing equation is solved with the knowledge
of shockwave phenomenon inside the CD nozzle, the
solution will oscillate near the shockwave location. This
phenomenon can make the solution inconsistent. To tackle
3. Workflow T
U 3 U 1 V 2 (26)
The workflow to solve quasi-one-dimensional flow 1 2
through a convergent-divergent nozzle is listed below:
1. Input. Number of discretization, length of nozzle, At the outlet, if the flow is isentropic, all the property
non-dimensional value of static density and are extrapolated following equation 20 to 22. However, if
temperature at inlet and static pressure at outlet, the the flow is non-isentropic, the compact form variables is
Courant Number and Artificial Viscosity constant, held constant following below equation.
and maximum iteration.
2. Initialize variables. Generate discretization length, pe A
area, non-dimensional primitive (density, pressure, U 3, N 1 U 2, N 1VN 1 (27)
temperature, mass flow, velocity, Mach number) 1 2
and compact (U) variables.
3. Generate time step. Generate time step. Finally, the program is stop when reach maximum
4. Perform Predictor Loop. Calculate F and J, then the iteration of 3,400.
artificial viscosity. After that, calculate predictor
gradient and intermediate solution of U. Next, Results and Discussion
perform the boundary condition correction and
recalculate the primitive variables (density, Nozzle geometry
temperature, pressure, and velocity). Finally
calculate the intermediate solution of F.
5. Perform Corrector Loop. Calculate J and artificial
viscosity. After that, calculate the corrector gradient
and average gradient. From that, the updated
solution of U can be calculated. Next, perform the
boundary condition correction and recalculate the
primitive variables (density, temperature, pressure Figure 2 Nozzle geometry
and velocity).
6. Generate the error. The iteration residual is Figure 2 illustrates the convergent-divergent nozzle
generated from the update of non-dimensional which follows equation 23.
primitive variables (density and velocity) and
compact variables (U). Isentropic solution
7. Iterate the solution. Redo step 3 to 6 until the The isentropic solution occurs when there is no
maximum iteration is reached. shockwave inside the CD nozzle. To make this happen, the
8. Generate data and Plot. After the iteration is done, exit pressure static is set approaches to 0 or there is no back
generate the additional variables (mass flow and pressure. Below is the comparison between numeric and
Mach number) and plot the graphics. analytic solutions.
Input parameters
The nozzle length is 3 m and is discretized into 121
elements that is distributed linearly. The cross-section area
of the nozzle is following the equation below.
Figure 4 Numerical solution error history of isentropic case Figure 6 Numerical solution error history of non-isentropic
case
From figure 4, the error eventually drop to below
1.0x10-4 after around 700 time steps. From figure 6, the error drop linearly and start to level
after 2000 time steps.
Non-isentropic solution
The non-isentropic solution occurs when there is a Code structure
shockwave inside the CD nozzle. To make this happen, the The code is written on Python language. It has several
non-dimensional exit static pressure can be set into some files inside it.
values between 0 and 1. For this case, pe = 0.6784.
ShockCapturing
- cores
- CoreMethod.py
- PlotMethod.py
- results
TestSample.py