Water hammer is an undesired hydraulic shock phenomenon in water supply pipe systems. It is very important to simulate water hammer for preventing the hazard of over pressure. In order to predict the transient pressure caused by a valve closing in a gravitational pipe with continuous air entrainment, a numerical model based on the Lax-Wendroff format is established, and the matched boundary model is provided. Compared with the traditional methods, this study provides another access by considering the influence of the pipe flow velocity on the wave propagation to simulate transient processes. A corresponding experiment is conducted to optimize the numerical model. Based on the experimental result, an additional friction function is proposed to evaluate the influence of the air content on the attenuation. The result shows that the energy dissipation of the shock waves may be underestimated in air-water mixture flow using the common steady friction. By introducing the additional friction function, the improved model can more accurately simulate the attenuation of the water hammer in the gravitational pipe with continuous air entrainment. As there are plenty of practical water supply systems running with air content, the improved Lax-Wendroff Method (LWM) is valued in accurately predicting water hammer processes especially in those conditions.