# Conservatives in shock tube

We know shock tube problem will give discontinuous solution of primitive variables ($\rho$, $v$, $p$). Will it give discontinuous result in flux terms? $F =[\rho u, \rho u^2 +p, \rho e_v]^T$. I tried that on one FORTRAN code of analytical solution on shock tube problem. I have plotted $\rho u$ in the following figure Here all the flux quantities are having discontinuity. In gas dynamics for steady 1D flow one of the governing equations is $\rho_1u_1= \rho_2u_2$, but the figure doesn't show such phenomena.

Is it because shock tube problem is transient and equation $\rho_1u_1= \rho_2u_2$ is steady?

If so, then how to quantify conservativeness in analytical solution?

Will it give discontinuous result in flux terms?

Yes, the flux terms in general may be discontinuous.

Is it because shock tube problem is transient and equation $\rho_1 u_1= \rho_2 u_2$ is steady?

I believe the "governing equation" you are referring to with $\rho_1 u_1 = \rho_2 u_2$ is part of the Rankine-Hugoniot jump conditions. This form is only valid for a stationary shock. For a general case with a (potentially) moving shock this becomes

$$u_s (\rho_2 - \rho_1) = \rho_2 u_2 - \rho_1 u_1$$

If so, then how to quantify conservativeness in analytical solution?

The terms which are temporally conserved are the conserved variables set integrated over the entire domain (mass density, momentum density, total energy density): $[\rho, \vec{p}, e]$ where $\vec{p} = \rho \vec{u}$ and $e = \frac{P}{\gamma - 1} + \frac{1}{2} \rho \vec{u} \cdot \vec{u}$.

Note that you need to be careful about what happens at the boundaries, as it's quite easy for the boundaries to be non-conserving (for example, if you use Dirichlet boundary conditions and force a certain $\rho$, $\vec{p}$, and $e$ at the wall).

You could also try evaluating all of the Rankine-Hugoniot jump conditions locally in the domain, and how well these relations hold will give you some indication of if your solution is correct or not. This method should be independent of boundary condition issues, though I'm not sure this method necessarily demonstrates conservation of mass/momentum/energy of the solution.