Propagating of shock waves in an ideal gas I am studying gas dynamics and I want to numerically calculate the propagation of a shock wave in an ideal gas.
The problem statement is something like this:
The ideal gas is located in the region $-\infty<x<\infty$. We will give kinetic energy to some area for example: $0<x<1$. So, we have a boundary with a break in the normal component of the velocity.
I would like to know how to compose an equations for this problem in order to solve it numerically later.
P.s. Also, I'd like to read something about this theme.
 A: You would be interested in the Eulerian hydrodynamics equations, which are a simplification of the Navier-Stokes equations under the assumption of zero viscosity. In conservation form, this would be expressed as,
\begin{align}
  \partial_t\rho+\nabla\cdot(\rho\mathbf{u}) &= 0 \\
  \partial_t(\rho\mathbf u)+\nabla\cdot(\rho\mathbf{uu}+p\mathbf{I}) &= 0 \\
  \partial_tE+\nabla\cdot(\mathbf{u}\left(E+p\right)) &=0
\end{align}
where $\rho$ is the density, $\mathbf{u}$ the velocity, $p$ the pressure, $\mathbf{I}$ the identity matrix and $E$ the total energy. The pressure and total energy are related via the closure condition,
$$E=\frac{p}{\gamma-1}+\frac{1}{2}\rho u^2$$
In order to solve this system of equations, you need to use a discrete derivative like finite difference, finite volume or finite element method. Due to the discontinuity/shock you'd develop, FEM might be one option to avoid as it isn't nearly as easy to work with as compared to FDM/FVM when such a case arises.
In one dimension, we let a generic variable transform from continuous to discrete via
$$\phi(x,\,t)\to\phi(x_i,\,t^n)\equiv\phi_i^n.$$
And then we would use these in our PDEs to obtain a discrete PDE; for instance, the conservation of mass would take the form,
$$\frac{\rho_i^{n+1}-\rho_i^n}{t^{n+1}-t^n}+\frac{1}{2}\frac{\rho_{i+1}^nu_{i+1}^n-\rho_{i-1}^nu_{i-1}^n}{x_{i+1}-x_{i-1}}=0$$
where I'm assuming a central difference scheme in space and a forward difference in time (my experience is this way, at least; you could go other ways with other complications to deal with).
After writing out the full set of discrete PDEs, you would be able to plug it into any programming language that supports vectors/arrays/lists (while languages like Python might be good for quick development, it'll necessarily be slower than using a compiled language like C/C++, Rust or Fortran).

If you are interested in developing a fluid solver, probably the best book you could peruse for help would be Randy LeVeque's Finite Volume Methods for Hyperbolic Problems, which covers all of the math and numerical aspects of such problems using the finite volume method (which helps smooth out jumps in the domain that finite difference method cannot handle well).
