# Euler Equations  

The Euler equations in one-dimension are given by the following set of partial differential equations representing the conservation of mass, momentum, and energy.

$$
\begin{align}
& \frac{\partial \rho}{\partial t} + \frac{\partial \rho u}{\partial x} = 0 \\
& \frac{\partial \rho u}{\partial t} + \frac{\partial (\rho u^2 + p)}{\partial x} = 0 \\
& \frac{\partial \rho e}{\partial t} + \frac{\partial}{\partial x}\Bigg[ \left(e + p\right)u \Bigg] = 0
\end{align}
$$

The Euler equations can be written in vector form as

$$
\frac{\partial \mathbf{U} }{\partial t} + \frac{\partial \mathbf{F}}{\partial x} = 0
$$

where 

$$
\mathbf{U} = \begin{bmatrix}
\rho \\
\rho u \\
e 
\end{bmatrix}
$$

and

$$
\mathbf{F} = \begin{bmatrix}
\rho u\\
\rho u^2 + p \\
 u (e + p)
\end{bmatrix}
$$

with 

$$
p = (\gamma - 1)\left(e - \rho \frac{u^2}{2}\right)
$$

where the vector $\mathbf{U}$ is a vector of the conservative variables, and the vector $\mathbf{F}$ is the net flux of those conservative variables in and out of the control volume.

We want to be able to relate the vector form of the Euler equations to our model hyperbolic PDE; however, for this PDE, we have the partial derivative of $\mathbf{U}$ with time, but instead of $\mathbf{U}$, the partial derivative with respect to $x$ is the function, $\mathbf{F}$. 

## Homogeneous of Degree p

Consider $\mathbf{F} = \mathbf{F}(\mathbf{U})$, where $\mathbf{F}$ is a function of the elements of $\mathbf{U}$. Let $\mathbf{U}^{\prime} = \alpha \mathbf{U}$, then the following statement is true, 

$$
\mathbf{F}(\mathbf{U}^{\prime}) = \alpha^p \mathbf{F}(\mathbf{U}),
$$

if and only if $\mathbf{F}$ is homogenous of degree $p$ with respect to $\mathbf{U}$. 

## Euler Equations are Homogeneous with p = 1


Using this theorem, we can state that if $\mathbf{F}$ in the Euler equations, 

$$
\frac{\partial \mathbf{U} }{\partial t} + \frac{\partial \mathbf{F}}{\partial x} = 0
$$

is homogenous of degree $p=1$ with respect to $\mathbf{U}$, then

$$
\frac{\partial \mathbf{F}}{\partial \mathbf{U}}\mathbf{U} = \overline{\mathbf{A}} \mathbf{U} = \mathbf{F}
$$

where the matrix $\overline{\mathbf{A}}$ is called the Jacobian is defined as

$$
\overline{\mathbf{A}} = \frac{\partial \mathbf{F}}{\partial \mathbf{U}}
$$

and

$$
\frac{\partial \mathbf{U} }{\partial t} + \overline{\mathbf{A}} \frac{\partial \mathbf{U}}{\partial x} = 0
$$

### Example

Considering the following system of equations

$$
\frac{\partial \mathbf{U} }{\partial t} + \frac{\partial \mathbf{F}}{\partial x} = 0
$$

where

$$
\mathbf{F} = 
\begin{bmatrix}
\rho \\
\rho u^2 
\end{bmatrix}
$$

and 

$$
\mathbf{U} = 
\begin{bmatrix}
\rho \\
\rho u 
\end{bmatrix}
$$

compute the Jacobian matrix 

$$
\overline{\mathbf{A}} = \frac{\partial \mathbf{F}}{\partial \mathbf{U}}
$$

and demonstrate that $\mathbf{F} = \overline{\mathbf{A}} \mathbf{U}$.

### Solution

Writing this in component form, 

$$
\overline{\mathbf{A}} = \begin{bmatrix}
\frac{\partial f_1}{\partial u_1} \Big\rvert_{u_2} & \frac{\partial f_1}{\partial u_2} \Big\rvert_{u_1}\\
\frac{\partial f_2}{\partial u_1} \Big\rvert_{u_2} & \frac{\partial f_2}{\partial u_2} \Big\rvert_{u_1}
\end{bmatrix}
$$

where

$$
\overline{\mathbf{A}} = \begin{bmatrix}
\frac{\partial \rho}{\partial \rho}  \Big\rvert_{\rho u} & \frac{\partial \rho}{\partial (\rho u)} \Big\rvert_{\rho} \\
\frac{\partial \rho u^2}{\partial \rho} \Big\rvert_{\rho u} & \frac{\partial \rho u^2}{\partial (\rho u)} \Big\rvert_{\rho}
\end{bmatrix} 
= 
\begin{bmatrix}
1 & 0 \\
\frac{\partial }{\partial \rho} \left[ \frac{1}{\rho} (\rho u)^2 \right]_{\rho u} & \frac{\partial }{\partial (\rho u)} \left[ \frac{1}{\rho} (\rho u)^2 \right]_{\rho}
\end{bmatrix} 
$$

Simplifying this results in 

$$
\overline{\mathbf{A}} = 
\begin{bmatrix}
1 & 0 \\
-\frac{1}{\rho^2} (\rho u)^2 & \frac{1}{\rho} \left(2 \rho u \right)
\end{bmatrix}
= 
\begin{bmatrix}
1 & 0 \\
-u^2 & 2 u
\end{bmatrix} 
$$

and we can show that 

$$
 \begin{bmatrix}
\frac{\partial \rho }{\partial t} \\
\frac{\partial \rho u }{\partial t}
\end{bmatrix}
+ \begin{bmatrix}
1 & 0 \\
-\frac{1}{\rho^2} (\rho u)^2 & \frac{1}{\rho} \left(2 \rho u \right)
\end{bmatrix} \begin{bmatrix}
\frac{\partial \rho }{\partial x} \\
\frac{\partial \rho u }{\partial x}
\end{bmatrix}= 0
$$

# Euler Equations

To write the Euler equations in this form would require determining the Jacobian

$$
\overline{\mathbf{A}} = \begin{bmatrix}
\frac{\partial \rho u}{\partial \rho}  \Big\rvert_{\rho u,e} & 
\frac{\partial \rho u}{\partial (\rho u)} \Big\rvert_{\rho,e} &
\frac{\partial \rho u}{\partial e} \Big\rvert_{\rho,\rho u} \\
\frac{\partial \rho u^2 + p}{\partial \rho}  \Big\rvert_{\rho u,e} & 
\frac{\partial \rho u^2 + p}{\partial (\rho u)} \Big\rvert_{\rho,e} &
\frac{\partial \rho u^2 + p}{\partial e} \Big\rvert_{\rho,\rho u} \\
\frac{\partial (e + p)u}{\partial \rho}  \Big\rvert_{\rho u,e} & 
\frac{\partial (e + p)u}{\partial (\rho u)} \Big\rvert_{\rho,e} &
\frac{\partial (e + p)u}{\partial e} \Big\rvert_{\rho,\rho u}
\end{bmatrix} 
$$

Since evaluating this matrix is not straight-forward, let us apply a transformation of variables and write the Euler equations in primitve form using the vector of primitive variables 

$$
\mathbf{V} = 
\begin{bmatrix}
\rho \\
u \\
p
\end{bmatrix}
\qquad \textrm{and} \qquad
\mathbf{U} = 
\begin{bmatrix}
\rho u\\
\rho u^2 \\
e
\end{bmatrix}
$$

Let the matrix $\overline{\mathbf{T}}$ be the transformation Jacobian, which is defined as

$$
\overline{\mathbf{T}} = \frac{\partial \mathbf{U}}{\partial \mathbf{V}}
$$

Using the transformation Jacobian we can write

$$
\frac{\partial \mathbf{U}}{\partial \mathbf{V}} \frac{\partial \mathbf{V}}{\partial t} + \overline{\mathbf{A}} \left( \frac{\partial \mathbf{U}}{\partial \mathbf{V}} \frac{\partial \mathbf{V}}{\partial x} \right) = 0
$$

Multiply by the inverse of $\partial \mathbf{U} / \partial \mathbf{V}$, 

$$
\left( \frac{\partial \mathbf{U}}{\partial \mathbf{V}}\right)^{-1} \frac{\partial \mathbf{U}}{\partial \mathbf{V}} \frac{\partial \mathbf{V}}{\partial t} + \left( \frac{\partial \mathbf{U}}{\partial \mathbf{V}}\right)^{-1} \overline{\mathbf{A}} \left( \frac{\partial \mathbf{U}}{\partial \mathbf{V}} \frac{\partial \mathbf{V}}{\partial x} \right) = 0
$$

simplifying, 

$$
\frac{\partial \mathbf{V}}{\partial t} + \left[ \left( \frac{\partial \mathbf{U}}{\partial \mathbf{V}}\right)^{-1} \overline{\mathbf{A}} \frac{\partial \mathbf{U}}{\partial \mathbf{V}} \right] \frac{\partial \mathbf{V}}{\partial x} = 0
$$

which gives

$$
\frac{\partial \mathbf{V}}{\partial t} + \overline{\mathbf{A}^{\prime}} \frac{\partial \mathbf{V}}{\partial x} = 0
$$

where 

$$
\overline{\mathbf{A}^{\prime}} = \overline{\mathbf{T}}^{-1} \, \overline{\mathbf{A}} \, \overline{\mathbf{T}} 
$$

By induction, we can then define

$$
\overline{\mathbf{A}^{\prime}} =
\begin{bmatrix}
u & \rho & 0 \\
0 & u & \frac{1}{\rho} \\
0 & \gamma p & u \\
\end{bmatrix}
$$

where

$$
\begin{bmatrix}
\frac{\partial \rho }{\partial t} \\
\frac{\partial u }{\partial t} \\
\frac{\partial p}{\partial t} 
\end{bmatrix}
+
\begin{bmatrix}
u & \rho & 0 \\
0 & u & \frac{1}{\rho} \\
0 & \gamma p & u \\
\end{bmatrix}
\begin{bmatrix}
\frac{\partial \rho }{\partial x} \\
\frac{\partial u }{\partial x} \\
\frac{\partial p}{\partial x} 
\end{bmatrix}
 = 0
$$

### Proof

$$
\frac{\partial e }{\partial t} = \frac{\partial}{\partial t}\left[ \frac{p}{\gamma - 1} + \rho \frac{ u^2 }{2} \right]
$$

$$
\frac{\partial (e + p)u }{\partial x} = \frac{\partial}{\partial x}\left[ u \frac{p}{\gamma - 1} + \rho u \frac{ u^2 }{2} + p u\right] = \frac{\partial}{\partial x}\left[ p u \left( 1 + \frac{1}{\gamma - 1}\right) + \rho u \frac{ u^2 }{2} \right] = \frac{\partial}{\partial x}\left[ p u \frac{\gamma}{\gamma - 1} + \rho u \frac{ u^2 }{2} \right]
$$

Combining the terms

$$
\frac{\partial e }{\partial t} + \frac{\partial (e + p)u }{\partial x} = \frac{\partial}{\partial t}\left[ \frac{p}{\gamma - 1} + \rho \frac{ u^2 }{2} \right] + \frac{\partial}{\partial x}\left[ p u \frac{\gamma}{\gamma - 1} + \rho u \frac{ u^2 }{2} \right] = 0
$$

$$
\frac{\partial e }{\partial t} + \frac{\partial (e + p)u }{\partial x} = \frac{\partial}{\partial t}\left[ \frac{p}{\gamma - 1} \right]  + \frac{\partial}{\partial x}\left[ p u \frac{\gamma}{\gamma - 1} \right] + \frac{\partial}{\partial t}\left[ \rho \frac{ u^2 }{2} \right] + \frac{\partial}{\partial x}\left[\rho u \frac{ u^2 }{2} \right] = 0
$$

Using the chain rule, we know 

$$
\frac{\partial f(x^2)}{\partial x} = 2 x \frac{\partial f(x)}{\partial x} 
$$

which we can use to simplify the equation as follows

$$
\frac{\partial e }{\partial t} + \frac{\partial (e + p)u }{\partial x} = \frac{1}{\gamma - 1} \left( \frac{\partial p}{\partial t} +  \frac{\partial \gamma p u }{\partial x} \right) + u \frac{\partial (\rho u)}{\partial t} + u \frac{\partial \rho u^2 }{\partial x} = 0
$$

and factoring

$$
\frac{\partial e }{\partial t} + \frac{\partial (e + p)u }{\partial x} = \frac{1}{\gamma - 1} \left( \frac{\partial p}{\partial t} + \frac{\partial \gamma p u }{\partial x} \right) + u \left( \frac{\partial (\rho u)}{\partial t} + \frac{\partial \rho u^2 }{\partial x} \right) = 0
$$

then using the fact that 

$$
\frac{\partial (\rho u)}{\partial t} + \frac{\partial \rho u^2  + p}{\partial x} = 0
$$

we can rewrite the equation about adding and subtracting $\frac{\partial p }{\partial x}$ term, 

$$
\frac{\partial e }{\partial t} + \frac{\partial (e + p)u }{\partial x} = \frac{1}{\gamma - 1} \left( \frac{\partial p}{\partial t} +  \frac{\partial \gamma p u }{\partial x} \right) + u \left( \frac{\partial (\rho u)}{\partial t} + \frac{\partial (\rho u^2 + p)}{\partial x}  - \frac{\partial p}{\partial x} \right) = 0
$$


we get the conservation of energy in the primitive form as

$$
\frac{\partial p}{\partial t} + \frac{\partial ( \gamma  p u) }{\partial x} - u (\gamma - 1) \frac{\partial p }{\partial x} = 0
$$

expaning results in 

$$
\frac{\partial p}{\partial t} + u  \gamma \frac{\partial p }{\partial x} + \gamma p \frac{\partial u }{\partial x} - u \gamma \frac{\partial p }{\partial x} + u \frac{\partial p }{\partial x} = 0
$$

Finally,

$$
\frac{\partial p}{\partial t} + \gamma p \frac{\partial u }{\partial x} + u \frac{\partial p }{\partial x}= 0
$$





## One-dimensional Euler Equations

In conservative form, the one-dimensional Euler equations are 

$$
\frac{\partial \mathbf{U}}{\partial t} + \frac{\partial \mathbf{F}}{\partial x} = 0
$$

where 

$$
\mathbf{U} = \begin{bmatrix}
\rho \\
\rho u \\
e 
\end{bmatrix}
$$

and

$$
\mathbf{F} = \begin{bmatrix}
\rho u\\
\rho u^2 + p \\
 u (e + p)
\end{bmatrix}
$$

with 

$$
p = (\gamma - 1)\left(e - \rho \frac{u^2}{2}\right)
$$

Since the Euler equations are homogenous to degeree 1, we can write the same set of equations in terms of the Jacobian matrix $\mathbf{A}$, 

$$
\frac{\partial \mathbf{U}}{\partial t} + \overline{\mathbf{A}} \frac{\partial \mathbf{U}}{\partial x} = 0
$$

It is often more convenient to work with the primitive set of variables $(\rho, u, p)$ instead of the conservative variables. Using this set of variables, the Euler equations in terms of the primitive variables is written 

$$
\frac{\partial \mathbf{V}}{\partial t} + \overline{\mathbf{A}^{\prime}} \frac{\partial \mathbf{V}}{\partial x} = 0
$$

Note that this form of the equation is also referred to as the non-conservative form of the Euler equations though sometimes the entropy is used as the primitive variable instead of the pressure. The transformed Jacobian matrix is defined as

$$
\overline{\mathbf{A}^{\prime}} = \overline{\mathbf{T}}^{-1} \, \overline{\mathbf{A}} \, \overline{\mathbf{T}} 
$$

where

$$
\overline{\mathbf{A}^{\prime}} =
\begin{bmatrix}
u & \rho & 0 \\
0 & u & \frac{1}{\rho} \\
0 & \gamma p & u \\
\end{bmatrix}
$$



## Hyperbolic Requirement

The above equation is hyperbolic if the eigenvalues of the matrix $\overline{\mathbf{A}}$ or $\overline{\mathbf{A}^{\prime}}$ are real and have a complete set of eigenvectors (the matrix is diagonalizable). We can determine the eigenvalues by diagonalizing the matrix

$$
\Lambda = \overline{\mathbf{P}} \, \overline{\mathbf{A}^{\prime}} \, \overline{\mathbf{P}}^{-1} = 
\begin{bmatrix}
u & 0 & 0 \\
0 & u + c& 0 \\
0 & 0& u -c \\
\end{bmatrix}
$$

where

$$
\overline{\mathbf{P}} =
\begin{bmatrix}
1 & 0 & -\frac{1}{c^2} \\
0 & \rho c & 1 \\
0 & -\rho c& 1 \\
\end{bmatrix}
$$

and

$$
\overline{\mathbf{P}}^{-1} =
\begin{bmatrix}
1 & \frac{1}{c^2} & \frac{1}{c^2} \\
0 & \frac{1}{2\rho c} & -\frac{1}{2\rho c} \\
0 & \frac{1}{2} & \frac{1}{2} \\
\end{bmatrix}
$$

f1077e8bf23a015fda2b46062b69d368c23b1c67
ipynb
Jupyter Notebook
Notebooks/Euler/2-EulerEquations-HyperbolicPDE-Part2.ipynb
jcschulz/ae269
5c467a6e70808bb00e27ffdb8bb0495e0c820ca0
MIT
Notebooks/Euler/2-EulerEquations-HyperbolicPDE-Part2.ipynb
jcschulz/ae269
5c467a6e70808bb00e27ffdb8bb0495e0c820ca0
MIT
Notebooks/Euler/2-EulerEquations-HyperbolicPDE-Part2.ipynb
jcschulz/ae269
5c467a6e70808bb00e27ffdb8bb0495e0c820ca0
MIT
Qwen/Qwen-72B
1. YES
2. YES