We consider a chain of particles connected by an-harmonic springs, with a boundary force (tension) acting on the last particle, while the first particle is kept pinned at a point. The particles are in contact with stochastic heat baths, whose action on the dynamics conserves the volume and the momentum, while energy is exchanged with the heat baths in such way that, in equilibrium, the system is at a given temperature T . We study the space empirical profiles of volume stretch and momentum under hyperbolic rescaling of space and time as the size of the system growth to be infinite, with the boundary tension changing slowly in the macroscopic time scale. We prove that the probability distributions of these profiles concentrate on L 2 -valued weak solutions of the isothermal Euler equations (i.e. the non-linear wave equation, also called p-system), satisfying the boundary conditions imposed by the microscopic dynamics. Furthermore, the weak solutions obtained satisfy the Clausius inequality between the work done by the boundary force and the change of the total free energy in the system. This result includes the shock regime of the system.