Abstract:
Traditional wide-crested weir geometry optimization relies heavily on empirical formulas and struggles with precise control of downstream water levels. To address these limitations, we propose a differentiable optimization model based on incompressible fluid simulation. In this model, the weir geometry is parameterized as optimizable variables, and a forward solver based on the incompressible Navier-Stokes equations is constructed to simulate the flow field. A loss function is defined based on the difference between the transverse velocity in the target region and the simulated region. Automatic differentiation (AD) is then employed to efficiently compute gradients with respect to the geometric parameters. The weir shape is iteratively updated using a gradient descent algorithm, progressively matching the downstream transverse velocity distribution to the design target, thus indirectly controlling the downstream water level. Numerical experiments, utilizing both the conjugate gradient (CG) method and automatic differentiation (AD) for gradient calculation, demonstrate the model's convergence and consistency. Quantitative evaluation shows that the mean squared error (MSE) achieved by the proposed model combined with CG is 0.150 92, while that with AD is 0.313 47. In contrast, the MSE of traditional empirical formulas is 1.234 97, indicating a reduction of up to 87.78% compared to conventional methods. The results demonstrate that the proposed differentiable framework achieves high-precision coupled optimization of weir geometry and hydraulic performance, providing a novel technological approach for the intelligent design of complex hydraulic structures. This framework can be extended to geometric optimization problems in other hydraulic structures, such as spillways and fishways.