Hydrograd improves water flow modeling with fast gradient calibration

Hydrograd v2.0: a differentiable two-dimensional shallow-water model on unstructured meshes with steady and unsteady adjoints for calibration and closure learning

Computational Engineering, Finance, and Science

Summary

Predicting how water moves in rivers and floodplains helps manage floods and rivers better, but making such models faster and more accurate is hard. The authors improved a computer model called Hydrograd that can simulate water flows on complex maps and calculate how changing certain factors affects the results efficiently. This helps quickly adjust model settings to match real water measurements and better understand what influences water behavior. Their method works faster and more precisely than before, making it easier to calibrate models and learn unknown details.

What this means in practice

  • For hydraulic engineers: Use improved gradient calculations to speed up calibration of river and floodplain flow models with complex meshes.
  • For environmental modelers: Infer unknown flow or roughness parameters from observed water stage data more efficiently for environmental analysis.

Authors

Xiaofeng Liu

Abstract

We present \textit{Hydrograd} v2.0, a significantly improved differentiable 2D shallow-water model written in Python with JAX. The model solves the shallow-water equations on the unstructured meshes of production models such as SRH-2D and HEC-RAS 2D with a well-balanced, positivity-preserving finite-volume scheme that handles wetting and drying. Gradients are tailored to the type of problem. Steady states are found by Newton's method with an exact sparse Jacobian obtained by graph colouring, and their gradients follow from the implicit function theorem at the cost of one linear solve. Unsteady flows are differentiated in reverse mode with checkpointing, or with an implicit time integrator whose gradient costs about two forward runs. All gradients agree with finite differences, to about $10^{-8}$ for steady flows. On the Savannah River case, the steady water surface differs from that of SRH-2D by 4.7\,mm (root mean square). Steady closure learning was 96 times faster than differentiating through time marching and reached a lower loss. An inflow hydrograph was inverted from stage records with a peak error of 2\,\%. In an unsteady roughness calibration, a singular value decomposition analysis of the sensitivity matrix showed that the stage records at the gauges are 70 to 160 times more sensitive to the total resistance of the reach than to its distribution among the roughness zones, which explains why only a gauge layout with gauges in every zone recovered all five roughness values. On one GPU, a mesh of 512,000 cells takes 7.6\,s for a forward run and 51\,s for a gradient.