Initialize a traveling wave in a 1D gas? I am trying to initialize a traveling wave for a 1d simulation as one can see from the attached figure.

Such that it will be traveling to the right. 
However, I cannot initialize the right velocity profile, and this makes the initial pressure distribution tends to be more uniform to reach the same pressure of the surrounding fluid !
Can any one provide some support?
 A: We are trying to get the simple wave solution, so one can assume the dependence of the functions defining the solution (namely $u$, $p$ and $\rho$) only on a single combination of variables $x$ and $t$. In case of weak sound wave this combination would be $x - c t$, but nonlinear effects would makes this more complicated. Nevertheless, we still can choose one of the functions, for example $\rho$, as an independent variable on which the other two would depend and write 
$$
\rho = \rho(x,t),\quad p= p(\rho), \quad  u = u(\rho) .
$$
We can than substitute these into continuity equation and Euler equation:
$$
\dot{\rho}+\rho' u + \rho \frac{d u}{d\rho} \rho ' = 0, \tag{1}
$$
$$
\frac{du}{d\rho}\dot{\rho}+ u \frac{du}{d\rho} \rho' + \frac{c^2(\rho)}{\rho}\rho ' =0,\tag{2}
$$
where $\rho'= \dfrac{\partial \rho}{\partial x}$, $\dot{\rho}= \dfrac{\partial \rho}{\partial t}$. The local speed of sound is defined by $c^2(\rho)= \dfrac{d p}{d \rho}$ and could be found using adiabatic equation for an ideal gas.
For the initial conditions on the velocity $u$ we could solve (1) and (2) for $\frac{du}{d\rho}$ (also eliminating $\dot{\rho}$):
$$
\dfrac {du}{d\rho} = \pm \frac{c(\rho)}{\rho},
$$
where two sign choices correspond to simple waves traveling to the right (+) and left (-). Integrating we obtain:
$$
 u = \pm \int \frac{c}{\rho} d\rho = \pm \int \frac{dp}{\rho c}.
$$
The final explicit result could be obtained by using the adiabatic process equation: $p \rho^{-\gamma}= p_0 \rho_0^{-\gamma}$.
