Hybrid FEM–PINN Framework for 2D Shallow-Water Flow Simulation and Error Analysis

Read the full article See related articles

Discuss this preprint

Start a discussion What are Sciety discussions?

Listed in

This article is not in any list yet, why not save it to one of your lists.
Log in to save this article

Abstract

Accurate and efficient simulation of shallow water dynamics remains one of the most challenging tasks in computational hydraulics due to the inherent trade-off between physical conservation and numerical stability. Conventional finite element methods (FEM) are known for their strong adherence to conservation principles, particularly mass balance, yet they frequently suffer from excessive diffusion, oscillations, and limited adaptability when dealing with highly nonlinear or data-sparse environments. In contrast, physics-informed neural networks (PINNs) have emerged as powerful tools that embed governing equations into the training of deep learning models, thereby providing smooth, data-driven solutions even in the absence of dense measurements. However, the standalone application of PINNs is restricted by weak enforcement of physical invariants, accumulation of errors over long-time horizons, and difficulties in achieving robust convergence. This methodological gap highlights the urgent need for a hybrid framework that can combine the complementary strengths of FEM and PINNs. The present study introduces an innovative hybrid FEM+PINN framework designed to close this gap. FEM is first employed to generate high-fidelity snapshots of the shallow water system, which serve as structured training data to guide the PINN component. The PINN simultaneously incorporates the shallow water governing equations, conservation constraints, and boundary conditions, ensuring that physical laws are respected during learning. By merging the conservation properties of FEM with the flexibility and adaptivity of PINNs, the proposed model achieves a balance between accuracy, robustness, and generalization. The training strategy further implements collocation sampling, gradient clipping, and dynamic weighting of data and PDE losses to enhance stability across epochs. The results confirm the clear advantages of the hybrid approach. Quantitatively, the water depth h achieves a root mean square error (RMSE) of 0.0461 and mean absolute error (MAE) of 0.0403, while the momentum components hu and hv exhibit RMSE values of 0.1265 and 0.1, respectively. Mass conservation is preserved with deviations limited to 3.55%, whereas energy conservation, although not exact, demonstrates controlled systematic accumulation rather than instability. The training loss decreases rapidly from an initial value of 6.0×105 to below 2.0×104 within 60 epochs, confirming convergence without oscillatory artifacts. Spatial error distributions remain smooth and symmetric, error histograms demonstrate strong clustering near zero, and flow field visualizations highlight coherent structures without noise. This study fills a crucial methodological gap by demonstrating that neither FEM nor PINNs alone can fully meet the requirements of accuracy, conservation, and stability in shallow water modeling. The hybrid FEM+PINN framework provides a novel, physically consistent, and computationally efficient solution. Its ability to integrate classical numerical rigor with machine learning adaptability marks a significant advancement for data-driven hydraulics and paves the way for next-generation models in environmental and engineering fluid dynamics.

Article activity feed