A water hammer is an important natural phenomenon that can be used to fracture rock with enhanced local water pressure. The oscillatory injection of a column of water can be used to make a pipe water hammer. However, the optimal injection frequency to create a water hammer has not yet been found. The main reason for this is that the distribution of fluid pressure and its variation are unclear inside a pipe. In this study, we demonstrate for the first time that there can be significant supercharging phenomena and a law governing their appearance in a water-filled pipe. We first find the optimal pulse frequency to reproduce the supercharging process. We also clarify the supercharging mechanism at an optimal frequency. First, a simplified pipe model is adopted, and weakly compressible Navier–Stokes equations are developed to simulate the flow of water in pulse hydraulic fracturing (PHF). The computation code is developed using the MacCormack method, which has second-order accuracy in time and space. The computation codes and program are validated using experimental data of weakly compressible flows. Then, the square pulse effects are studied inside a pipe, including the effects of pulse frequency, amplitude, pipe length, diameter, and wave speed. Finally, a new universal frequency model is built to describe the relationship among optimal pulse frequency, wave speed, and pipe length. The results show that in square PHF, there is a family of frequencies for which the fluid peak pressure can be significantly enhanced, and these frequencies include the optimal pulse frequency. The optimal frequency of a square pulse depends on the pipe length and wave speed. At the optimal pulse frequency, the maximum peak pressure of the fluid can be increased by 100% or more, and cavitation occurs. These new landmark findings are very valuable for understanding pulse supercharging in an internal water wave. In addition, a new universal frequency model is built to predict optimal pulse frequency. This study identifies an evolution law of peak pressure inside a pipe and proposes a practical frequency-control model for the first time, which can provide a theoretical guide for PHF design.