Predicting Gas Flow in Complex Materials with AI

Author: Denis Avetisyan


A new deep learning approach accurately models nonlinear gas flow through porous media, overcoming limitations of traditional methods.

The proposed DeepLS framework solves nonlinear fluid flow problems by reformulating governing equations with the Hopf-Cole transformation-converting them into a linear Darcy problem-and then minimizing a least-squares energy functional using a neural network to efficiently compute pressure and velocity fields, ultimately recovering the physical gas pressure through the inverse of the initial transformation and providing a provably accurate solution.
The proposed DeepLS framework solves nonlinear fluid flow problems by reformulating governing equations with the Hopf-Cole transformation-converting them into a linear Darcy problem-and then minimizing a least-squares energy functional using a neural network to efficiently compute pressure and velocity fields, ultimately recovering the physical gas pressure through the inverse of the initial transformation and providing a provably accurate solution.

This work combines the Hopf-Cole transformation with deep neural networks and least-squares fitting to account for the Klinkenberg slip effect in porous media flow.

Accurate modeling of gas flow in porous media remains challenging due to nonlinearities and uncertainty in key parameters like permeability. This paper, ‘A Machine Learning-Enhanced Hopf-Cole Formulation for Nonlinear Gas Flow in Porous Media’, introduces a novel framework that integrates the Hopf-Cole transformation with deep learning to address these complexities, specifically accounting for the Klinkenberg slip effect. By combining this transformation with a shared-trunk neural network and Deep Least-Squares solver, the method simultaneously predicts pressure and velocity fields while enabling inverse modeling of flow properties. Could this approach unlock more efficient and accurate subsurface flow simulations and parameter estimation in tight formations?


The Imperative of Accurate Flow Modeling

The ability to accurately simulate gas flow within porous materials is fundamentally important to a range of critical technologies, notably carbon sequestration and enhanced oil recovery. In carbon sequestration, understanding gas permeability allows for the safe and effective storage of carbon dioxide deep underground, preventing its release into the atmosphere. Similarly, optimizing gas injection in oil reservoirs-a technique known as enhanced oil recovery-relies heavily on precise modeling of gas flow through the complex network of pores within the rock formation; maximizing oil extraction while minimizing environmental impact requires a detailed understanding of these subsurface fluid dynamics. Consequently, significant research focuses on developing and refining models that can reliably predict gas behavior in these porous environments, driving advancements in both energy production and climate change mitigation.

The accurate simulation of gas flow through porous materials, vital for processes like carbon capture and enhanced oil recovery, faces a significant hurdle due to the Klinkenberg effect. This phenomenon, arising from gas slippage at the interface between the gas and the solid matrix, introduces a nonlinearity into the governing equations – specifically, the permeability becomes pressure-dependent. Consequently, obtaining analytical, closed-form solutions becomes impossible, forcing researchers to rely on numerical methods. However, traditional numerical approaches, while capable of approximating solutions, become exceedingly computationally expensive as the nonlinearity intensifies, demanding substantial processing power and time to achieve acceptable accuracy. This computational burden limits the scale and complexity of simulations, hindering detailed investigations of gas flow behavior in realistic geological formations and necessitating the development of more efficient solution techniques.

Addressing the inherent nonlinearity in gas flow modeling demands a shift beyond conventional computational techniques. The Klinkenberg effect, manifesting as gas slippage at the pore walls, fundamentally alters the governing equations – typically variations of Darcy’s law – rendering standard linear solvers ineffective and resource-intensive. Consequently, researchers are actively developing and refining innovative methodologies such as multi-scale modeling, adaptive mesh refinement, and advanced numerical schemes – including those leveraging machine learning – to capture the complex interplay between gas flow and porous media structure. These approaches aim to achieve both computational efficiency – reducing processing time and memory requirements – and enhanced accuracy, particularly in predicting gas flow behavior under varying pressure gradients and reservoir conditions. Ultimately, progress in these areas is vital for optimizing critical applications like carbon capture and storage, and maximizing the recovery of valuable resources from subsurface reservoirs.

DeepLS accurately simulates Klinkenberg gas flow through layered porous media by resolving flow at material interfaces, resulting in a smooth pressure drop and velocity contrasts reflecting layer conductivity, with flow aligned to the imposed pressure gradient.
DeepLS accurately simulates Klinkenberg gas flow through layered porous media by resolving flow at material interfaces, resulting in a smooth pressure drop and velocity contrasts reflecting layer conductivity, with flow aligned to the imposed pressure gradient.

Linearization as a Pathway to Solution

The Hopf-Cole transformation is a mathematical technique used to solve the nonlinear Klinkenberg gas flow equation, \nabla \cdot \left( \frac{k}{\mu} \nabla p \right) = 0 , by converting it into the linear Darcy equation, \nabla \cdot \mathbf{q} = 0 , where \mathbf{q} represents the volumetric flow rate. This transformation involves substituting a potential function, φ, such that the gas flow rate is expressed as \mathbf{q} = -\frac{k}{\mu} \nabla p . The key to the transformation lies in finding a suitable relationship between the permeability, k , and the potential function to eliminate the nonlinear term arising from the gas compressibility factor in the Klinkenberg equation. This results in a linear partial differential equation, amenable to analytical and numerical solutions that are not available for the original nonlinear form.

Darcy’s Law, expressed as q = - \frac{k}{\mu} \nabla P, where q is the volumetric flow rate, k is the permeability of the medium, μ is the fluid viscosity, and \nabla P represents the pressure gradient, provides the foundational equation for the linearized model. By transforming the nonlinear Klinkenberg equation into a form amenable to Darcy’s Law, the complex problem is reduced to a linear, well-understood framework. This allows for the application of established analytical and numerical methods developed for solving linear partial differential equations, simplifying the solution process and enabling efficient computation of flow characteristics. The permeability, k, effectively encapsulates the influence of the porous medium on fluid flow, while viscosity, μ, characterizes the fluid’s resistance to flow, both becoming key parameters in the resulting linear model.

The simplification achieved through the Hopf-Cole transformation enables the application of well-established numerical methods originally developed for solving the linear Darcy equation. Techniques such as finite difference, finite element, and boundary element methods, which are computationally efficient and readily available in numerous software packages, become directly applicable to the formerly nonlinear Klinkenberg problem. This significantly reduces computational cost and complexity compared to methods designed for nonlinear partial differential equations, allowing for faster simulations and analysis of gas flow behavior in porous media. The resulting linearized system also facilitates analytical studies and the derivation of approximate solutions where full numerical simulations are not required.

Comparing analytical and DeepLS solutions for gas flow between concentric cylinders reveals that incorporating the pressure-dependent Klinkenberg formulation, rather than assuming constant permeability as in the classical Darcy model, accurately captures slip-induced permeability enhancement and its effect on the radial velocity and pressure profiles.
Comparing analytical and DeepLS solutions for gas flow between concentric cylinders reveals that incorporating the pressure-dependent Klinkenberg formulation, rather than assuming constant permeability as in the classical Darcy model, accurately captures slip-induced permeability enhancement and its effect on the radial velocity and pressure profiles.

DeepLS: A Functional Formulation for Solution

DeepLS methodologies address the Darcy equation by initially linearizing the governing equations, enabling the formulation of a least squares functional. This functional, designed to minimize the residual of the linearized system, provides an objective criterion for approximating the solution. Mathematically, the least squares functional takes the form \mathcal{L}(u) = \frac{1}{2} ||\mathbf{A}u - \mathbf{b}||^2 , where u represents the solution vector, \mathbf{A} is the discretized operator derived from the linearized equation, and \mathbf{b} embodies the data vector. Minimizing this functional yields an approximate solution that satisfies the linearized Darcy equation in a least-squares sense, facilitating the application of optimization-based numerical techniques.

Discretization of the least squares functional is achieved through the selection of collocation points within the domain of the Darcy equation. These points define locations where the residual of the linearized equation – the difference between the equation’s left and right hand sides – is enforced to be zero. At each collocation point x_i , the residual is evaluated, generating a system of algebraic equations. The number of collocation points directly determines the size of this system. Solving this system yields discrete values of the unknown field variable at the collocation points, effectively approximating the continuous solution. The accuracy of this approximation is dependent on the density and distribution of these collocation points within the domain.

Neural networks are employed to approximate the solution to the Darcy equation by representing the unknown pressure field as the output of a neural network parameterized by trainable weights. This allows the continuous problem, discretized via collocation points as described previously, to be recast as an optimization problem minimizing the residual of the Darcy equation at those points. The efficiency stems from the ability of modern automatic differentiation tools to compute the gradients of the residual with respect to the network weights, enabling the use of gradient-based optimization algorithms like Adam to train the network. The resulting trained neural network then provides an approximation of the pressure field p(x) satisfying the Darcy equation, offering a computationally efficient alternative to traditional numerical methods.

DeepLS predictions, utilizing a collocation point density of 12,000, demonstrate strong agreement with finite element solutions derived from stabilized formulations [Masud and Hughes, 2002; Nakshatrala et al., 2006] for the footing problem.
DeepLS predictions, utilizing a collocation point density of 12,000, demonstrate strong agreement with finite element solutions derived from stabilized formulations [Masud and Hughes, 2002; Nakshatrala et al., 2006] for the footing problem.

Convergence and Accuracy: A Mathematically Rigorous Approach

A core strength of the DeepLS method lies in its mathematically proven convergence properties; as the network’s capacity – specifically, the number of neurons in its hidden layers – increases, the approximate solution demonstrably approaches the true solution to the underlying least-squares problem. This isn’t merely an observed trend, but a rigorously established fact, confirmed through careful analysis of the network’s behavior in the limit of infinite width. This convergence guarantees that the method doesn’t simply offer a quick approximation, but provides a solution that becomes increasingly accurate with greater computational resources. The theoretical framework underpinning DeepLS ensures that the method’s performance isn’t limited by arbitrary approximations, but is fundamentally bounded by the network’s ability to represent increasingly complex functions, ultimately mirroring the precision of the true solution \mathbf{x}^\ast.

A central tenet of DeepLS’s reliability stems from a rigorous mathematical demonstration of strong convexity within the least squares functional it optimizes. This isn’t merely a theoretical assertion; the analysis establishes a quadratic growth estimate, meaning the function’s value increases at a rate proportional to the square of the distance from the optimal solution. This characteristic is crucial because strong convexity guarantees a unique global minimum, preventing the network from getting trapped in local minima during training. Consequently, the algorithm consistently converges towards the true solution, and the rate of convergence can be precisely quantified. This quadratic growth provides a powerful tool for bounding the error and ensuring the stability and accuracy of the DeepLS method, particularly when dealing with ill-conditioned or high-dimensional problems where traditional optimization techniques may falter.

A crucial aspect of validating DeepLS lies in meticulously quantifying the error introduced by discretizing the underlying continuous problem; this is achieved through functional perturbation techniques. By treating the discretization itself as a perturbation to the ideal continuous solution, researchers can precisely assess the bias gap – the quantifiable difference between the approximated solution and the true optimal solution. This approach doesn’t simply report an error value, but rather provides a framework for understanding why the error exists and how it diminishes. As demonstrated in Figure 6, the analysis confirms a clear convergence trend: as the discretization becomes finer – essentially, as the approximation gets closer to the continuous problem – the bias gap systematically decreases, bolstering confidence in the reliability and accuracy of the DeepLS method for solving complex inverse problems.

The DeepLS approximation accurately converges to the reference solution for gas flow through concentric cylinders as network capacity increases, demonstrated by decreasing <span class="katex-eq" data-katex-display="false">L_2(\Omega)</span> error with both increasing network depth (L=2,4,6) and width (m).
The DeepLS approximation accurately converges to the reference solution for gas flow through concentric cylinders as network capacity increases, demonstrated by decreasing L_2(\Omega) error with both increasing network depth (L=2,4,6) and width (m).

The pursuit of accurate modeling, as demonstrated in this work concerning nonlinear gas flow, echoes a fundamental principle of mathematical rigor. The researchers’ integration of deep learning with the established Hopf-Cole transformation and least-squares method exemplifies a dedication to provable solutions, rather than merely empirical approximations. This mirrors the sentiment expressed by Grigori Perelman: “If there is no symmetry, there is no beauty.” The inherent symmetry within a well-defined mathematical framework, like the Hopf-Cole transformation, provides the ‘beauty’-the elegance and reliability-that allows the neural network to generalize beyond training data and accurately capture the complexities of porous media flow, even accounting for the Klinkenberg slip effect. The framework’s success isn’t simply in achieving a result, but in the consistency of its approach.

Beyond Approximation: Charting a Course for Rigor

The presented work, while demonstrating an ability to approximate solutions to nonlinear gas flow, merely shifts the locus of uncertainty. The true challenge isn’t achieving numerical convergence-any sufficiently overparameterized neural network will accomplish that, given enough data. Instead, the fundamental question remains: can this framework prove convergence to the true solution, and with what quantifiable error bounds? The current reliance on least-squares minimization, while computationally expedient, offers no such guarantee. A move toward Galerkin methods, or other variational approaches, coupled with rigorous analysis of the resulting functional spaces, is essential.

Furthermore, the implicit assumption of ergodicity within the training data warrants scrutiny. Porous media are notoriously heterogeneous. A model trained on one realization may perform poorly on another, exhibiting a lack of generalizability that belies the apparent accuracy. Future work must address this through either the incorporation of stochastic modeling or the development of transfer learning techniques capable of adapting to unseen media characteristics. The pursuit of ‘accuracy’ without a corresponding measure of robustness is, quite simply, an exercise in optimistic numerics.

Ultimately, the field requires a move beyond the descriptive power of machine learning and toward a more constructive role. The Hopf-Cole transformation is an elegant mathematical tool; the neural network, in this context, should not be seen as a black box approximator, but as a means to systematically refine and extend that transformation, unlocking analytical solutions previously inaccessible. To merely predict flow is insufficient; the goal should be to understand it, with the precision and certainty demanded by mathematical science.


Original article: https://arxiv.org/pdf/2603.11250.pdf

Contact the author: https://www.linkedin.com/in/avetisyan/

See also:

2026-03-15 23:49