Chapter 6 PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

Chapter 6: Quasi-One-Dimensional Flow (H.

Ch 12)

In this chapter, we introduce the numerical method for solving

compressible quasi-one-dimensional nozzle flow. We consider the

steady, inviscid (Euler) flow through a convergent-divergent flow. The

flow properties are assumed to be function of 𝑥 only, and is thus noted


as quasi-one-dimensional flow. The Steger-Warming flux vector

splitting numerical method will be introduced which is capable of

capturing shock automatically. The analytic solution exists so we can

compare the accuracy of the numerical solution.

Sec. Governing Equations

Denote cross-sectional area 𝑆 = 𝑆(𝑥). The conservation of mass


in integral form is expressed as follows.
𝜕
∫ 𝜌 𝑑𝒱 + ∫ 𝜌𝑣⃑ 𝑑𝑆 = 0
𝜕𝑡 𝒱 𝑆

𝑑𝒱 = 𝑆𝑑𝑥
The continuity equation can be derived based on the above two

equations.
𝜕 𝜕
(𝜌𝑆) + (𝜌𝑢𝑆) = 0
𝜕𝑡 𝜕𝑥
We can derive the momentum and energy equation similarly.
Fig. A6.1: the quasi-one-dimensional flow (A. Ch7).

The PDE in conservational form can be expressed as follows.


⃑⃑)
𝜕(𝑆𝑈 𝜕𝐹⃑
⃑⃑
+ 𝜕𝑥 = 𝐻 (12.8)
𝜕𝑡
⃑⃑ is noted as the state vector, and vector 𝐹⃑ is noted as the
Vector 𝑈
⃑⃑ is the source term caused
(inviscid) flux in 𝑥 direction. The vector 𝐻
by the changes of the cross-sectional area.
𝜌
⃑⃑ = (𝜌𝑢)
𝑈 (A6.1)
𝑒𝑡
1
𝑒𝑡 = (𝐶𝑣 𝑇 + 2 𝑞 2 ) , 𝑞 2 = 𝑢2
𝜌𝑢
𝐹⃑ = 𝑆 ( 𝑝 + 𝜌𝑢2 ) (A6.2)
(𝜌𝑒𝑡 + 𝑝)𝑢
0
𝑑𝑆
⃑⃑ = (𝑝)
𝐻 (A6.3)
𝑑𝑥
0
Notes:
1
(a)The total energy is sometimes defined as 𝑒𝑡 = 𝜌 (𝐶𝑣 𝑇 + 2 𝑞 2 ) but

not here.

(b) If 𝑆 is a constant, the PDE is reduced to the 1-d Euler equation,

which can be obtained by setting 𝑆 = 1 in Eq. (12.8), and Eq. (A6,1)


to (A6.3). The Euler equations in conservational form is written as
⃑⃑
𝜕𝑈 𝜕𝐹⃑
+ 𝜕𝑥 = 0 (A6.4)
𝜕𝑡
Alternatively, it can be cast into non-conservational form as follows.
⃑⃑
𝜕𝑈 ⃑⃑
𝜕𝑈
+ 𝐴 𝜕𝑥 = 0 (A6.5)
𝜕𝑡

Sec. An important Property of Jacobian Matrix.

We will discuss the relation between 𝐹⃑ , 𝑈


⃑⃑, and 𝐴.

Definition: A function 𝑓(𝑥) is said to be homogeneous of degree 𝛼


if 𝑓(𝑘𝑥 ) = 𝑘 𝛼 𝑓(𝑥).

Theorem: flux vector 𝐹⃑ (𝑈


⃑⃑) is a homogeneous function of 𝑈
⃑⃑ with

degree 𝛼 = 1, i.e., 𝐹⃑ (𝑘𝑈


⃑⃑) = 𝑘𝐹⃑ (𝑈
⃑⃑).

Note: The proof is straightforward.

Theorem: If 𝐹⃑ (𝑈 ⃑⃑) = ( 𝜕𝐹⃑ ) 𝑈


⃑⃑) is a homogeneous function, then 𝐹⃑ (𝑈 ⃑⃑,
𝜕𝑈⃑⃑
𝜕𝐹⃑
where 𝐴 = ⃑⃑
is the Jacobian matrix.
𝜕𝑈
Proof: Based on the definition:

𝑘𝐹⃑ (𝑈
⃑⃑) = 𝐹⃑ (𝑘𝑈
⃑⃑)

𝜕𝐹⃑ 𝜕𝐹⃑ (𝑘𝑈


⃑⃑) 𝜕𝐹⃑ (𝑘𝑈⃑⃑) 𝜕(𝑘𝑈
⃑⃑)
LHS: = 𝐹⃑ (𝑈
⃑⃑). RHS: = ⃑⃑) 𝜕 (𝑘)
⃑⃑
= 𝐴𝑈
𝜕𝑘 𝜕𝑘 𝜕(𝑘𝑈

Compare LHS and RHS, we obtain

𝐹⃑ (𝑈
⃑⃑) = 𝐴𝑈
⃑⃑ (A6.6)
The proof is complete.

Remarks: The important property 𝐹⃑ (𝑈


⃑⃑) = 𝐴𝑈
⃑⃑ still holds for 1D, 2D

and 3D NS equations.

Question: Based on Eq. (A6.4) and Eq. (A6.5), we can write


𝜕𝐹⃑ ⃑⃑
𝜕𝑈
=𝐴
𝜕𝑥 𝜕𝑥
𝜕𝐹⃑
On the other hand, based on Eq. (A6.6), is also equal to
𝜕𝑥
𝜕𝐹⃑ ⃑⃑)
𝜕(𝐴𝑈 ⃑⃑
𝜕𝑈 𝜕𝐴
= ⃑⃑
= 𝐴 𝜕𝑥 + 𝜕𝑥 𝑈
𝜕𝑥 𝜕𝑥
𝜕𝐴
Does it imply ⃑⃑ = 0 ?
𝑈
𝜕𝑥

The Jacobian matrix for 1-D (quasi 1D) Flux 𝐹⃑ :


The matrix 𝐴 is expressed as follow.
0 1 0
𝛾−3
𝐴=(
𝜕𝐹⃑
) = 𝑆[ ( ) 𝑢2 −(𝛾 − 3)𝑢 𝛾 − 1] (12.14)
⃑⃑ 2
𝜕𝑈
3(𝛾−1)
−𝛾𝑢𝑒𝑡 + (𝛾 − 1)𝑢3 𝛾𝑒𝑡 − 𝑢2 𝛾𝑢
2
The total energy 𝑒𝑡 is simplified as follows.
1
𝑒𝑡 = 𝑒 + 2 𝑢2 . Thus
1
𝑝 = 𝜌𝑒(𝛾 − 1) = (𝛾 − 1) (𝑒𝑡 − 2 𝑢2 ),.

From which
𝑝 1
𝑒𝑡 = 𝜌(𝛾−1) + 2 𝑢2 (12.16)

Denote 𝑐 as Speed of sound (isentropic). For perfect gas, if is equal


to
𝑝
𝑐2 = 𝛾 𝜌 (12.17)

After substitution of Eq. (12.17) into Eq. (12.16) the total energy is

obtained as follows.
𝑐2 1
𝑒𝑡 = 𝛾(𝛾−1) + 2 𝑢2 (12.18)

Substitution of Eq. (12.18) into the Eq. (12.14), the Jacobian matrix 𝐴
is written as follow.
0 1 0
𝛾−3
( 2 ) 𝑢2 −(𝛾 − 3)𝑢 𝛾−1
𝐴=𝑆 (12.19)
−𝑢𝑐 2 𝛾 3 𝑐2 3 2
[ 𝛾−1 + ( − 1) 𝑢 + ( − 𝛾) 𝑢 𝛾𝑢 ]
2 𝛾−1 2

Sec. The Explicit Flux Vector Splitting Method: FD Version

Apply forward time difference to Eq. (12.8). The space derivative can

are evaluated at time 𝑛, the PDE is expressed as follows.


⃑⃑ 𝑛+1 −𝑈
𝑆(𝑈 ⃑⃑ 𝑛 ) 𝜕𝐹⃑
⃑⃑
+ 𝜕𝑥 = 𝐻 (A6.11)
∆𝑡
For convenience, let
⃑⃑ 𝑛 = 𝑈
𝛿𝑈 ⃑⃑ 𝑛+1 − 𝑈
⃑⃑ 𝑛

as the unknown dependent variables which is noted as delta law form.


⃑⃑ 𝑛 = ∆𝑡 [− 𝜕𝐹⃑ + 𝐻
𝑆𝛿𝑈 ⃑⃑] (A6.12)
𝜕𝑥

The flux vector 𝐹⃑ and source vector 𝐻


⃑⃑ are exact at this moment. If

they are evaluated implicitly at time step 𝑛 + 1, it is noted as implicit


method, which requires further linearization. We will introduce the

implicit method later.

Consider the flux 𝐹⃑ and source 𝐻


⃑⃑ are evaluated at time step 𝑛.

Then Eq. (A.6.11) is expressed as follows.


𝑛
⃑⃑ 𝑛 = ∆𝑡 [− 𝜕𝐹⃑ + 𝐻
𝑆𝛿𝑈 ⃑⃑𝑛 ] (A6.13)
𝜕𝑥

Diagonalization of the Jacobian Matrix:

Recall that When PDEs are classified as hyperbolic, the Jacobian

matrix 𝐴 must possess real eigenvalues. The eigenvalues of matrix 𝐴


represent the characteristic direction of the hyperbolic system and thus

provide the direction of the propagation of information. The matrix 𝐴


can be diagonalized as follows.

𝐴 = 𝑋𝐷𝑋 −1 (A6.14)
, in which 𝐷 is a diagonal matrix, and matrix 𝑋 is the eigenvector

matrix. The elements in 𝐷 and 𝑋 are all real number. After some
algebra calculation, the eigenvalues of 𝐴 are exactly equal to

𝜆1 = 𝑆𝑢, 𝜆2 = 𝑆(𝑢 + 𝑐 ), 𝜆3 = 𝑆(𝑢 − 𝑐 ) (12.20)


That is
𝑢 0 0
𝐷 = 𝑆 [0 𝑢+𝑐 0 ] (12.21)
0 0 𝑢−𝑐
Define
𝜌 1
𝛼=𝑐 and 𝛽 = 𝜌𝑐
√2 √2

The eigenvector matrix 𝑋 and its inverse 𝑋 −1 are expressed


respectively follows.
1 𝛼 𝛼
𝑢 𝛼 (𝑢 + 𝑐) 𝛼 (𝑢 − 𝑐)
𝑋=[ ] (12.22)
1 2 1 2 𝑐2 1 2 𝑐2
𝑢 𝛼 ( 𝑢 + 𝑢𝑐 + ) 𝛼 ( 𝑢 − 𝑢𝑐 + )
2 2 𝛾−1 2 𝛾−1
𝑢2 𝛾−1 (𝛾−1)𝑢 −(𝛾−1)
1− 2 𝑐2 𝑐2 𝑐2
𝑋 −1
= [𝛽[(𝛾 − 1 𝑢 /2 − 𝑢𝑐 ] 𝛽[𝑐 − (𝛾 − 1)𝑢] 𝛽 (𝛾 − 1)](12.23)
) 2
𝛽[(𝛾 − 1)𝑢2 /2 + 𝑢𝑐 ] −𝛽[𝑐 + (𝛾 − 1)𝑢] 𝛽 (𝛾 − 1)

The Jacobian Matrix of the source Term:


⃑⃑ is evaluated as
Likewise, the Jacobian Matrix 𝐵 of source vector 𝐻
follows.
0 0 0
𝜕𝐻⃑⃑ 𝑑𝑆 1
𝐵= (𝜕𝑈⃑⃑) = (𝛾 − 1) 𝑑𝑥 [2 𝑢2 −𝑢 1] (12.15)
0 0 0
Flux Vector Splitting:

How shall we discretize (A6.13)? All of the central, backward, and

forward difference will suffer from numerical stability problem as

discussed previously.

The flux vector splitting is one way to circumvent the difficulty. It

treats the flux and its Jacobian matrix in a physical way to avoid

numerical instability especially around the shock, where the flow

properties change abruptly. The key is the signs of the eigenvalues of

Jacobian matrix represents where the wave information is travelled

from. We will decompose the flux vector into two vector components.

Upwind method is then applied to each of the vector component.

Model Equation Example:

To illustrate this idea. Consider the PDEs with constant coefficient

matrix 𝐶 with only real eigenvalues.


𝜕𝑤
⃑⃑⃑ 𝜕𝑤
⃑⃑⃑
+𝐶 ⃑⃑⃑ = (𝑤1 (𝑥, 𝑡), 𝑤2 (𝑥, 𝑡))𝑇
= 0, 𝑤
𝜕𝑡 𝜕𝑥
How can we discretize the space derivative to maintain the numerical

stability? The answer is to diagonalize the matrix 𝐶. Then apply the


upwind method to each of the equation. Let’s see how it works!

Matrix 𝐶 = 𝑃𝛬𝑃−1 , Λ and 𝑃 are the eigenvalue and eigenvector


matrix of 𝐶, respectively. The eigenvalue matrix is expressed as
𝜆1 0
Λ=( )
0 𝜆2
The PDEs can be rewritten as
𝜕𝑤
⃑⃑⃑ 𝜕𝑤
⃑⃑⃑
𝑃−1 + 𝛬𝑃−1 =0
𝜕𝑡 𝜕𝑥
⃑⃑⃑ ′ = 𝑃−1 𝑤
Let 𝑤 ⃑⃑⃑, then
⃑⃑⃑ ′
𝜕𝑤 ⃑⃑⃑ ′
𝜕𝑤
+𝛬 =0
𝜕𝑡 𝜕𝑥
Expanding out the above PDE, it yields
𝜕𝑤1′ 𝜕𝑤1′
+ 𝜆1 =0
𝜕𝑡 𝜕𝑥
𝜕𝑤2′ 𝜕𝑤2′
+ 𝜆2 =0
𝜕𝑡 𝜕𝑥
We will see how the space derivatives are approximated by upwind

method. We apply 1st order upwind scheme to each of the PDEs


𝜕(𝑤1′ )𝑛𝑖 (𝑤1′ )𝑛𝑖 − (𝑤1′ )𝑛𝑖−1
= , 𝜆1 > 0
𝜕𝑥 ∆𝑥
𝜕(𝑤1′ )𝑛𝑖 (𝑤1′ )𝑛𝑖+1 − (𝑤1′ )𝑛𝑖
= , 𝜆1 < 0
𝜕𝑥 ∆𝑥
𝜕𝑤2′
Similar procedure is applied to discretize .
𝜕𝑥
The procedure can be put in a more compact an automatic form

(suppose we don’t know the signs of 𝜆1 and 𝜆2 ) as follows.


Let
𝛬+|𝛬| 𝛬−|𝛬|
𝛬+ = and 𝛬+ =
2 2

Then

⃑⃑⃑ ′
𝜕𝑤 ⃑⃑⃑ ′ )𝑖 −(𝑤
(𝑤 ⃑⃑⃑ ′ )𝑖−1 ⃑⃑⃑ ′ )𝑖+1 −(𝑤
(𝑤 ⃑⃑⃑ ′ )𝑖
+ −
𝛬 =𝛬 +𝛬 QED
𝜕𝑥 ∆𝑥 ∆𝑥

⃑⃑𝒏
𝝏𝑭
Approximation of for quasi-1D Flow:
𝝏𝒙
We return to the approximation of the flux and source terms in Eq.

(A6.12) for quasi-1D flow.

Observations:

(a)The signs eigenvalues of Jacobian matrix represent where the wave

information is travelled from.

(b) We then split the flux vector 𝐹⃑ into its positive 𝐹⃑ + and negative

𝐹⃑ − counterparts where 𝐹⃑ + contains only non-negative (positive)

eigenvalues, and 𝐹⃑ − contains only negative eigenvalues. The detail


steps are described as follows.

The eigenvalue matrix 𝐷 is decomposed into

𝐷 = 𝐷+ + 𝐷− (A6.15)

, in which matrix 𝐷+ only contains positive eigenvalues, and 𝐷−


only contains negative eigenvalues. The flow velocity is always

positive based on the continuity equation. Using the following identity


𝑦 + |𝑦|
,𝑦 > 0
𝑦={ 2
𝑦 − |𝑦|
,𝑦 > 0
2
Then the diagonal matrices 𝐷+ and 𝐷 − can be expressed as
𝐷+|𝐷| 𝐷−|𝐷|
𝐷+ = , 𝐷− = (A6.16)
2 2

Example of eigenvalues:

(i) Subsonic flow: Based on Eq. (12.20), we have

𝜆1 = 𝑆𝑢 > 0, 𝜆2 = 𝑆(𝑢 + 𝑐 ) > 0, 𝜆3 = 𝑆(𝑢 − 𝑐 ) < 0


Eq. (12.21) is written as
𝑢 0 0 0 0 0
𝐷 + = 𝑆 [0 𝑢+𝑐 0], 𝐷 − = 𝑆 [0 0 0 ]
0 0 0 0 0 𝑢−𝑐
(ii) supersonic flow: based on Eq. (12.20)

𝜆1 = 𝑆𝑢 > 0, 𝜆2 = 𝑆(𝑢 + 𝑐 ) > 0, 𝜆3 = 𝑆(𝑢 − 𝑐 ) > 0


Eq. (A6.15) is written as
𝑢 0 0 0 0 0
𝐷 + = 𝑆 [0 𝑢+𝑐 0 ], 𝐷− = 𝑆 [0 0 0]
0 0 𝑢−𝑐 0 0 0

Based on Eq. (A6.6) (F=AU) and Eq. (A6.16), the flux term is

expressed as

𝑈 = 𝑋𝐷𝑋−1 ⃑⃑⃑⃑
𝐹⃑ = 𝐴⃑⃑⃑⃑ 𝑈
The flux vector 𝐹⃑ can be split as follows.

𝐹⃑ = 𝐹⃑ + + 𝐹⃑ − (A6.21a)

𝑈 = 𝑋𝐷+ 𝑋−1 ⃑⃑⃑⃑


𝐹⃑ + = 𝐴+ ⃑⃑⃑⃑ 𝑈 (A6.21b)

𝑈 = 𝑋𝐷− 𝑋−1 ⃑⃑⃑⃑


𝐹⃑ − = 𝐴− ⃑⃑⃑⃑ 𝑈 (A6.21c)

In other words, 𝐹⃑ + and 𝐹⃑ − contain only positive and negative (of


course, real number) eigenvalues. The flux vector has been

decomposed into positive and negative fluxes. We can, thus, apply

upwind method as follows.


𝜕
⃑⃑⃑𝑖 ) = 𝜕 (𝐹⃑𝑖+ + 𝐹⃑𝑖+ ) .
(𝐹
𝜕𝑥 𝜕𝑥

Apply 1st order upwind scheme to the above two terms, we have
𝜕 𝐹⃑𝑖+ − 𝐹⃑𝑖−1
+
(𝐹⃑𝑖 ) =
+
+ 𝑂(∆𝑥)
𝜕𝑥 ∆𝑥
𝜕 𝐹⃑𝑖− − 𝐹⃑𝑖+1

(𝐹⃑𝑖− ) = + 𝑂(∆𝑥)
𝜕𝑥 ∆𝑥
Then
⃑ + −𝐹⃑𝑖−1
+
𝐹⃑𝑖− −𝐹⃑𝑖+1

𝜕
⃑⃑⃑𝑖 ) = 𝐹𝑖
(𝐹 + (A6.22)
𝜕𝑥 ∆𝑥 ∆𝑥

Approximation of ⃑𝑯
⃑⃑⃑𝒏 :

Based on Eq. (A6.3), we have


0
𝑑𝑆
⃑⃑𝑖 =
𝐻 (𝑝𝑖 ) (A6.23)
𝑑𝑥𝑖
0
Note: there is no truncation error introduced in the source vector.
Assembly of the equations for explicit SW flux splitting method:

Forward difference in time and flux vector in space are applied to

approximate Eq. (12.8), the system of equations is written as follows.


∆𝑡 𝑛
⃑⃑𝑖𝑛 = ∆𝑈
𝛿𝑈 ⃑⃑𝑖𝑛 = − ⃑ + ⃑ − ⃑ + ⃑ − ⃑⃑
{[(𝐹𝑖 + 𝐹𝑖+1 ) − (𝐹𝑖−1 + 𝐹𝑖 )] + ∆𝑥𝐻𝑖 }
𝑆𝑖 ∆𝑥
OR
∆𝑡 𝑛
⃑⃑𝑖𝑛 = ∆𝑈
𝛿𝑈 ⃑⃑𝑖𝑛 = − ( ) [(𝐴+ ⃑⃑ − ⃑⃑ + ⃑⃑ − ⃑⃑ ⃑⃑
𝑖 𝑈𝑖 + 𝐴𝑖+1 𝑈𝑖+1 ) − (𝐴𝑖−1 𝑈𝑖−1 + 𝐴𝑖 𝑈𝑖 ) + ∆𝑥𝐻𝑖 ]
𝑆𝑖 ∆𝑥

(A.624)

Eq. (A6.24) is applied for internal nodes 𝑖 = 1: 𝑛, in which 𝑛 is the


number of internal grid points. We need to specify the BCs to the point

next to the boundary nodes. For instance, for index 𝑖 = 1, Eq. (A6.24)
⃑⃑0 and 𝐴+
requires 𝑈 0 , which lies on the boundary. Their values will be

assigned or extrapolated from the interior points as will be discussed

later.

𝑪𝑭𝑳 (numerical stability) criteria:

The time step ∆𝑡 is restricted by the numerical stability criteria, i.e.,

𝐶𝐹𝐿 < 1,which is given by


∆𝑡(|𝑢| + 𝑐)𝑚𝑎𝑥
𝐶𝐹𝐿 = <1
∆𝑥
∆𝑥
∆𝑡 < 𝐶𝐹𝐿 ∙ (| ; 𝐶𝐹𝐿 ≤ 1 (A6.25)
𝑢|+𝑐 )𝑚𝑎𝑥

Note: Eq. (A6.25) can be applied to solve unsteady and steady problem

as well.
Sec. Boundary Conditions:
⃑⃑𝑖 , 𝑖 = 2: 𝑛 − 1 , but we
Eq. (A6.24) is applied to interior points 𝑈
⃑⃑𝑖 for 𝑖 = 1 and i = 𝑛 , which lie on the
need to determine 𝑈
boundaries. In other words, we still need to specify the boundary

conditions to make the algorithm complete. The numerical boundary

conditions must be interpreted correctly from physical perspective.

Consider the specifications of boundary conditions (BCs) for the

quasi-one-dimensional problem.

The eigenvalues of the flux Jacobian matrix 𝐴 (𝐴/𝑆) are given by


Eq. (12.20), and are equal to

𝜆1 = 𝑆𝑢, 𝜆2 = 𝑆(𝑢 + 𝑐 ), 𝜆3 = 𝑆(𝑢 − 𝑐 ) (12.20)


These eigenvalues indicate how information propagates. The

schematic is displayed in Table 12.1. Here we discuss the inflow and

outflow BCs separately.


(Courtesy. H. Ch 12)

(a) subsonic inflow. There are two positive and one negative

eigenvalue. The negative eigenvalue indicates one information comes

from the right of the inflow (from interior points). Thus, we must allow

one variable to be determined, and specify two physical variables.

On a physical basis we know the mass flow through the nozzle

must be allowed to adjust to the proper steady state. The value of

velocity 𝑢 is calculated from the information provided by the field


solver. We use the linear extrapolation to determine the velocity at the

inflow. We imagine the flow variables are purely one-dimensional (no

area change, reservoir condition). The BCs are summarized as below.

Summary:

Specify 𝑇𝑖=1 , 𝑝𝑖=1

Notes: we can specify any of the 2 variables 𝜌, 𝑝, and 𝑇, and use, say,

𝑝 = 𝜌𝑅𝑇 to obtain another one)


Extrapolate velocity.

𝑢𝑖=1 = 2𝑢𝑖=2 − 𝑢𝑖=3 (C6.2)


Notes: The above equation holds for uniform grid only.

Question: Can you derive the velocity for non-uniform grid?


(b) supersonic inflow. All the eigenvalues are positive, which means

all the information comes from the reservoir (left of the outlet).

Therefore, all three analytic boundary conditions 𝑢𝑖=1 , 𝜌𝑖=1 ,

𝑇𝑖=1 and are specified.

(Courtesy. A. Ch 7)

(c) subsonic outflow. There are two positive and one negative

eigenvalue. Pressure (difference) is the driving force, we must specify

it.

Specify 𝑝𝑖=𝐼

Extrapolate to obtain 𝑢𝑖=𝐼 and 𝑇𝑖=𝐼

(d) supersonic outflow. All the eigenvalues are positive, which means

all the information comes from the interior domain. Therefore, no


boundary conditions can be specified, the variables at the outlet are

extrapolated using the previous points.

𝑢𝑖=𝐼 = 2𝑢𝐼−1 − 𝑢𝐼−2 (C6.2a)

𝜌𝑖=𝐼 = 2𝜌𝐼−1 − 𝜌𝐼−2 (C6.2a)

𝑇𝑖=𝐼 = 2𝑇𝐼−1 − 𝑇𝐼−2 (C6.2a)

Sec. Initial Conditions:

To start the solution, a set of initial conditions must be provided.

Obviously, the solution will converge faster for the better initial

conditions.

An easy procedure is to describe the initial data set is to specify the

flow variables everywhere in the domain to be those of the inflow

conditions

Sec. Implicit Flux Vector Splitting: FD Version

The problem of the explicit SW method is the time step is

constrained by Eq. (A6.25). The allowed time step the very small, and

it requires a long time to converge to the steady, the problem becomes

more severe in higher dimensional flow.

If only steady state solution is required, the space derivative can are

evaluated at time 𝑛 + 1. This is known as the implicit method. The


implicit formulation has the advantage to allow larger time step to

enhance the computation efficiency (converges to steady state solutions

much faster) without numerical stability problem.

Evaluate the space derivative can are evaluated at time 𝑛 + 1, the


PDEs becomes

⃑⃑ 𝑛+1 −𝑈
𝑆(𝑈 ⃑⃑ 𝑛 ) 𝜕𝐹⃑ 𝑛+1
+ ⃑⃑𝑛+1
=𝐻 (A6.31)
∆𝑡 𝜕𝑥
The next step to Eq. (A6.31) is to apply finite difference to the space
⃑⃑ 𝑛 at time step 𝑛 as known variable. Because
derivative. Treat 𝑈

𝐹⃑ 𝑛+1 = 𝐹⃑ (𝑈
⃑⃑ 𝑛+1 ) , the discretized equations are nonlinear system of

⃑⃑ 𝑛+1 . How to solve it? In the following sections,


equations of 𝑈
numerical method will be introduced to solve the steady state equation

of Eq. (A6.31).

Start from Eq. (12.8), The non-steady term is approximated using

Euler scheme.
⃑⃑)
𝜕(𝑆𝑈 ⃑⃑ 𝑛 )
𝛿(𝑆𝑈
= + 𝑂(∆𝑡) (A6.32)
𝜕𝑡 ∆𝑡
𝜕𝐹⃑
The flux term ⃑⃑ is evaluated implicitly at time
and source vector 𝐻
𝜕𝑥
step 𝑛 + 1 to enhance the numerical stability.
𝜕𝐹⃑ 𝜕𝐹⃑ 𝑛+1

𝜕𝑥 𝜕𝑥
The term 𝐹⃑ 𝑛+1 is linearized as follows.
𝜕𝐹⃑ 𝑛
𝐹⃑ 𝑛+1 = 𝐹⃑ 𝑛 + ∆𝑡 + 𝑂(∆𝑡 2 ) (A6.33)
𝜕𝑡
𝜕𝐹⃑ 𝑛
The term in (A6.16) can be written as
𝜕𝑡
𝑛 ⃑⃑
𝜕𝐹⃑ 𝑛 𝜕𝐹⃑ 𝜕𝑈 ⃑⃑ 𝑛
𝛿𝑈
= (𝜕𝑈⃑⃑) 𝜕𝑡 ≅ 𝐴𝑛 (A6.34)
𝜕𝑡 ∆𝑡

Substitute (A6.17) into (A6.16), it yields

𝐹⃑ 𝑛+1 = 𝐹⃑ 𝑛 + 𝐴𝑛 𝛿𝑈
⃑⃑ 𝑛 (12.12)
Likewise,
⃑⃑𝑛+1 = 𝐻
𝐻 ⃑⃑𝑛 + 𝐵𝑛 𝛿𝑈
⃑⃑ 𝑛 (12.13)
Combine (A6.13), (A6.18), (12.15), and (A6.1), the approximation

to Eq. (12.8) is expressed as follows.


⃑⃑ 𝑛
𝑆𝛿𝑈 𝜕
+ 𝜕𝑥 (𝐹⃑ 𝑛 + 𝐴𝑛 𝛿𝑈
⃑⃑ 𝑛 ) = (𝐻
⃑⃑𝑛 + 𝐵𝑛 𝛿𝑈
⃑⃑ 𝑛 ) (12.29)
∆𝑡
⃑⃑ 𝑛 on LHS, and the known variables at
Put the unknown variables 𝛿𝑈
time 𝑡 𝑛 on RHS. It yields
𝜕𝐴𝑛
(𝑆𝐼 + ∆𝑡 ⃑⃑ 𝑛 = −∆𝑡 ( 𝜕 (𝐹⃑ 𝑛 ) − 𝐻
− 𝐵𝑛 ∆𝑡) 𝛿𝑈 ⃑⃑𝑛 ) (12.31)
𝜕𝑥 𝜕𝑥

The LHS is the implicit term (unknowns). The RHS is the explicit

term (knowns) which represents the physical terms at time step 𝑡 𝑛 .


We will apply flux vector splitting to further approximate Eq.

(12.31). The key for stability is to apply the Flux and Jacobian matrix

in upwind manner. Apply Eq. (A6.21) ( 𝐴 = 𝐴+ + 𝐴− ) in upwind


manner, we have
𝜕𝐴 𝜕 (𝐴+ +𝐴− ) (𝐴+ + − −
𝑖 −𝐴𝑖−1 )+(𝐴𝑖+1 −𝐴𝑖 )
(𝜕𝑥 ) = [ ] = + 𝑂(∆𝑥) (A6.35)
𝑖 𝜕𝑥 𝑖 ∆𝑥
Notes:

The linearization procedure in Eq. (12.12) and (12.13) would not

influence the accuracy of the solution at all. The reason for the

linearization is to express the LHS of the final equation in block tri-

diagonal system to speed up the computation time.

Assembly of the Equations:

After combining all the terms, we obtain the following block tri-

diagonal system of equations.

𝐶̂𝑖 𝛿𝑈
⃑⃑𝑖−1
𝑛
+ 𝐴̂𝑖 𝛿𝑈
⃑⃑𝑖𝑛 + 𝐵̂𝑖 𝛿𝑈
⃑⃑𝑖+1
𝑛 ⃑⃑𝑖𝑛
= ∆𝑈 (A6.35a)
with
∆𝑡
𝐶̂𝑖 = − ∆𝑥 𝐴+
𝑖−1 (A6.35b)
∆𝑡
𝐴̂𝑖 = [𝑆𝐼 + ∆𝑥 (𝐴+ −
𝑖 − 𝐴𝑖 ) − 𝐵𝑖 ∆𝑡] (A6.35c)
∆𝑡
𝐵̂𝑖 = ∆𝑥 𝐴−
𝑖+1 (A6.35d)
⃑⃑𝑖𝑛 = − ∆𝑡 (𝐹⃑𝑖+ − 𝐹⃑𝑖−1
∆𝑈 +
+ ⃑𝑖+1
𝐹 −
− ⃑𝑖− ) + ∆𝑡𝐻
𝐹 ⃑⃑𝑖 (A6.35d)
∆𝑥

Question: What is the difference between the explicit SW (Eq. A6.24)

and Eq. (A6.36) ?

Ans: The only difference is on the LHS of the equations.


Sec. Flux Vector Split Method: Finite Volume Version

Advantage of Finite Volume over Finite Difference:

We will discuss the advantage of finite volume (FV) in more detail

later. Briefly speaking, FV has better flux balancing physically and

handle boundary conditions easier.


The PDE in Eq. (12.8) is integrated over 𝑥 from 𝑥𝑖−1/2 to

𝑥𝑖+1/2 .
𝑖+1/2
𝜕(𝑆𝑈⃑⃑) 𝑖+1/2 ⃑
𝜕𝐹 𝑖+1/2
∫ 𝑑𝑥 + ∫ 𝑑𝑥 = ∫ ⃑⃑𝑑𝑥
𝐻
𝑖−1/2 𝜕𝑡 𝑖−1/2 𝜕𝑥 𝑖−1/2

Applying Divergence theorem to the above equation, it yields


⃑̅⃑ )
𝜕(𝑆𝑈
∆𝑥𝑖 ⃑̅⃑
+ (𝐹⃑𝑖+1/2 − 𝐹⃑𝑖−1/2 ) = 𝐻 (B.1a)
𝜕𝑡 𝑖

In which 𝑉𝑖,𝑗 is volume of the mesh at coordinate 𝑥𝑖 and


⃑̅⃑ = 1 ∫ 𝑈
𝑈 ⃑⃑ 𝑑𝑥 (B.1b)
∆𝑥 𝑖
⃑̅⃑ = 1
𝐻 ⃑⃑ 𝑑𝑥
∫𝐻 (B.1c)
∆𝑥𝑖

Equation (B.1) is still exact, no numerical approximation has been

made so far. We begin to approximate Eq. (B.1)


⃑̅⃑ and 𝐻
⃑⃑𝑖,𝑗 ≈ 𝑈
𝑈 ⃑̅⃑
⃑⃑𝑖,𝑗 ≈ 𝐻
𝑖,𝑗 𝑖,𝑗

Substitute the above equations into Eq. (B.1), it yields


⃑⃑𝑖,𝑗 )
𝜕(𝑆𝑈 1
+ ∆𝑥 (𝐹⃑𝑖+1/2 − 𝐹⃑𝑖−1/2 ) = 𝐻
⃑⃑𝑖 (B.2)
𝜕𝑡 𝑖

Now we approximate the derivatives


⃑⃑𝑖,𝑗 )
𝜕(𝑆𝑈
𝜕𝑡
Approximation of Time derivative:
⃑⃑)
𝜕(𝑆𝑈 ⃑⃑ 𝑛+1 −𝑈
𝑆(𝑈 ⃑⃑ 𝑛 )
= + 𝑂(∆𝑡) (B.3)
𝜕𝑡 ∆𝑡
For convenience, define
⃑⃑ 𝑛 = 𝑈
𝛿𝑈 ⃑⃑ 𝑛+1 − 𝑈
⃑⃑ 𝑛 (B.4)
Substitution of Eq. (A6.14) into Eq. (A6.13), it yields
⃑⃑)
𝜕(𝑆𝑈 ⃑⃑ 𝑛 )
𝛿(𝑆𝑈
= + 𝑂(∆𝑡) (B.5)
𝜕𝑡 ∆𝑡
Linearization of the Flux and Source term:

The flux vector 𝐹⃑ 𝑛+1 is linearized as follows.


𝜕𝐹⃑ 𝑛
𝐹⃑ 𝑛+1 = 𝐹⃑ 𝑛 + 𝜕𝑡 ∆𝑡 + 𝑂(∆𝑡 2 ) (B.5)
𝜕𝐹⃑ 𝑛
The term in (B.5) can be written as
𝜕𝑡
𝑛 ⃑⃑
𝜕𝐹⃑ 𝑛 𝜕𝐹⃑ 𝜕𝑈 ⃑⃑ 𝑛
𝛿𝑈
= ( ⃑⃑) ≅ 𝐴𝑛 (B.6)
𝜕𝑡 𝜕𝑈 𝜕𝑡 ∆𝑡

Combine Eq. (B.5) and (B.6), we obtain

𝐹⃑ 𝑛+1 = 𝐹⃑ 𝑛 + 𝐴𝑛 𝛿𝑈
⃑⃑ 𝑛 (12.12)
Likewise,
⃑⃑𝑛+1 = 𝐻
𝐻 ⃑⃑𝑛 + 𝐵𝑛 𝛿𝑈
⃑⃑ 𝑛 (12.13)
Approximation of the flux vector at 𝑖 − 1/2 and 𝑖 + 1/2:

Recall that 𝐹⃑ = 𝐹⃑ + + 𝐹⃑ − , then


𝐹⃑𝑖+1/2 = 𝐹⃑𝑖+1/2
+
+ 𝐹⃑𝑖+1/2

(B.7)
, and
𝑛+1 𝑛
(𝐹⃑𝑖+1/2
+
) = (𝐹⃑𝑖+1/2
+ ⃑⃑ 𝑛 ]
) + [(𝐴+ )𝑛 𝛿𝑈 𝑖+1/2
(B.8a)
𝑛+1 𝑛
(𝐹⃑𝑖+1/2

) = (𝐹⃑𝑖+1/2
− ⃑⃑ 𝑛 ]
) + [(𝐴− )𝑛 𝛿𝑈 𝑖+1/2
(B.8b)
𝑛+1 𝑛
(𝐹⃑𝑖−1/2
+
) = (𝐹⃑𝑖−1/2
+ ⃑⃑ 𝑛 ]
) + [(𝐴+ )𝑛 𝛿𝑈 𝑖−1/2
(B.8c)
𝑛+1 𝑛
(𝐹⃑𝑖+1/2

) = (𝐹⃑𝑖−1/2
− ⃑⃑ 𝑛 ]
) + [(𝐴− )𝑛 𝛿𝑈 𝑖−1/2
(B.8d)

Equate Eq. (B.2), (B.5), (12.13), and (B.8), it yields


⃑⃑ 𝑛 )
𝛿(𝑆𝑈 1 𝑛 𝑛
+ ∆𝑥 {(𝐹⃑𝑖+1/2
+ ⃑⃑ 𝑛 ]
) + [(𝐴+ )𝑛 𝛿𝑈 𝑖+1/2
+ (𝐹⃑𝑖+1/2

) +
∆𝑡
𝑛 𝑛
⃑⃑ 𝑛 + −
[(𝐴− )𝑛
𝛿𝑈 ]𝑖+1/2 − (𝐹⃑𝑖−1 ) − [(𝐴+ )𝑛 ⃑⃑ 𝑛
𝛿𝑈 ]𝑖−1 − (𝐹⃑𝑖−1 ) −
2 2 2

⃑⃑ 𝑛 ]
[(𝐴− )𝑛 𝛿𝑈 = ⃑⃑𝑖𝑛 + 𝐵𝛿𝑈
𝐻 ⃑⃑𝑖𝑛 } (B.9)
𝑖−1/2

First Order Upwind Approximation for the State Vector:


𝑛
⃑⃑ 𝑛 ]
[(𝐴+ )𝑛 𝛿𝑈 ≅ (𝐴+ ⃑⃑
𝑖+1/2 𝛿𝑈𝑖 ) (B.10a)
𝑖+1/2
𝑛
⃑⃑ 𝑛 ]
[(𝐴− )𝑛 𝛿𝑈 ≅ (𝐴− ⃑⃑
𝑖+1/2 𝛿𝑈𝑖+1 ) (B.10b)
𝑖+1/2
𝑛
⃑⃑ 𝑛 ]
[(𝐴+ )𝑛 𝛿𝑈 ≅ (𝐴+ ⃑⃑
𝑖−1/2 𝛿𝑈𝑖−1 ) (B.10c)
𝑖−1/2
𝑛
⃑⃑ 𝑛 ]
[(𝐴− )𝑛 𝛿𝑈 ≅ (𝐴− ⃑⃑
𝑖−1/2 𝛿𝑈𝑖 ) (B.10d)
𝑖−1/2

Assembly of the Equations:

Substitute Eq. (B.10) into (B.9), equations becomes

𝐶̂𝑖 𝛿𝑈
⃑⃑𝑖−1
𝑛
+ 𝐴̂𝑖 𝛿𝑈
⃑⃑𝑖𝑛 + 𝐵̂𝑖 𝛿𝑈
⃑⃑𝑖+1
𝑛 ⃑⃑𝑖𝑛
= ∆𝑈 (B.11)
with
∆𝑡
𝐶̂𝑖 = − ∆𝑥 𝐴+
𝑖−1/2 (B.12a)
∆𝑡
𝐵̂𝑖 = ∆𝑥 𝐴−
𝑖+1/2 (B.12b)
∆𝑡
𝐴̂𝑖 = [𝑆𝐼 + ∆𝑥 (𝐴+ −
𝑖+1/2 − 𝐴𝑖−1/2 ) − 𝐵𝑖 ∆𝑡] (B.12c)
𝑛
⃑⃑𝑖𝑛 = − ∆𝑡 {𝐹⃑𝑖+1/2
∆𝑈 +
+ ⃑𝑖+1/2
𝐹 −
− ⃑𝑖−1/2
𝐹 +
− ⃑𝑖−1/2
𝐹 − ⃑⃑𝑖 } (B.12d)
+ ∆𝑡𝐻
∆𝑥

(a) Steger-Warming Method:

It is required to further approximate the terms in Eq. (B.12) at


interface 𝑖 + 1/2 and 𝑖 + 1/2 since information is stored at grid

point 𝑖 ∈ 𝑁. Upwind method is applied to approximate these terms.


Then
𝐴+ + + + − − − −
𝑖+1/2 ≅ 𝐴𝑖 , 𝐴𝑖−1/2 ≅ 𝐴𝑖−1 , 𝐴𝑖+1/2 ≅ 𝐴𝑖+1 , 𝐴𝑖−1/2 ≅ 𝐴𝑖 (B.13)

(b) Modified Steger-Warming Method:

The Steger-Warming flux vector splitting may be too dissipative for

viscous flow (MacCormack). Its modified version (still first order)

can be applied to improve the accuracy.

Define
⃑⃑𝑖+1/2 = 1 (𝑈
𝑈 ⃑⃑𝑖 + 𝑈
⃑⃑𝑖+1 ),
2

then

𝐴+ + ⃑⃑
𝑖+1/2 ≅ 𝐴𝑖+1/2 (𝑈𝑖+1/2 )
Term Project:

The nozzle shape is given by

𝑆(𝑥 ) = 1 + 2.2(𝑥 − 1.5)2 , 0 ≤ 𝑥 ≤ 3 (P.1)

Fluid parameters:

specific gas constant: 𝑅 = 287 (J/(kg ∙ K)


C𝑝
ratio of specific heats: 𝛾 = = 1.4
C𝑣
𝑅
specific heat ratio at constant volume: C𝑣 = 𝛾−1

specific heat ratio at constant volume: C𝑝 = C𝑣 + 𝑅

speed of sound: c = √𝛾𝑅𝑇


perfect gas: 𝑝 = 𝜌𝑅𝑇

Reservoir Conditions: 𝑝01 = 105 𝑁/𝑚2 (total pressure), 𝑇0 = 300𝐾


𝑃𝑒 𝐴𝑒
Boundary Conditions: = 0.6784, = 5.95
𝑃01 𝐴𝑡

The subscript "𝑜" (letter not zero!) represents the reservoir condition.
Initial Conditions:

𝑝𝑖 = 𝑝01 , 𝑖 = 1: 𝐼 − 1; 𝑝𝑖 = 𝑃𝑒

𝑇𝑖 = 𝑇01 𝑖 = 1: 𝐼

𝑢 = 0; 𝑖 = 1: 𝐼

Controlling Parameters:

(1) ∆𝑥 = 0.1, 𝐶𝐹𝐿 = 0.5, and number of iterations = 2000.

(2) ∆𝑥 = 0.05, 𝐶𝐹𝐿 = 0.5, and number of iterations = 4000.


Analytic Results: (A. Ch7.6)

The superscript " ∗ " being the sonic condition (choke).

subscript "𝑜1 " and "𝑜2 " are the reservoir conditions ahead and after
the shock respectively. If The flow is isentropic (no shock), then
𝑃01 = 𝑃0 2 , 𝑇01 = 𝑇0 2 , etc. However, when normal shock (normal to

the direction of the flow), it is a non-isentropic flow. The entropy

suddenly increases at the shock (physically, the shock width is

extremely thin, and is treated as zero mathematically). We then have

two reservoir conditions.


(1) 𝑝01 ≠ 𝑝0 2 , 𝑇01 ≠ 𝑇0 2 , ⋯

(2) The sonic condition 𝐴1∗ ≠ 𝐴∗2


In this project: (see the figure below)
𝑝𝑒
> 0.93 ⇒ purely subsonic flow through the nozzle
𝑃0
𝑝𝑒
< 0.016 ⇒ isentropic subsonic - supersonic flow
𝑃0

The pressure ratio


𝑝𝑒
0.016 < = 0.6784 < 0.93
𝑝01
The flow is subsonic – supersonic with a normal shock at the
divergent part of the nozzle

Let, i.e., 𝑀∗ = 1, which is always located at the throat of nozzle.


The Area Mach number relation can be found as
𝛾+1
𝐴 2 1 2 𝛾−1 𝛾−1
(𝐴∗) = 𝑀2 [𝛾+1 (1 + 𝑀2 )] (P.2)
2
−𝛾
𝑝 𝛾−1 𝛾−1
= [1 + 𝑀2] (P.3)
𝑝0 2

𝑇 𝛾−1 −1
2
= [1 + 𝑀 ] (P.4)
𝑇0 2
−1
𝜌 𝛾−1 𝛾−1
= [1 + 𝑀2] (P.5)
𝜌0 2

When flow is isentropic, we can define the sonic condition (e.g. 𝐴∗ ).

When sonic condition occurs, substitute 𝑀 = 𝑀 ∗ = 1 into Eq. (P.2),

𝐴 = 𝐴∗ (Note 𝐴1∗ ≠ 𝐴∗2 for non-isentropic flow as in the normal


shock case). The analytic solutions are written as follows.
𝑝02
Total pressure ratio is = 0.6882.
𝑝01
𝑥
Shock is located at = 2.1
𝐿

The flow variable across the shock are


𝑝2
= 4.83 𝑀1 = 2.07, 𝑀2 = 0.566
𝑝1

Exit Mach number is 𝑀𝑒 = 0.1431,


Eq. (P.2) to Eq. (P.5) are applied to compute flow variable ahead and

after the shock separately.

You might also like