Introduction: Physics-informed neural networks (PINNs) offer mesh-free approximations of governing equations but often struggle with moving discontinuities in hyperbolic free-surface flows. This study investigates whether residual-based adaptive refinement (RAR) can concentrate training points around a dam-break shock and improve solution accuracy without uniformly densifying the space-time domain.
Methods: A PINN using DeepXDE and PyTorch solved the conservative one-dimensional shallow-water equations for a wet-bed dam break. DeepXDE provided the PINN framework for defining the governing equations, initial conditions, collocation points, and residual-based refinement, while PyTorch supplied the automatic-differentiation and optimization backend used to evaluate network derivatives and update the weights by minimizing the physics-informed loss. The network contained a positivity-preserving depth transformation, weighted conservation residuals, and a Roe numerical flux. Initial training used 16,000 uniformly distributed collocation points within the domain where the governing equations were enforced. RAR was then applied iteratively: the equation residuals were evaluated over a larger candidate set, the locations with the greatest combined mass and momentum residuals were added to the training set, and the network was retrained. Predictions were evaluated against the analytical Stoker solution.
Results: The first RAR step concentrated the new training points around the moving hydraulic shock: 98.5% of the selected locations were within 0.25 m of the analytical shock trajectory. By comparison, approximately 2.5% of uniformly sampled points would be expected within a band of this width over the domain. Across five refinement rounds, RAR added 3,000 targeted equation enforcement points, expanding the original set by 18.75%. Compared with the network after the initial uniform-training stage, the final RAR-enabled solution reduced the relative L² error in water depth from 4.740% to 0.795% and the velocity error from 34.468% to 2.819% at 1.2 s. These values represent error reductions of 83.2% and 91.8%, respectively, while avoiding uniform refinement throughout the full space-time domain.
Conclusions: Residual-guided sampling tracks the moving dam-break discontinuity and yields accurate depth and velocity fields with modest collocation-set growth. The results demonstrate a practical, computationally efficient strategy for training PINNs on shock-dominated shallow-water flows.