0% found this document useful (0 votes)
7 views

Shock Capturing Method

Uploaded by

Hancel Borrego
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Shock Capturing Method

Uploaded by

Hancel Borrego
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/347628655

Numerical Solutions of Quasi-One-Dimensional Convergent-Divergent


Nozzle Flows

Article · April 2020

CITATION READS

1 1,644

1 author:

Cahya Amalinadhi Putra


Bandung Institute of Technology
15 PUBLICATIONS 56 CITATIONS

SEE PROFILE

All content following this page was uploaded by Cahya Amalinadhi Putra on 23 December 2020.

The user has requested enhancement of the downloaded file.


Numerical Solutions of Quasi-One-Dimensional Convergent-Divergent
Nozzle Flows
Cahya Amalinadhi Putra - 23619305

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.

Keywords Quasi 1D nozzle flow, MacCormack Scheme, Shock Capturing

1. Introduction Continuity:

The flow through a convergent-divergent nozzle is  V ln A 


   V V (1)
calculated numerically with MacCormack scheme. The t x x x
flow is assumed to be inviscid quasi-one-dimensional.
Momentum:

V V 1  T T   (2)
 V    
t x   x  t 

Energy:

T T  V ln A 
 V    1T  V  (3)
t x  x x 

Figure 1 Quasi-One-Dimensional Flow Then, combining equation 1 to 3, the compact form of


quasi-one-dimensional flow equation can be generated as
This report describes a program that solves both
U F
isentropic and non-isentropic flow through a convergent-  J (4)
divergent nozzle by varying nozzle exit static pressure. t x
Artificial viscosity is employed in the governing equation
to capture the shockwave. Later, the numerical solution is With
compared with the analytical solution.
 
 A 
2. Basic Theories  
U  VA 
(5)
Formulation of quasi-one-dimensional flows   e  2 
    V  A
   1 2  
The flow is govern by continuity, momentum, and
energy equation. The one-dimensional flows mean that for
the whole cross-section area, the flow properties are the
same. The governing equation is stated in non-dimensional
form, becomes:
  this problem, the artificial viscosity could be employed to
  the predictor (employs equation 13 to 11) and corrector
 VA  (employs equation 14 to 12).
 1  (6)
F  V A  pA
2


 

  
S it  Dit0.5 U it1  U it  Dit0.5 U it  U it1  (13)
 VA e   V 2   pVA 
   1 2 
     
S it  Dit 0.5 U it1  U it  Dit0.5 U it  U it1  (14)

 0  With
 1 A  p it1  2 p it  p it1
J  p  (7)
D t
 Cx (15)
  x 
i  0.5
p it1  2 p it  p it1
 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.

The chosen time step is obtained from the minimum  x   1 (16)


value of time step generated in Eq. (4). C is the Courant
number. The stability of the MacCormack scheme is based T x   1 (17)
on the Courant number with value less than 1.
The inlet of nozzle must be in subsonic condition. Then
MacCormack scheme is done with two step, by there are 2 variables specified while the other one is
calculating the spatial derivative as forward differences, extrapolated.
predictor step, then replace the spatial derivatives with
backward differences, corrector step. Then the next value is U 1,1  2U 2,1  U 3,1 (18)
generated by averaging the time derivatives.

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.

4. Results and Discussion

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.

Ax   1  2.2x  1.5


2
(23)

The Courant number is 0.5 and the artificial viscosity


constant is 0.2. The nozzle static exit pressure is varied to
change the flow condition (isentropic or non-isentropic).
The input is in non-dimensional form. At the inlet, due to
subsonic condition, the density and temperature is fixed
(the initial condition is based on equation 16 and 17).

U 1,1  A1,1  A1 (24)

U 2,1  2U 2, 2  U 2,3 (25)


Figure 3 Comparison of isentropic flow
From figure 3, the non-dimensional static pressure, Clearly, the artificial viscosity terms added to the numerical
temperature, density, and velocity are similar between solution of the governing equations are acting like a source
analytical and numerical solution. However there is a slight of mass flow in the vicinity of the shock wave. Even
difference in the term of non-dimensional mass flow. This though there is a differences, the solution with artificial
can be happened due to numerical error. The error is below viscosity can be categorized as acceptable because of
1% thus the solution still acceptable. response better than without artificial viscosity term added.

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

The whole process is placed in CoreMethod.py and


PlotMethod.py file inside core folder. The TestSample.py
files contain the steps to perform grid generation. The
results are saved in results folder.

Figure 5 Comparison of non-isentropic flow

From figure 5, there is a slight difference between Figure 7 TestSample.py file


analytical and numerical solution in non-dimensional static
pressure, density, and velocity. The non-dimensional static The code is already documented and is for public use.
temperature after the shockwave indicates bigger Please visit below GitHub link to jump to the code.
differences than before. Further, the non-dimensional mass https://github.com/cahyaamalinadhi/ShockCapturing
flow after the shockwave display even bigger differences.
5. Conclusion References

Based on the obtained results, it can be concluded that:


[1] Anderson, John D.. Modern Compressible Flow. 1990. McGraw Hill
1. Numerical method with MacCormack scheme can Book Co.
be employed to solve quasi-one-dimensional nozzle
flow, even with the appearance of shockwave. [2] Anderson, John D.. Computational Fluid Dynamics, The Basics with
Application. 1995. McGraw Hill Book Co.
2. When shockwave occurs, the artificial viscosity can
be added to the governing equation to damp the [3] Moelyadi, M. Agoes. CFD 2 Course: Compressible Flows Solutions
oscillation in solution. Shock Capturing Technique. 2019.
3. The comparison between numerical and analytical
solutions raise up a small amount of error.
However, this error is still tolerable.

View publication stats

You might also like