# Matrix-Vector Form of the Euler Equations#

date:

2015/4/21, 2015/4/27

My online note for the Euler equations in the useful form.

## Governing Equations#

The Euler equations consist of the mass conservation

(1)#\begin{align}\begin{aligned}\newcommand{\bvec}[1]{\mathbf{#1}} \newcommand{\defeq}{\buildrel{\text{def}}\over{=}} \newcommand{\dpd}[3][]{\mathinner{ \dfrac{\partial{^{#1}}#2}{\partial{#3^{#1}}} }}\\\frac{\partial\rho}{\partial t} + \frac{\partial\rho v_j}{\partial x_j} = 0\end{aligned}\end{align}

momentum conservation

(2)#$\frac{\partial\rho v_i}{\partial t} + \frac{\partial\rho v_iv_j}{\partial x_j} = \frac{\partial p}{\partial x_j} + \rho b_i$

and energy conservation

(3)#$\frac{\partial}{\partial t} \left[\rho\left( e + \frac{v_k^2}{2} \right)\right] + \frac{\partial}{\partial x_j} \left[\rho\left( e + \frac{v_k^2}{2} \right)v_j\right] = \rho \dot{q} - \frac{\partial pv_j}{\partial x_j} + \rho b_jv_j$

Einstein’s index summation convention was used.

Equations (1), (2), and (3) aren’t closed even if we choose $$\bvec{b}$$ and $$\dot{q}$$ as given. We have 5 equtions but 6 unknowns ($$\rho$$, $$\bvec{v}$$, $$p$$, and $$e$$). To close the system of equations, I use the equation of state:

(4)#$p = \rho RT$

Internal energy is related to temperature:

(5)#$e = c_vT = \frac{RT}{\gamma-1} = \frac{1}{\gamma-1}\frac{p}{\rho}$

With the additional two equations (Eqs. (4) and (5)) and one variable $$T$$, the equations are closed.

## Vector Flux Function#

Define the conservation variables:

(6)#$\begin{split}\bvec{u} \defeq \left(\begin{array}{c} u_1 \\ u_2 \\ u_3 \\ u_4 \\ u_5 \end{array}\right) = \left(\begin{array}{c} \rho \\ \rho v_1 \\ \rho v_2 \\ \rho v_3 \\ \rho\left(e+\frac{v_k^2}{2}\right) \end{array}\right)\end{split}$

Aided by writing the pressure with $$\bvec{u}$$:

$p = (\gamma-1)\left(u_5 - \frac{u_2^2+u_3^2+u_4^2}{2u_1}\right)$

the conservation equations (Eqs. (1), (2), and (3)) can be cast to use only $$\bvec{u}$$:

(7)#$\frac{\partial u_1}{\partial t} + \frac{\partial u_2}{\partial x_1} + \frac{\partial u_3}{\partial x_2} + \frac{\partial u_4}{\partial x_3} = 0$
(8)#\begin{split}\begin{aligned} &\frac{\partial u_2}{\partial t} + \frac{\partial}{\partial x_1}\left(\frac{u_2^2}{u_1}\right) + \frac{\partial}{\partial x_2}\left(\frac{u_2u_3}{u_1}\right) + \frac{\partial}{\partial x_3}\left(\frac{u_2u_4}{u_1}\right) = \\ &\quad -\frac{\partial}{\partial x_1}\left[ (\gamma-1)\left(u_5 - \frac{u_2^2+u_3^2+u_4^2}{2u_1}\right) \right] + b_1u_1 \end{aligned}\end{split}
(9)#\begin{split}\begin{aligned} &\frac{\partial u_3}{\partial t} + \frac{\partial}{\partial x_1}\left(\frac{u_2u_3}{u_1}\right) + \frac{\partial}{\partial x_2}\left(\frac{u_3^2}{u_1}\right) + \frac{\partial}{\partial x_3}\left(\frac{u_3u_4}{u_1}\right) = \\ &\quad -\frac{\partial}{\partial x_2}\left[ (\gamma-1)\left(u_5 - \frac{u_2^2+u_3^2+u_4^2}{2u_1}\right) \right] + b_2u_1 \end{aligned}\end{split}
(10)#\begin{split}\begin{aligned} &\frac{\partial u_4}{\partial t} + \frac{\partial}{\partial x_1}\left(\frac{u_2u_4}{u_1}\right) + \frac{\partial}{\partial x_2}\left(\frac{u_3u_4}{u_1}\right) + \frac{\partial}{\partial x_3}\left(\frac{u_4^2}{u_1}\right) = \\ &\quad -\frac{\partial}{\partial x_3}\left[ (\gamma-1)\left(u_5 - \frac{u_2^2+u_3^2+u_4^2}{2u_1}\right) \right] + b_3u_1 \end{aligned}\end{split}
(11)#\begin{split}\begin{aligned} &\frac{\partial u_5}{\partial t} + \frac{\partial}{\partial x_1}\left(\frac{u_2u_5}{u_1}\right) + \frac{\partial}{\partial x_2}\left(\frac{u_3u_5}{u_1}\right) + \frac{\partial}{\partial x_3}\left(\frac{u_4u_5}{u_1}\right) = \\ &\quad - \frac{\partial}{\partial x_1}\left[ (\gamma-1)\left(u_5 - \frac{u_2^2+u_3^2+u_4^2}{2u_1}\right) \frac{u_2}{u_1} \right] \\ &\quad - \frac{\partial}{\partial x_2}\left[ (\gamma-1)\left(u_5 - \frac{u_2^2+u_3^2+u_4^2}{2u_1}\right) \frac{u_3}{u_1} \right] \\ &\quad - \frac{\partial}{\partial x_3}\left[ (\gamma-1)\left(u_5 - \frac{u_2^2+u_3^2+u_4^2}{2u_1}\right) \frac{u_4}{u_1} \right] + \rho\dot{q} + b_1u_2 + b_2u_3 + b_3u_4 \end{aligned}\end{split}

Then organize Eqs. (7)(11) into a vector form:

(12)#$\frac{\partial\bvec{u}}{\partial t} + \sum_{\mu=1}^3 \frac{\partial\bvec{f}^{(\mu)}}{\partial x_{\mu}} = \bvec{s}$

The flux functions are defined as:

(13)#$\begin{split}\bvec{f}^{(1)} &= \left(\begin{array}{c} f^{(1)}_1 \\ f^{(1)}_2 \\ f^{(1)}_3 \\ f^{(1)}_4 \\ f^{(1)}_5 \end{array}\right) \defeq \left(\begin{array}{l} u_2 \\ (\gamma-1)u_5 - \frac{\gamma-3}{2}\frac{u_2^2}{u_1} - \frac{\gamma-1}{2}\frac{u_3^2}{u_1} - \frac{\gamma-1}{2}\frac{u_4^2}{u_1} \\ \frac{u_2u_3}{u_1} \\ \frac{u_2u_4}{u_1} \\ \gamma\frac{u_2u_5}{u_1} - \frac{\gamma-1}{2}\frac{u_2^2+u_3^2+u_4^2}{u_1}\frac{u_2}{u_1} \end{array}\right)\end{split}$
(14)#$\begin{split}\bvec{f}^{(2)} &= \left(\begin{array}{c} f^{(2)}_1 \\ f^{(2)}_2 \\ f^{(2)}_3 \\ f^{(2)}_4 \\ f^{(2)}_5 \end{array}\right) \defeq \left(\begin{array}{l} u_3 \\ \frac{u_2u_3}{u_1} \\ (\gamma-1)u_5 - \frac{\gamma-1}{2}\frac{u_2^2}{u_1} - \frac{\gamma-3}{2}\frac{u_3^2}{u_1} - \frac{\gamma-1}{2}\frac{u_4^2}{u_1} \\ \frac{u_3u_4}{u_1} \\ \gamma\frac{u_3u_5}{u_1} - \frac{\gamma-1}{2}\frac{u_2^2+u_3^2+u_4^2}{u_1}\frac{u_3}{u_1} \end{array}\right)\end{split}$
(15)#$\begin{split}\bvec{f}^{(3)} &= \left(\begin{array}{c} f^{(3)}_1 \\ f^{(3)}_2 \\ f^{(3)}_3 \\ f^{(3)}_4 \\ f^{(3)}_5 \end{array}\right) \defeq \left(\begin{array}{l} u_4 \\ \frac{u_2u_4}{u_1} \\ \frac{u_3u_4}{u_1} \\ (\gamma-1)u_5 - \frac{\gamma-1}{2}\frac{u_2^2}{u_1} - \frac{\gamma-1}{2}\frac{u_3^2}{u_1} - \frac{\gamma-3}{2}\frac{u_4^2}{u_1} \\ \gamma\frac{u_4u_5}{u_1} - \frac{\gamma-1}{2}\frac{u_2^2+u_3^2+u_4^2}{u_1}\frac{u_4}{u_1} \end{array}\right)\end{split}$

At the right-hand side, the source term is

(16)#$\begin{split}\bvec{s} = \left(\begin{array}{c} s_1 \\ s_2 \\ s_3 \\ s_4 \\ s_5 \end{array}\right) \defeq \left(\begin{array}{l} 0 \\ b_1u_1 \\ b_2u_1 \\ b_3u_3 \\ \dot{q}u_1 + b_1u_2 + b_2u_3 + b_3u_4 \end{array}\right)\end{split}$

## Quasi-linear System Equation#

Expand Eq. (12) to an index form:

(17)#$\frac{\partial u_m}{\partial t} + \sum_{\mu=1}^3 \frac{\partial f^{(\mu)}_m}{\partial x_{\mu}} = s_m, \quad m = 1, \ldots, 5$

Because we want to construct an inviscid baseline solver, later we will drop the source term from Eq. (17).

Define

$\begin{split}u_{mt} &\defeq \dpd{u_m}{t}, \\ u_{mx_{\mu}} &\defeq \dpd{u_m}{x_{\mu}}, \\ f^{(\mu)}_{m,l} &\defeq \dpd{f^{(\mu)}_m}{u_l}\end{split}$

where $$\mu = 1, 2, 3,$$ and $$m, l = 1, 2, \ldots, 5$$.

Aided by the above definition, we rewrite the equation to a matrix-vector form:

(18)#$\dpd{\bvec{u}}{t} + \sum_{\mu=1}^3 \mathrm{A}^{(\mu)} \dpd{\bvec{u}}{x_{\mu}} = 0$

where $$\mathrm{A}^{(1)}$$, $$\mathrm{A}^{(2)}$$, and $$\mathrm{A}^{(3)}$$ are Jacobian matrices ($$\left[\mathrm{A}^{(\mu)}\right]_{ml} \defeq f^{(\mu)}_{m,l}$$). Components of the Jacobian matrices are tabulated.

Constant components:

(19)#$\begin{split}f^{(1)}_{1,1} &= f^{(1)}_{1,3} = f^{(1)}_{1,4} = f^{(1)}_{1,5} = \\ f^{(2)}_{1,1} &= f^{(2)}_{1,2} = f^{(2)}_{1,4} = f^{(2)}_{1,5} = \\ f^{(3)}_{1,1} &= f^{(3)}_{1,2} = f^{(3)}_{1,3} = f^{(3)}_{1,5} = 0, \\ f^{(1)}_{1,2} &= f^{(2)}_{1,3} = f^{(3)}_{1,4} = 1\end{split}$

Non-constant components of $$A^{(1)}$$:

(20)#$\begin{split}f^{(1)}_{2,1} &= \frac{\gamma-3}{2}\frac{u_2^2}{u_1^2} + \frac{\gamma-1}{2}\frac{u_3^2}{u_1^2} + \frac{\gamma-1}{2}\frac{u_4^2}{u_1^2}, \\ f^{(1)}_{2,2} &= -(\gamma-3)\frac{u_2}{u_1}, \quad f^{(1)}_{2,3} = -(\gamma-1)\frac{u_3}{u_1}, \quad f^{(1)}_{2,4} = -(\gamma-1)\frac{u_4}{u_1}, \quad f^{(1)}_{2,5} = \gamma-1, \\ f^{(1)}_{3,1} &= -\frac{u_2u_3}{u_1^2}, \quad f^{(1)}_{3,2} = \frac{u_3}{u_1}, \quad f^{(1)}_{3,3} = \frac{u_2}{u_1}, \quad f^{(1)}_{3,4} = f^{(1)}_{3,5} = 0, \\ f^{(1)}_{4,1} &= -\frac{u_2u_4}{u_1^2}, \quad f^{(1)}_{4,2} = \frac{u_4}{u_1}, \quad f^{(1)}_{4,4} = \frac{u_2}{u_1}, \quad f^{(1)}_{4,3} = f^{(1)}_{4,5} = 0, \\ f^{(1)}_{5,1} &= -\gamma\frac{u_2u_5}{u_1^2} + (\gamma-1)\frac{u_2^2+u_3^2+u_4^2}{u_1^2}\frac{u_2}{u_1}, \quad f^{(1)}_{5,2} = \gamma\frac{u_5}{u_1} - \frac{\gamma-1}{2}\frac{3u_2^2 + u_3^2 + u_4^2}{u_1^2}, \\ f^{(1)}_{5,3} &= -(\gamma-1)\frac{u_2u_3}{u_1^2}, \quad f^{(1)}_{5,4} = -(\gamma-1)\frac{u_2u_4}{u_1^2}, \quad f^{(1)}_{5,5} = \gamma\frac{u_2}{u_1}\end{split}$

Non-constant components of $$A^{(2)}$$:

(21)#$\begin{split}f^{(2)}_{2,1} &= -\frac{u_2u_3}{u_1^2}, \quad f^{(2)}_{2,2} = \frac{u_3}{u_1}, \quad f^{(2)}_{2,3} = \frac{u_2}{u_1}, \quad f^{(2)}_{2,4} = f^{(2)}_{2,5} = 0, \\ f^{(2)}_{3,1} &= \frac{\gamma-1}{2}\frac{u_2^2}{u_1^2} + \frac{\gamma-3}{2}\frac{u_3^2}{u_1^2} + \frac{\gamma-1}{2}\frac{u_4^2}{u_1^2}, \\ f^{(2)}_{3,2} &= -(\gamma-1)\frac{u_2}{u_1}, \quad f^{(2)}_{3,3} = -(\gamma-3)\frac{u_3}{u_1}, \quad f^{(2)}_{3,4} = -(\gamma-1)\frac{u_4}{u_1}, \quad f^{(2)}_{3,5} = \gamma-1, \\ f^{(2)}_{4,1} &= -\frac{u_3u_4}{u_1^2}, \quad f^{(2)}_{4,3} = \frac{u_4}{u_1}, \quad f^{(2)}_{4,4} = \frac{u_3}{u_1}, \quad f^{(2)}_{4,2} = f^{(2)}_{4,5} = 0, \\ f^{(2)}_{5,1} &= -\gamma\frac{u_3u_5}{u_1^2} + (\gamma-1)\frac{u_2^2+u_3^2+u_4^2}{u_1^2}\frac{u_3}{u_1}, \quad f^{(2)}_{5,3} = \gamma\frac{u_5}{u_1} - \frac{\gamma-1}{2}\frac{u_2^2 + 3u_3^2 + u_4^2}{u_1^2}, \\ f^{(2)}_{5,2} &= -(\gamma-1)\frac{u_2u_3}{u_1^2}, \quad f^{(2)}_{5,4} = -(\gamma-1)\frac{u_3u_4}{u_1^2}, \quad f^{(2)}_{5,5} = \gamma\frac{u_3}{u_1}\end{split}$

Non-constant components of $$A^{(3)}$$:

(22)#$\begin{split}f^{(3)}_{2,1} &= -\frac{u_2u_4}{u_1^2}, \quad f^{(3)}_{2,2} = \frac{u_4}{u_1}, \quad f^{(3)}_{2,4} = \frac{u_2}{u_1}, \quad f^{(3)}_{2,3} = f^{(3)}_{2,5} = 0, \\ f^{(3)}_{3,1} &= -\frac{u_3u_4}{u_1^2}, \quad f^{(3)}_{3,3} = \frac{u_4}{u_1}, \quad f^{(3)}_{3,4} = \frac{u_3}{u_1}, \quad f^{(3)}_{3,2} = f^{(3)}_{3,5} = 0, \\ f^{(3)}_{4,1} &= \frac{\gamma-1}{2}\frac{u_2^2}{u_1^2} + \frac{\gamma-1}{2}\frac{u_3^2}{u_1^2} + \frac{\gamma-3}{2}\frac{u_4^2}{u_1^2}, \\ f^{(3)}_{4,2} &= -(\gamma-1)\frac{u_2}{u_1}, \quad f^{(3)}_{4,3} = -(\gamma-1)\frac{u_3}{u_1}, \quad f^{(3)}_{4,4} = -(\gamma-3)\frac{u_4}{u_1}, \quad f^{(3)}_{4,5} = \gamma-1, \\ f^{(3)}_{5,1} &= -\gamma\frac{u_4u_5}{u_1^2} + (\gamma-1)\frac{u_2^2+u_3^2+u_4^2}{u_1^2}\frac{u_4}{u_1}, \quad f^{(3)}_{5,4} = \gamma\frac{u_5}{u_1} - \frac{\gamma-1}{2}\frac{u_2^2 + u_3^2 + 3u_4^2}{u_1^2}, \\ f^{(3)}_{5,2} &= -(\gamma-1)\frac{u_2u_4}{u_1^2}, \quad f^{(3)}_{5,3} = -(\gamma-1)\frac{u_3u_4}{u_1^2}, \quad f^{(3)}_{5,5} = \gamma\frac{u_4}{u_1}\end{split}$

## Nomenclature#

$$\bvec{x} \defeq (x_1, x_2, x_3)^t$$

Space vector.

$$t$$

Time.

$$\rho$$

Mass density.

$$\bvec{v} \defeq (v_1, v_2, v_3)^t$$

Flow velocity vector.

$$p$$

Pressure.

$$\bvec{b} \defeq (b_1, b_2, b_3)^t$$

Body force vector.

$$e$$

Internal energy density per unit mass.

$$\dot{q}$$

Heat generation rate per unit volume.

$$R$$

Universal gas constant.

$$T$$

Temperature.

$$c_v$$

Specific heat at constant volume.

$$c_p$$

Specific heat at constant pressure.

$$\gamma \defeq c_p/c_v$$

Ratio of specific heat.

$$\bvec{u} \defeq (u_1, u_2, u_3, u_4, u_5)^t$$

Conservation variables.

$$\bvec{f}^{(1)}, \bvec{f}^{(2)}, \bvec{f}^{(3)}$$

Vector flux functions. $$\bvec{f}^{(\mu)} \defeq (f^{(\mu)}_1, f^{(\mu)}_2, f^{(\mu)}_3, f^{(\mu)}_4, f^{(\mu)}_5)^t$$ where $$\mu = 1, 2, 3$$.

$$\bvec{s} \defeq (s_1, s_2, s_3, s_4, s_5)^t$$

Source term.

$$\mathrm{A}^{(1)}, \mathrm{A}^{(2)}, \mathrm{A}^{(3)}$$

Jacobian matrices.