# 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.
{"ft_lang_label":"__label__en","ft_lang_prob":0.8929251,"math_prob":0.99507594,"size":1478,"snap":"2020-45-2020-50","text_gpt3_token_len":390,"char_repetition_ratio":0.10244233,"word_repetition_ratio":0.0,"special_character_ratio":0.25913396,"punctuation_ratio":0.086142324,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9986022,"pos_list":[0,1,2],"im_url_duplicate_count":[null,5,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-12-02T21:25:44Z\",\"WARC-Record-ID\":\"<urn:uuid:7cb9e810-4dbf-4351-98d0-8a708582ab00>\",\"Content-Length\":\"147231\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:96fc615a-b6be-4df7-a9ce-ffd10446d708>\",\"WARC-Concurrent-To\":\"<urn:uuid:81092b9c-0d86-438e-b2f3-97d7411fbf5f>\",\"WARC-IP-Address\":\"151.101.1.69\",\"WARC-Target-URI\":\"https://scicomp.stackexchange.com/questions/24610/conservatives-in-shock-tube/24611\",\"WARC-Payload-Digest\":\"sha1:NINWEH3HODPQUNXQLPSPI46RRWOWDDMZ\",\"WARC-Block-Digest\":\"sha1:YXLXGEYDDOPKYRWYRRF2KRBQYI4R5AR3\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-50/CC-MAIN-2020-50_segments_1606141716970.77_warc_CC-MAIN-20201202205758-20201202235758-00112.warc.gz\"}"}