Graph Neural Surrogates for Reservoir Simulation: PhysicsNeMo X-MGN
NewOverview
Reservoir simulation is among the most expensive routine computations in geoscience. A single full-field multiphase flow solve can occupy tens of core-hours, history matching repeats solves across dozens of parameter perturbations, and development planning needs hundreds or thousands of forward runs. The number of cases a team can afford in a year is therefore capped by hardware, which is exactly the gap neural surrogates are meant to close.
The earlier entry in this collection described the PhysicsNeMo reservoir example in terms that were directionally right but operationally empty. It claimed the example replaces repeated reservoir simulation with a neural network, listed pressure and saturation fields or well rates as outputs, and placed the surrogate inside history matching, production optimization and carbon storage monitoring loops. None of those statements maps onto a file you can run, a dataset you can download, or a number you can reproduce.
The verified picture is more specific. The only sub-example under examples/reservoir_simulation/ in the NVIDIA PhysicsNeMo repository is xmgn, a reservoir implementation of X-MeshGraphNet. It consumes ECLIPSE/IX compatible binary simulator output and trains an autoregressive model to predict the next timestep of pressure and water saturation. The two companion datasets are described in detail by generation procedure, yet the README simultaneously marks the download as coming soon. The example does emit GRDECL files that import into Petrel and ResInsight, and it does run the Norne field across 64 timesteps spanning 10 years with varying well controls. What the README states plainly is that near-term predictability is good and autoregressive error accumulates over time.
This guide therefore separates what the surrogate actually replaces, how the error grows, and what a team still needs in order to reproduce the work. For the framework itself see tools/physicsnemos, for the general taxonomy of surrogates and reduced-order models see collections/surrogate-modeling-rom, and for where surrogates sit against classical solver cost see guides/classical-solver-cost-boundary-2026.
How It Works
X-MGN is the scalable multi-scale graph neural network NVIDIA proposed on top of MeshGraphNet, described in arXiv:2411.17164 by Mohammad Amin Nabian, Chang Liu, Rishikesh Ranade and Sanjay Choudhry, first submitted on 26 November 2024 and revised on 20 December 2024. The paper targets three specific limitations of MeshGraphNet: scalability, the requirement to mesh at inference time, and difficulty handling long-range interactions.
For scalability, the method partitions large graphs and introduces halo regions so message passing crosses partition boundaries seamlessly. Combined with gradient aggregation, training across partitions becomes mathematically equivalent to processing the entire graph at once, which is what keeps distributed training consistent with single-graph training. To remove the inference-time meshing dependency, the paper constructs graphs directly from tessellated geometry files such as STLs by sampling point clouds on the surface or in the volume and connecting k-nearest neighbours. For long-range interactions, multi-scale graphs are built iteratively, with each level refining the previous one as coarse and fine point clouds are combined.
The reservoir example places this framework in a setting where it fits well but through a different mechanism than the paper's headline demonstrations. Commercial reservoir simulation is predominantly finite volume: the domain is discretised into grid cells, cells exchange pressure and saturation along connection relations, and wells act on specific cells. That discretisation is already a graph, with cells as nodes and connections as edges. The preprocessing script builds exactly that graph: it reads .INIT, .EGRID and .UNRST files, extracts variables named in the configuration, uses grid cells as nodes and cell connections as edges, and derives autoregressive training sequences for next-timestep prediction.
One detail deserves separate emphasis, because it is where this example diverges from the paper's other demos. The STL point cloud and k-nearest-neighbour route exists for scenarios where geometry must be discretised from scratch. A reservoir problem already rests on a finite-volume grid, so no mesh needs rebuilding and the surrogate inherits the solver topology directly. What the example really exercises is the partition-plus-halo-plus-gradient-aggregation machinery and the multi-scale treatment of long-range coupling. The inference-time meshing benefit barely shows up here, and describing the example that way would overstate the paper's contribution to this domain.
The genuine difficulty in this domain is irregular connectivity: faults, pinch-outs, dual porosity and discrete fractures. Conventional regular-grid graph networks assume local, regular neighbourhoods, yet a single injector may transmit pressure to a producer hundreds of kilometres away through a fault, so the relevant path can cross hundreds of intermediate nodes. Non-neighbour connections encode such non-local links directly in the simulator grid, and the X-MGN graph represents them natively. The README names faults, pinch-outs, dual porosity and discrete fractures as the regimes where the method is particularly effective, and notes that the many NNC-represented faults in the Norne field are handled through graph structure.
Scope and Assumptions
First assumption: data format. The example accepts only ECLIPSE/IX compatible binary output, requiring at least .INIT for initial state, .EGRID for grid geometry and properties, .UNRST or .X00xx for restarts, plus .UNSMRY or .S00xx for summary data, with all cases under one directory tree. The object of surrogate modelling is therefore the output of the commercial ECLIPSE and IX family. Teams holding results only from MRST, Petrel or OPM need an extra conversion layer.
Second assumption: sampling and geological parameterisation. Neither companion dataset comes from production history. Both are generated in batches: a design of experiments and sensitivity study selects key variables, and Latin Hypercube Sampling then varies them to produce geological variants. The second dataset proceeds by identifying fault transmissibility and KVKH multipliers as dominant variables and sampling 500 cases over them, while the first fixes the geometry of a two-dimensional quarter five-spot waterflood model and generates 1000 permeability distributions by geostatistics. What the surrogate learns is the flow response over this parameterised family, and behaviour outside it carries no guarantee.
Third assumption: the underlying simulator. Both datasets were produced by the open-source OPM flow simulator. OPM differs from commercial simulators in phase-fraction formulations, numerical schemes and grid conventions, so a model trained on OPM data and moved to an ECLIPSE grid needs revalidation, usually by rerunning a batch of cases with the target simulator.
Fourth assumption: what is being replaced. Here X-MGN autoregressively predicts the next timestep of pressure and water saturation fields. What it substitutes is the multiphase time-advance step inside the solver, while initialisation, equilibration, well management, reporting and post-processing remain the responsibility of conventional tools.
Fifth assumption: well control. The Norne demonstration runs 64 steps with varying well controls, so control is an exogenous input to the learned mapping. The surrogate models the response under a given control scheme; strategy optimisation sits one layer above.
Getting Started
The README lays out three steps plus an optional visualization stage.
Step one is data preparation. Choose a YAML file in conf/, point dataset.sim_dir at the directory holding the ECLIPSE/IX outputs, and organise one subdirectory per case containing files such as CASE_1.DATA, CASE_1.INIT, CASE_1.EGRID and CASE_1.UNRST. The README offers two sources: your own simulation output, or a downloadable sample dataset whose generation procedure is described but whose availability is marked as coming soon.
Step two is preprocessing, run as python src/preprocessor.py --config-name=<name>. The script reads the simulation binaries in the directory, extracts the variables named in the configuration, builds the graph with grid cells as nodes and cell connections as edges, derives autoregressive training sequences for next-timestep prediction, and saves the processed graphs.
Step three is training, run as torchrun --nproc_per_node=4 --nnodes=1 src/train.py --config-name=<name> for multi-GPU distributed training. Note that the torchrun launch distributes the training execution, which is a separate concern from the graph partitioning inside the model.
Step four is inference and visualization, run as python src/inference.py --config-name=<name> to perform autoregressive rollout over future timesteps. Results land in outputs/<name>/inference/ in two forms: HDF5 files holding predictions and targets organised by case, timestep and variable, and GRDECL files in Eclipse-compatible ASCII that import into Petrel and ResInsight.
Experiment tracking uses MLflow. From the outputs/ directory, launch mlflow ui --backend-store-uri sqlite:///mlruns/mlflow.db --host 0.0.0.0 --port 5000.
The configuration name must stay consistent across all three steps, and --config-name takes the YAML filename without its extension. The environment requirement is Python 3.10 or newer, tested on 3.10 and 3.11, with dependencies installed through pip install -r requirements.txt.
Comparison with Alternatives
Three families of alternatives compete with X-MGN in reservoir surrogate modelling.
The first is classical reduced-order modelling. POD reduction with permeability-field inversion builds a snapshot basis and fits a low-order surrogate. Its strengths are strong interpolation accuracy, interpretability, and very low error where training coverage is dense; its weakness is that a global orthogonal basis tends to drop higher-order modes, so strong nonlinear topology changes such as faults and pinch-outs are smoothed away. The graph formulation of X-MGN does not depend on a global basis and is more tolerant of local topological change.
The second family treats grids as images. Pixel and voxel encoders work reasonably when geometry is regular and the mesh is uniform, but faulting and pinch-outs are flattened by voxelisation, and grid sizes suited to millions of cells are awkward for convolutional architectures. X-MGN builds the graph directly on grid cells without voxelisation.
The third family is vanilla MeshGraphNet and its descendants. The original model already performs well on unstructured meshes, but the three limitations the paper names all bite in practice: whole-graph processing cannot carry industrial model sizes, inference presumes a mesh already exists, and long-range dependency needs extra machinery. Partitioning with halo regions makes cross-partition training equivalent to whole-graph training, and the progressively refined multi-scale graph gives long-range coupling a path.
Two further reference points help place the choice. tools/neuraloperator stands for operator learning, which learns the solution operator itself and handles geometry variation more gracefully, at the cost of typically far larger training sets. collections/numerics-and-solvers and collections/uq-bayesian-inversion stand for a different philosophy: keep the solver, embed it inside a surrogate-assisted Bayesian inversion loop, and settle accuracy against uncertainty within the inference framework.
One contrast is directly architectural. cases/topodiff-topology-optimization also applies graph networks to a physics problem, but there the graph is the compute graph of a topology optimisation generator, living in design space. The reservoir graph lives in the physical domain. Both are GNNs, yet the physical meaning of a node differs completely, and so do training and transfer strategies.
Benchmarks and Evidence
Datasets come first, because they are the critical link in any reproduction path.
Dataset one is a two-dimensional quarter five-spot waterflood model with fixed geometry, where a geostatistical method generates 1000 permeability distributions.
Dataset two is built on the public Norne field model taken from the OPM opm-data repository. A design of experiments and sensitivity study identifies fault transmissibility and KVKH multipliers as the dominant variables, and Latin Hypercube Sampling over them yields 500 cases. Norne is a well-known test model whose grid contains many faults represented as NNC, which X-MGN carries natively through its graph structure.
Both datasets were generated with the open-source OPM simulator.
On availability, the README must be quoted faithfully: a downloadable sample dataset will be made available soon. At the time of writing there is no directly downloadable sample package, and the README only describes how the data was produced. It also carries an explicit licence disclaimer: users are responsible for verifying and complying with the licence terms of any dataset used with the example, naming the Norne Field dataset and any proprietary data, and are asked to secure the necessary rights before research or commercial use. That paragraph deserves a literal reading when weighing reproducibility and compliance.
On results, the README offers exactly one quantitative frame: autoregressive inference on the Norne field across 64 timesteps covering 10 years of operation with varying well controls, with pressure and water saturation given as ground truth, prediction and error difference. Its qualitative judgement is that X-MGN demonstrates good predictability, especially for near-term predictions, and that as expected for autoregressive prediction errors accumulate over time, while the model maintains reasonable accuracy throughout.
What the README does not provide is any portable metric. No RMSE, no relative error, no reserves or rate deviation appears. Assessing accuracy requires your own evaluation on target cases, or reliance on comparisons at the paper level, whose stated finding is that X-MGN maintains the predictive accuracy of full-graph GNNs while improving scalability and flexibility. Those paper experiments cover general physical simulation rather than the Norne reservoir case, so importing the accuracy claim requires a cross-domain extrapolation that the reader must validate.
For how error accumulation can propagate inside an inference loop, cases/openfwi-seismic-inversion offers a closely related account of a surrogate-accelerated inversion. collections/surrogate-modeling-rom and guides/neural-operator-selection-2026 give the general surrogate spectrum and the operator-learning selection perspective.
Role in Physics-AI Workflows
Placed inside a physics AI workflow, X-MGN occupies the role of a replaceable time-advance operator.
The first use is parameter sweep and scenario screening. Development-plan evaluation is a batch of forward runs, each requiring a full multiphase advance. A surrogate turns the throughput limit from solver core-hours into inference latency, which frees parameter-space branches that previously never fit inside the schedule. Accuracy requirements here are moderate: the decision depends on ranking, not on absolute error of a single case.
The second use is history matching and inversion, which repeatedly forward-run and compare against observations, making it a likelihood-evaluation-heavy loop. The surrogate supplies a fast simulated response for a parameter combination and decouples the search from high-fidelity solving. The risk is that surrogate error near the edges of parameter space and in rare geological configurations tends to be underestimated, while inversion actively searches the regions where the fit is poor.
The third use is well control and production optimisation, where strategy search evaluates many control schemes. The distinction worth keeping: this example learns the flow response under a given control scheme and contains no strategy optimiser of its own. Closing that loop requires an optimiser wrapped around the surrogate, plus attention to how autoregressive error compounds over long rollouts.
The fourth use is carbon storage and subsurface monitoring, the direction where expectations run high. CO2 plume evolution is mathematically a multiphase flow problem, so the same graph construction and autoregressive framework transfers in form. The caveat is that the code and data here are configured for oil reservoirs, with variable extraction, well models and initial conditions all set for that purpose. Converting the pipeline to storage requires redoing data preparation and variable definitions, and CO2 injection involves phase change and pressure constraints whose error behaviour differs from oil production. The earlier entry listed carbon storage monitoring as a scenario directly served by this example; the evidence does not support that framing.
The fifth use is data assimilation and near-real-time monitoring, where the iterative loop needs a fast state advancer. There the surrogate acts as a cheap prior advance, tolerating looser absolute accuracy but demanding consistency and long-horizon stability. This path is markedly more sensitive to error accumulation.
Limitations and Failure Modes
The first failure mode is error accumulation over long rollouts. This is the most certain one, and the README says so. Each step conditions on the previous prediction, so single-step error propagates and grows along the time axis. The 64-step, 10-year demonstration spans a long horizon, and late-window predictions are visibly less reliable than early ones. Practical mitigations include restricting the surrogate to near-term windows, falling back to a high-fidelity solver at decision-critical checkpoints, or switching to direct multi-step prediction to cut the feedback path.
The second is extrapolation beyond the geological parameterisation family. The training data consists of 500 cases sampled by Latin Hypercube over fault transmissibility and KVKH multipliers, plus 1000 permeability distributions on a fixed two-dimensional geometry. The learned map is confined to that family. When real reservoirs exceed it in fault geometry, layering or relative permeability curves, the surrogate may return smoothly wrong answers with no obvious failure signal.
The third is a mismatch between the training simulator and the deployment simulator. Data came from OPM while deployment may use ECLIPSE or another code. Differences in phase behaviour, flash calculation, numerical schemes and grid conventions all push deployed accuracy below offline evaluation.
The fourth is initial and equilibrium state handling. Reservoir simulation starts from an initial state file carrying pressure, saturation and petrophysical initialisation, usually derived from equilibration or history matching. The surrogate learns a map from initial state to later times, so deployment with a different equilibrium origin injects error from the very first step.
The fifth is event-driven transients. Shut-in, restart, conversion of an injector to a producer, or casing failure are discrete events that are under-represented when training data comes from Latin Hypercube sampling of continuous variables. Behaviour at the event instant is unreliable.
The sixth is the boundary of scalability claims. The README states that X-MGN scales efficiently to industry-scale reservoir models with millions of cells. That is a framework-level statement; the cases demonstrated in this example are well below that magnitude. Read it as architectural capability rather than validated scale evidence in this repository.
Version and Source Notes
This section records each correction to the earlier entry together with the boundaries established by primary sources.
- Directory contents.
examples/reservoir_simulation/contains a single sub-example,xmgn/, with supporting code undersim_utils/. The earlier claim about pressure and saturation prediction matches the source, but well-level rates were not found among the inference outputs here.
- Prediction targets. The autoregressive target is grid pressure and water saturation. Well rates are a post-processing export rather than a peer output.
- What is replaced. Rather than replacing reservoir simulation wholesale, an autoregressive graph network replaces the multiphase advance step; initialisation, equilibration, reporting and post-processing stay with conventional tools.
- Paper to implementation. X-MGN is arXiv:2411.17164 by Nabian, Liu, Ranade and Choudhry, v1 dated 2024-11-26 and v2 dated 2024-12-20. The STL point cloud and k-nearest-neighbour route is not the operative mechanism in the reservoir case, because the finite-volume topology already exists and is inherited directly.
- Special structure of the grid. What the example exercises is X-MGN's handling of irregular connectivity: faults, pinch-outs, dual porosity, discrete fractures, and the many NNC-represented faults in Norne. The earlier entry mentioned geological uncertainty without reaching this mechanism.
- Format constraint. Inputs are restricted to ECLIPSE/IX compatible binaries, namely
.INIT,.EGRID,.UNRSTor.X00xx,.UNSMRYor.S00xx, all cases under one directory. The earlier entry left this hard constraint unstated.
- Data availability. The README marks the downloadable sample dataset as coming soon and attaches an explicit licence disclaimer naming Norne and any proprietary data. The earlier entry cited runnable configurations as resources without noting that data is not yet available or that licence responsibility sits with the user.
- Dataset scale and generation. Dataset one is a two-dimensional quarter five-spot waterflood with geostatistical permeability distributions, 1000 samples. Dataset two is Norne with fault transmissibility and KVKH multipliers selected by design of experiments and sensitivity study, sampled by Latin Hypercube into 500 cases. Both come from OPM.
- Error behaviour. The README states near-term predictability is good, autoregressive error accumulates over time, and reasonable accuracy is maintained throughout. This is the conclusion most worth quoting.
- Gap in quantitative metrics. The README provides no RMSE, relative error or rate deviation, only the 64-timestep, 10-year, varying-control demonstration frame.
- Scale claim. That the method scales to million-cell industrial reservoir models is a statement about framework capability, and the demonstrated cases here are smaller.
- Carbon storage and history matching framing. The code and data are configured for reservoirs, with no CO2 injection configuration and no assimilation loop. Both directions are methodologically extensible but require user modification and validation.
- Blog reference. The earlier resource list cited an NVIDIA developer blog article on reservoir and subsurface surrogates. No corresponding article could be located in NVIDIA official channels, so it is not carried forward.
- Year. The earlier entry recorded 2023. This entry uses 2024, following the X-MGN submission date and the repository in which the example is hosted.
- Licence. The example repository code is Apache-2.0, while the Norne dataset and OPM outputs follow their own terms and need separate confirmation.
- Architecture cross-check. The architecture comparison table in the PhysicsNeMo examples overview lists Reservoir Simulation against X-MeshGraphNet and MeshGraphNet, consistent with the directory contents.
For related reading see cases/physicsnemo-tcad-chip-thermal, a verification record for another domain vertical of the same framework, tools/physicsnemos for the component and operator inventory, and collections/physics-foundation-models for the broader view on physics foundation models.
References
- NVIDIA PhysicsNeMo reference implementation and README for
examples/reservoir_simulation/xmgn, https://github.com/NVIDIA/physicsnemo/tree/main/examples/reservoir_simulation/xmgn - Nabian M. A., Liu C., Ranade R., Choudhry S., "X-MeshGraphNet: Scalable Multi-Scale Graph Neural Networks for Physics Simulation", arXiv:2411.17164, 2024, DOI 10.48550/arXiv.2411.17164
- Open Porous Media (OPM) Flow Simulator official site, https://opm-project.org/
- OPM project opm-data repository, source of the Norne Field model, https://github.com/OPM/opm-data/tree/master/norne
- NVIDIA PhysicsNeMo examples overview
examples/README.md, including the Reservoir Simulation architecture comparison table, https://github.com/NVIDIA/physicsnemo/blob/main/examples/README.md - NVIDIA PhysicsNeMo documentation site covering installation, user guide and API reference, https://docs.nvidia.com/physicsnemo/latest/index.html
- ResInsight visualization software, a GRDECL import target, https://resinsight.org/
- Rasmussen A. F. et al., "The Open Porous Media Flow Reservoir Simulator", CAMWA 81:159-185 (2021), arXiv:1910.06059
- Fan H., Westford G. D., Li G., "Study on Validation of the OPM Reservoir Simulator by Comparative Solution Project", Petroleum Exploration & Production Research Institute 4(6) (2020), DOI 10.23880/ppej-16000241
- Open Porous Media Project, "OPM Flow 2025.04", Zenodo (2025), DOI 10.5281/zenodo.15573878
- Helver F., et al., "OpenFOAM for Complex Engineering Simulations", Computing in Science & Engineering, 21(1), 2019
- Jin Y., et al., "A Comparison of Two Neural Network Frameworks for the Surrogate Modelling of Subsurface Flow", 2022