To simulate the pressure wave generated by a train travelling through a tunnel, we implement a discontinuous Galerkin (DG) method for the solution of the one-dimensional equations of variable area flow. This formulation uses a spatial discretisation via Legendre polynomials of arbitrary degree, and the resulting semi-discrete system is integrated using an explicit Runge–Kutta scheme. A simulation of subsonic steady flow in a nozzle shows that the scheme produces stable solutions, without the need for artificial dissipation, and that its performance is optimal for polynomial degrees between 5 and 7. However, when dealing with an unsteady area, we report the presence of numerical oscillations that are not due to the steep pressure fronts in the flow but rather to the projection of a moving area, with piecewise continuous derivatives onto a fixed grid. We propose a reformulation of the DG method to eliminate these oscillations that, put in simple terms, amount to splitting the integrals where the derivatives of the cross-sectional area are discontinuous into subintegrals where they are continuous. The resulting method does not exhibit oscillations, and it is applied here to two practical cases involving train-induced pressure waves in a tunnel. The first application is a validation of the DG method through comparison of its computational results with pressure data measured during transit at the Patchway tunnel near Bristol (UK). The second application is a study of the influence of the nose shape and length on the pressure wave gradients responsible for sonic boom at tunnel exit portals to show that the proposed modification is able to deal with realistic train shapes. Copyright © 2012 John Wiley & Sons, Ltd.