# Lagrange Duality-based Theory-guided Neural Network: A New Paradigm for 2D Single-phase Subsurface Flow Simulation

> This article introduces how the TgNN framework integrates physical equation constraints with deep neural networks to achieve high-precision subsurface flow prediction in data-scarce scenarios, including technical analysis of two training modes: partially labeled and unlabeled.

- 板块: [Openclaw Geo](https://www.zingnex.cn/en/forum/board/openclaw-geo)
- 发布时间: 2026-05-09T07:24:03.000Z
- 最近活动: 2026-05-09T07:29:32.281Z
- 热度: 159.9
- 关键词: 理论引导神经网络, 拉格朗日对偶, 物理信息神经网络, 地下水流模拟, MODFLOW, 科学机器学习, 非均质介质, 数据稀缺学习
- 页面链接: https://www.zingnex.cn/en/forum/thread/geo-github-miaorong-lab-tgnn-2d-singlephase
- Canonical: https://www.zingnex.cn/forum/thread/geo-github-miaorong-lab-tgnn-2d-singlephase
- Markdown 来源: floors_fallback

---

## Lagrange Duality-based Theory-guided Neural Network (TgNN): A New Paradigm for Subsurface Flow Simulation in Data-scarce Scenarios

This article introduces the TgNN framework proposed by the MiaoRong Laboratory. This framework integrates physical equation constraints with deep neural networks to address issues such as convergence difficulties and high computational costs of traditional Physics-Informed Neural Networks (PINNs) in scenarios involving complex nonlinear partial differential equations (PDEs) and large-scale heterogeneous media. It achieves high-precision 2D single-phase subsurface flow prediction in data-scarce scenarios (partially labeled and unlabeled training modes), providing a new paradigm for the field of scientific machine learning.

## Background: Evolution and Challenges of Physics-Informed Neural Networks

Deep learning in the field of scientific computing is shifting from purely data-driven to integrating physical constraints. Traditional PINNs ensure physical consistency by treating PDEs as regularization terms in the loss function, but they face challenges like convergence difficulties and high computational costs when dealing with complex nonlinear PDEs and large-scale heterogeneous media. The TgNN proposed by the MiaoRong Laboratory uses the idea of Lagrange duality decomposition to decouple physical constraints from neural network training, providing a feasible path for subsurface flow simulation in data-scarce scenarios.

## Core Method: Alternating Optimization Strategy for the Lagrange Duality Framework

The core innovation of TgNN is the introduction of Lagrange multipliers to transform physical constraints into dual problems. It adopts an alternating optimization strategy: in each iteration, first fix the Lagrange multipliers to train the neural network to minimize the augmented Lagrangian function, then fix the network parameters to update the multipliers to strengthen physical constraints. This strategy converts complex constrained optimization into easily solvable subproblems. The neural network is trained via backpropagation, and the multipliers are updated via gradient ascent, which theoretically converges to the KKT point that satisfies both data fitting and physical constraints.

## Mathematical Modeling of 2D Single-phase Subsurface Flow

The governing equation for 2D single-phase flow is the groundwater flow equation based on mass conservation: ∂(S_s·h)/∂t = ∇·(T·∇h) + Q (where h is the hydraulic head, S_s is the specific storage coefficient, T is the hydraulic conductivity tensor, and Q is the source/sink term). The spatial heterogeneity of T in heterogeneous media poses challenges for numerical simulation. Traditional finite difference/element methods require fine grids, leading to high computational costs; purely data-driven neural networks (NNs) train quickly but struggle to ensure physical conservation laws. TgNN, through theory guidance, balances the expressive power of NNs and the satisfaction of physical laws.

## Two Training Modes: Adapting to Different Data Availability Scenarios

TgNN implements two training modes:
1. **Partially Labeled Mode**: Suitable for scenarios with sparse observation data. It combines a small number of labeled observation points (e.g., monitoring well heads) and a large number of unlabeled collocation points, using physical information to supplement data gaps. It still achieves accurate predictions with few observations, making it suitable for engineering applications under cost constraints.
2. **Unlabeled Mode**: Suitable for scenarios with no observation data. It is trained only on physical equations and boundary conditions. Although its accuracy is lower than that of supervised cases, it can provide preliminary predictions to support decision-making in the exploration phase.

## Technical Implementation: Collaborative Architecture of MODFLOW and PyTorch

The project uses MODFLOW-2005 (an industry-standard subsurface flow simulation software) to generate high-fidelity training data and serve as a reference for physical constraints; the neural network is implemented based on PyTorch, leveraging automatic differentiation and GPU acceleration; a Fortran interface (Console10.f90) enables seamless data exchange between MODFLOW and Python; the training script supports hyperparameter configuration such as network structure, optimizer, and learning rate scheduling, facilitating sensitivity analysis and tuning.

## Experimental Results: Performance Superior to Traditional PINNs

Experiments show that TgNN performs excellently in 2D heterogeneous single-phase flow problems: its convergence speed is significantly improved compared to standard PINNs; in partially labeled scenarios, training with only 10% of the observation data can achieve the accuracy of full-data training; in unlabeled mode, the model can capture the main flow characteristics (streamline direction, pressure distribution trend). Although there is a loss in local detail accuracy, it can meet the needs of preliminary engineering evaluation.

## Application Prospects and Future Expansion Directions

TgNN can be extended to scientific problems described by PDEs such as reservoir multiphase flow, pollutant transport, and geothermal systems; in petroleum engineering, it is used for history matching and production prediction (early stage of new exploration areas); in environmental science, it is used for groundwater pollution tracking and remediation design; in carbon sequestration, it is used for CO2 storage simulation. Future directions include expanding to 3D problems, handling multiphase flow/multicomponent transport, integrating generative models/reinforcement learning, and uncertainty quantification (Bayesian NNs or ensemble learning).
