Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

## Introduction

This repository provides sample applications demonstrating use of specific Physics-ML
model architectures that are easy to train and deploy. These examples aim to show how
such models can help solve real world problems.
This repository provides sample applications that demonstrate the use of specific Physics-ML
model architectures that are easy to train and deploy. These examples illustrate how such models can help solve real-world problems.

## Introductory

Expand Down Expand Up @@ -63,14 +62,14 @@ such models can help solve real world problems.

## Additional examples

In addition to the examples in this repo, more Physics-ML usecases and examples
In addition to the examples in this repo, more Physics-ML use cases and examples
can be referenced from the [PhysicsNeMo examples](https://github.com/NVIDIA/physicsnemo/blob/main/examples/README.md).

## NVIDIA support

In each of the example READMEs, we indicate the level of support that will be provided.
Some examples are under active development/improvement and might involve rapid changes.
For stable examples, please refer the tagged versions.
Each README indicates the level of support provided.
Some examples are under active development and may change rapidly.
For stable examples, refer to the tagged versions.

## Feedback / Contributions

Expand Down
2 changes: 1 addition & 1 deletion examples/aneurysm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This example uses PINNs for emulating flow in an aneurysm taking the specific blood vessel geometry as the input.

## Problem overview
This sample illustrates the features in PhysicsNeMo Symbolic such as the geometry utilities to train a PINN model for a complex geometry. The trained surrogate PINN can be used to predict the pressure and velocity of blood flow inside the aneursym. You can get more details on this sample from the [documentation](https://docs.nvidia.com/deeplearning/physicsnemo/PhysicsNeMo-sym/user_guide/intermediate/adding_stl_files.html). This sample can be extended to incroporate parameterized geometry using CCSG instead of STL to leverage the surrogate model to provide patient specific geometry. You can refer to the documentaion [here](https://docs.nvidia.com/deeplearning/physicsnemo/PhysicsNeMo-sym/user_guide/advanced/parametrized_simulations.html#creating-nodes-and-architecture-for-parameterized-problems) for more details.
This sample illustrates the features in PhysicsNeMo Symbolic such as the geometry utilities to train a PINN model for a complex geometry. The trained surrogate PINN can be used to predict pressure and velocity fields of blood flow within the aneurysm. You can find more details on this sample from the [documentation](https://docs.nvidia.com/deeplearning/physicsnemo/PhysicsNeMo-sym/user_guide/intermediate/adding_stl_files.html). This sample can be extended to incorporate parameterized geometry using CCSG instead of STL so the surrogate can adapt to patient-specific geometry. You can refer to the documentaion [here](https://docs.nvidia.com/deeplearning/physicsnemo/PhysicsNeMo-sym/user_guide/advanced/parametrized_simulations.html#creating-nodes-and-architecture-for-parameterized-problems) for more details.

## Dataset

Expand Down
18 changes: 9 additions & 9 deletions examples/reservoir_simulation/2D/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Reservoir Simulation Forward Modelling with a Physics Informed Neural Operator (PINO) - 2D Implementation
![Nvidia-Energy](https://www.dgidocs.info/slider/images/media/resources_reservoirsim.jpg)
![NVIDIA-Energy](https://www.dgidocs.info/slider/images/media/resources_reservoirsim.jpg)

## An AI enabled Automatic History Matching Workflow with a PINO based forward solver:
Reservoir model calibration is applicable and relevant for locating new hydrocarbon deposits and for CCUS stratigraphic trapping initiatives in many energy companies. Energy companies are aiming to accelerate their forward simulation codes for precise and detailed subsurface/dynamic/Petro-physical mappings of their assets/plays. A fascinating and easy to implement meshless approximation to solve reservoir simulation forward problems using physics constrained/informed deep neural networks show promising results.In this project, a physics informed neural operators (PINOs) is developed for surrogating a Two phase flow black oil model .
Reservoir model calibration is applicable and relevant for locating new hydrocarbon deposits and for CCUS stratigraphic trapping initiatives in many energy companies. Energy companies are aiming to accelerate their forward simulation codes for precise and detailed subsurface/dynamic/Petro-physical mappings of their assets/plays. A fascinating and easy to implement meshless approximation to solve reservoir simulation forward problems using physics-constrained deep neural networks shows promising results. In this project, a physics-informed neural operator (PINO) is developed to surrogate a two-phase black-oil model.


The aim of this project is to develop an integrated workflow, where the finite volume fully/adaptive implicit black oil reservoir simulator is replaced by a phyiscs informed neural operator. This approach is well suited for forward and inverse uncertainty .
The aim of this project is to develop an integrated workflow, where the finite-volume fully/adaptive implicit black-oil reservoir simulator is replaced by a physics-informed neural operator. This approach is well suited for forward and inverse uncertainty analysis.


## Methods for the forward and inverse problem (In the weeds):
Expand Down Expand Up @@ -75,7 +75,7 @@ The final pressure and saturation equations for a two-phase oil-water flow is
**Fourier Neural operator based machine infused with physics constraint from black oil model ansatz**

An FNO model architecture, introduced in [54], is shown below.
![Nvidia-Energy](https://zongyi-li.github.io/assets/img/fourier_layer.png)
![NVIDIA-Energy](https://zongyi-li.github.io/assets/img/fourier_layer.png)

The goal is to replace the Finite volume simulator with an FNO surrogate.

Expand Down Expand Up @@ -115,7 +115,7 @@ Loss_{cfd} =V(F,u;T)_{pressure} + V(u,S_w;t)_{saturation}

## Getting Started:
- These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- The code is developed in a Linux enviroment.
- The code is developed in a Linux environment.

To run the example, launch the PhysicsNeMo container using below:
```bash
Expand Down Expand Up @@ -261,7 +261,7 @@ The result for the Psurrogate is shown in Fig.2(a-d), 500 training samples was u
* 2 new PINO implementation accounting for the Overall Flux and water specific flux during the pde loss computation.
* Experimental gradient based method implementd with Adam & LBFGS for comparison purposes only to the aREKI scheme.
* Sensible initial ensemble initialisation from MPS and 6 new training images (TI's).
* Constrained presure residual method for the fully/adaptive implict finitie volume numerical solver implemented. This method has a 2 stage V cyclec AMG, with the coarsening, aggregation, colouring & level-scheduling implemented during the restrcition operation. SOR, Gauss-Seidel, Jacobi implemented during the smoothing operation. The solution from the pressure solve serves as an initialiser for the saturation solver, which is a left-preconditioned GMRES with an ILU(0) preconditoner.
* Constrained pressure residual method for the fully/adaptive implicit finite-volume numerical solver implemented. This method has a two-stage V-cycle AMG with coarsening, aggregation, coloring, and level scheduling during the restriction operation. SOR, GaussSeidel, and Jacobi are implemented during smoothing. The pressure solution serves as an initializer for the saturation solver, which is a left-preconditioned GMRES with an ILU(0) preconditioner.

**23.02**
* Bug Fixes
Expand All @@ -270,11 +270,11 @@ The result for the Psurrogate is shown in Fig.2(a-d), 500 training samples was u
* First release

## Author:
- Clement Etienam- Solution Architect-Energy @Nvidia Email: cetienam@nvidia.com
- Clement Etienam- Solution Architect-Energy @NVIDIA Email: cetienam@nvidia.com

## Contributors:
- Oleg Ovcharenko- Nvidia
- Issam Said- Nvidia
- Oleg Ovcharenko- NVIDIA
- Issam Said- NVIDIA

## References:
[1] J.-Y. Zhu, R. Zhang, D. Pathak, T. Darrell, A. A. Efros, O. Wang, E. Shechtman, Toward multimodal image-to-image translation, in Advances in Neural Information Processing Systems, 2017, pp. 465–476.
Expand Down
2 changes: 1 addition & 1 deletion examples/reservoir_simulation/2D/src/NVRS.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Nvidia Finite volume reservoir simulator with flexible solver
NVIDIA Finite volume reservoir simulator with flexible solver

AMG to solve the pressure and saturation well possed inverse problem

Expand Down
20 changes: 10 additions & 10 deletions examples/reservoir_simulation/3D/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Reservoir Simulation Forward Modelling with a Physics Informed Neural Operator (PINO) - 3D Implementation
![Nvidia-Energy](https://www.dgidocs.info/slider/images/media/resources_reservoirsim.jpg)
![NVIDIA-Energy](https://www.dgidocs.info/slider/images/media/resources_reservoirsim.jpg)

## Reservoir simulation forward modelling with a Neural Operator Surrogate :
Reservoir model calibration is applicable and relevant for locating new hydrocarbon deposits and for CCUS stratigraphic trapping initiatives in many energy companies. Energy companies are aiming to accelerate their forward simulation codes for precise and detailed subsurface/dynamic/Petro-physical mappings of their assets/plays. A fascinating and easy to implement meshless approximation to solve reservoir simulation forward problems using physics constrained/informed deep neural networks show promising results.In this project, a physics informed neural operators (PINOs) is developed for surrogating a Two phase flow black oil model .
Reservoir model calibration is applicable and relevant for locating new hydrocarbon deposits and for CCUS stratigraphic trapping initiatives in many energy companies. Energy companies are aiming to accelerate their forward simulation codes for precise and detailed subsurface/dynamic/Petro-physical mappings of their assets/plays. A fascinating and easy to implement meshless approximation to solve reservoir simulation forward problems using physics constrained/informed deep neural networks show promising results. In this project, a physics-informed neural operator (PINO) is developed to surrogate a two-phase black-oil model.


The aim of this project is to develop an integrated workflow, where the finite volume fully/adaptive implicit black oil reservoir simulator is replaced by a phyiscs informed neural operator. This approach is well suited for forward and inverse uncertainty .
The aim of this project is to develop an integrated workflow, where the finite-volume fully/adaptive implicit black-oil reservoir simulator is replaced by a physics-informed neural operator. This approach is well suited for forward and inverse uncertainty analysis.


## Methods for the forward problem (In the weeds):
Expand Down Expand Up @@ -75,7 +75,7 @@ The final pressure and saturation equations for a two-phase oil-water flow is
**Fourier Neural operator based machine infused with physics constraint from black oil model ansatz**

An FNO model architecture, introduced in [54], is shown below.
![Nvidia-Energy](https://zongyi-li.github.io/assets/img/fourier_layer.png)
![NVIDIA-Energy](https://zongyi-li.github.io/assets/img/fourier_layer.png)

The goal is to replace the Finite volume simulator with an FNO surrogate.

Expand Down Expand Up @@ -115,13 +115,13 @@ Loss_{cfd} =V(F,u;T)_{pressure} + V(u,S_w;t)_{saturation}

## Getting Started:
- These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- The code is developed in a Linux enviroment.
- The code is developed in a Linux environment.

To run the example, launch the PhysicsNeMo container using below:
```bash
docker run --rm --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 --runtime nvidia -v ${PWD}:/examples -it nvcr.io/nvidia/physicsnemo/physicsnemo:23.08
```
Currently, this example is tested to run with PhysicsNeMo release 24.09 and earlier.
Currently, this example is tested with PhysicsNeMo release 24.09 and earlier.

Next, clone the repo to get this example using:
```bash
Expand Down Expand Up @@ -209,7 +209,7 @@ tensorboard --logdir=./ --port=7007

## Results
### Summary of Numerical Model
The result for the Psurrogate is shown in Fig.2(a-d), 500 training samples was used were we compute the data loss and physics loss. The water flows from the injectors (downwards facing arrows) towards the producers (upwards facing arrows). The size of the reservoir computational voxel is nx, ny, nz = 40,40,3. Two phases are considered (oil and water) and the wells (4 injectors and 4 producers) are arranged in an “analogous 5- spot pattern” as shown in bottom-right of Fig. 4. The 4 producers well have measurable quantities of oil rate, water rate, water-cut as and are controlled by bottom-hole-pressure. The 4 water injector wells have measurable quantity of bottom hole pressure (BHP), controlled by injection rates. The reservoir is a sandstone channelised reservoir consisting of 2 lithofacies. 2,340 days of simulation are simulated. The left column of Fig.2(a-b) are the responses from the surrogate, the middle column are the responses from the finite volume solver with AMG (pressure solve) + GMRES(ILU(0)(saturation solve)) and the right column is the difference between each response. For all panels in Fig. 2(a-b), the first row is for the pressure, the second row is for the water saturation and the third row is for the oil saturation
The result for the surrogate is shown in Fig. 2(a–d); 500 training samples were used to compute the data and physics losses. The water flows from the injectors (downwards facing arrows) towards the producers (upwards facing arrows). The size of the reservoir computational voxel is nx, ny, nz = 40,40,3. Two phases are considered (oil and water) and the wells (4 injectors and 4 producers) are arranged in an “analogous 5- spot pattern” as shown in bottom-right of Fig. 4. The 4 producers well have measurable quantities of oil rate, water rate, water-cut as and are controlled by bottom-hole-pressure. The 4 water injector wells have measurable quantity of bottom hole pressure (BHP), controlled by injection rates. The reservoir is a sandstone channelised reservoir consisting of 2 lithofacies. 2,340 days of simulation are simulated. The left column of Fig.2(a-b) are the responses from the surrogate, the middle column are the responses from the finite volume solver with AMG (pressure solve) + GMRES(ILU(0)(saturation solve)) and the right column is the difference between each response. For all panels in Fig. 2(a-b), the first row is for the pressure, the second row is for the water saturation and the third row is for the oil saturation

- The results from the Forward Problem using the 4 surrogates is shown below

Expand Down Expand Up @@ -253,11 +253,11 @@ The result for the Psurrogate is shown in Fig.2(a-d), 500 training samples was u
* First release

## Author:
- Clement Etienam- Solution Architect-Energy @Nvidia Email: cetienam@nvidia.com
- Clement Etienam- Solution Architect-Energy @NVIDIA Email: cetienam@nvidia.com

## Contributors:
- Oleg Ovcharenko- Nvidia
- Issam Said- Nvidia
- Oleg Ovcharenko- NVIDIA
- Issam Said- NVIDIA


## References:
Expand Down
2 changes: 1 addition & 1 deletion examples/reservoir_simulation/3D/src/NVRS.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Nvidia Finite volume reservoir simulator with flexible solver
NVIDIA Finite volume reservoir simulator with flexible solver

AMG to solve the pressure and saturation well possed inverse problem

Expand Down
10 changes: 5 additions & 5 deletions examples/reservoir_simulation/CCUS/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,14 @@ $`w_1`$ , $`\ldots`$ , $`w_{10}`$ $`\text{ are the weights associated with the


## Important Dependencies & Prerequisites:
- Nvidia's PhysicsNeMo symbolic v23.09 :[link](https://github.com/NVIDIA/physicsnemo-sym)
- NVIDIA's PhysicsNeMo Symbolic v23.09 :[link](https://github.com/NVIDIA/physicsnemo-sym)
- CUDA 11.8 : [link](https://developer.nvidia.com/cuda-11-8-0-download-archive)
- CuPy : [link](https://github.com/cupy/cupy.git)
- Python 3.8 upwards

## Getting Started:
- These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- The code is developed in a Linux enviroment.
- The code is developed in a Linux environment.

## Installation - Bare metal / Docker

Expand Down Expand Up @@ -587,11 +587,11 @@ The overall loss is shown in the second column of the second row for all the fig


## Author:
- Clement Etienam- Solution Architect-Energy @Nvidia Email: cetienam@nvidia.com
- Clement Etienam- Solution Architect-Energy @NVIDIA Email: cetienam@nvidia.com

## Contributors:
- Kaustubh Tangsali- Nvidia
- Issam Said- Nvidia
- Kaustubh Tangsali- NVIDIA
- Issam Said- NVIDIA



Expand Down
12 changes: 6 additions & 6 deletions examples/reservoir_simulation/CCUS/src/Compare_FVM_surrogate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2840,7 +2840,7 @@ def process_step(

elapsed_time_secs2 = time.time() - start_time_plots2
msg = (
"Reservoir simulation with Nvidia PhysicsNeMo took: %s secs (Wall clock time)"
"Reservoir simulation with NVIDIA PhysicsNeMo took: %s secs (Wall clock time)"
% timedelta(seconds=round(elapsed_time_secs2))
)
print(msg)
Expand All @@ -2855,13 +2855,13 @@ def process_step(
if physicsnemo_time < flow_time:
slower_time = physicsnemo_time
faster_time = flow_time
slower = "Nvidia PhysicsNeMo Surrogate"
slower = "NVIDIA PhysicsNeMo Surrogate"
faster = "Flow Reservoir Simulator"
else:
slower_time = flow_time
faster_time = physicsnemo_time
slower = "Flow Reservoir Simulator"
faster = "Nvidia PhysicsNeMo Surrogate"
faster = "NVIDIA PhysicsNeMo Surrogate"

# Calculate speedup
speedup = math.ceil(faster_time / slower_time)
Expand Down Expand Up @@ -3218,7 +3218,7 @@ def process_step(

elapsed_time_secs2 = time.time() - start_time_plots2
msg = (
"Reservoir simulation with Nvidia PhysicsNeMo (FNO) took: %s secs (Wall clock time)"
"Reservoir simulation with NVIDIA PhysicsNeMo (FNO) took: %s secs (Wall clock time)"
% timedelta(seconds=round(elapsed_time_secs2))
)
print(msg)
Expand All @@ -3233,13 +3233,13 @@ def process_step(
if physicsnemo_time < flow_time:
slower_time = physicsnemo_time
faster_time = flow_time
slower = "Nvidia PhysicsNeMo Surrogate"
slower = "NVIDIA PhysicsNeMo Surrogate"
faster = "Flow Reservoir Simulator"
else:
slower_time = flow_time
faster_time = physicsnemo_time
slower = "Flow Reservoir Simulator"
faster = "Nvidia PhysicsNeMo Surrogate"
faster = "NVIDIA PhysicsNeMo Surrogate"

# Calculate speedup
speedup = math.ceil(faster_time / slower_time)
Expand Down
Loading