PhysicsNeMo Symbolic

repository·main·Indexed 43 days ago

https://github.com/nvidia/physicsnemo-sym

A deep learning framework for AI-driven multi-physics systems. It provides tools to integrate symbolic Partial Differential Equations (PDEs) into AI model training, enabling Physics-Informed Neural Networks (PINNs) and other architectures like Fourier Neural Operators (FNO) and Physics-Informed Neural Operators (PINO) for applications in fluid dynamics, electromagnetics, geophysics, and design optimization.

Tokens
73.7K
Snippets
147
Records
325
Agent score
56%

What's inside PhysicsNeMo Symbolic

  1. What is PhysicsNeMo Symbolic?

    main

    PhysicsNeMo Symbolic (PhysicsNeMo Sym) is a sub-module of the PhysicsNeMo framework designed to explicitly physics-inform the training of AI models.

    Core Capabilities:

    • Symbolic PDEs: Utilities for explicitly integrating symbolic Partial Differential Equations (PDEs).
    • Domain Sampling: Tools for sampling physical domains.
    • Residual Computation: Computing PDE-based residuals using various gradient computing schemes.
    • Abstraction Layer: Provides an API to compose training loops by specifying geometry, PDEs, and constraints (such as boundary conditions) using simple symbolic APIs.
  2. Overview of the AI-enabled Automatic History Matching Workflow

    main

    This workflow integrates a Physics Informed Neural Operator (PINO) as a surrogate for a traditional finite volume black oil reservoir simulator. The primary goal is to accelerate reservoir model calibration (history matching) by replacing computationally expensive forward simulation codes with a meshless, physics-constrained deep neural network.

    Key components of the workflow include:

    • Forward Problem: Solved using a PINO surrogate for two-phase flow black oil models.
    • Inverse Problem: Solved using a weighted adaptive regularised ensemble Kalman inversion method ($\alpha$REKI) featuring covariance localisation and a mixture-of-experts approach (referred to as PINO-CCR).
    • Uncertainty Quantification: Supported by the PINO-CCR approach and a gradient-based conjugate-gradient method with line-search satisfying Armijo conditions.
  3. Overview of AI-enabled Automatic History Matching Workflow

    main

    This project provides an integrated workflow for reservoir model calibration, specifically designed to accelerate subsurface forecasting in petroleum and geothermal environments.

    Key components of the workflow include:

    • Forward Problem (Surrogate Modeling): Replaces traditional finite volume fully/adaptive implicit black oil reservoir simulators with a Physics Informed Neural Operator (PINO). This PINO surrogate is used to model two-phase flow black oil models.
    • Inverse Problem (History Matching): Uses the PINO surrogate to solve the ill-posed inverse process of finding reservoir model parameters that honor static (core, logging, seismic) and dynamic (oil/gas rate, water cut, pressure) data.

    Inverse Problem Methods:

    1. $\alpha$REKI (Weighted adaptive Regularised Ensemble Kalman Inversion): A newly developed method capable of handling various exotic priors. It is well-suited for both forward and inverse uncertainty quantification.
    2. Gradient-based Conjugate Gradient Method: Utilizes line-search methodology and Armijo conditions for optimization.
  4. Overview of Automatic History Matching Workflow

    main

    This project provides an integrated workflow for reservoir model calibration (history matching) using a GPU-based black oil forward solver. It aims to find reservoir model parameters (like permeability, porosity, and facies) that honor observed dynamic data (e.g., oil/gas rates, water cut, bottomhole pressure) and static data.

    Key components include:

    • Inverse Problem: Solved using a newly developed Weighted-$\alpha$REKI (Weighted adaptive Regularised Ensemble Kalman Inversion) method. This approach is designed for both forward and inverse uncertainty quantification and can handle various exotic priors.
    • Forward Problem: Uses a GPU-based black oil reservoir simulator (NVRS) to model two-phase flow (oil and water) in porous media.
  5. Use PhysicsNeMo Sym Validators

    main

    PhysicsNeMo Sym provides a validation framework to ensure domain constraints are met during simulation or training. Validators are categorized into three main types:

    1. Continuous Validators: Used for enforcing constraints on continuous physical fields or variables (e.g., pressure, velocity, temperature) that must stay within specific ranges or satisfy differential properties.
    2. Discrete Validators: Used for enforcing constraints on discrete entities or quantized states.
    3. Validators Base: The foundational interface and base classes used to implement custom validation logic.

    To implement a custom validator, you should inherit from the base validator classes provided in physicsnemo.sym.domain.validator.validator.

  6. Understand the Norne Field Reservoir Simulation Example

    main

    The Norne Field example demonstrates an AI-enabled Automatic History Matching (AHM) workflow. It uses a Physics Informed Neural Operator (PINO) as a surrogate forward model coupled with a $\alpha$REKI (Weighted adaptive Regularised Ensemble Kalman Inversion) scheme for the inverse problem.

    Key Components:

    • Forward Problem: Uses a PINO surrogate to simulate reservoir evolution (pressure, water saturation, oil saturation, and gas saturation) over time (e.g., 3,298 days).
    • Inverse Problem: Uses the PINO-CCR surrogate to perform history matching, recovering permeability fields and production rates ($Q_o$, $Q_w$, $Q_g$) by matching observed data.
    • Surrogate Models: The example compares different PINO architectures, specifically PINO-CCR and PINO-FNO.
    • Simulation Details: The model considers three phases (oil, gas, and water) across a computational voxel grid of $n_x, n_y, n_z = 46, 112, 22$.
  7. Explore Reservoir Simulation Examples in PhysicsNeMo-Sym

    main

    The examples/reservoir_simulation/ directory provides a collection of specialized workflows for reservoir simulation using NVIDIA PhysicsNeMo-Sym. Depending on your project requirements, you can explore the following categories:

    • Dimensionality-based simulations:
      • 2D/: Guidelines and scripts for 2D reservoir-simulation forward problems.
      • 3D/: Setup and sample scripts for 3D reservoir-simulation forward problems.
    • Application-specific workflows:
      • CCUS/: Carbon Capture, Utilization, and Storage (CCUS) reservoir-simulation problems.
      • Norne/: Forward and inverse problems (history matching) specifically for the Norne field.
      • GenAI_workflows/: Generative-AI workflows for both forward and inverse 2D and 3D reservoir-simulation problems.
    • Numerical Solvers:
      • Numerical_solvers/Black_oil_simulator/: Efficient handling of black oil reservoirs.
      • Numerical_solvers/CO2_convective_mixing_simulator/: Simulating convective mixing of CO2 for carbon sequestration studies.
      • Numerical_solvers/Reservoir_history_matching/: Techniques to match historical data with simulated results to improve model accuracy.
  8. Explore PhysicsNeMo Sym example use cases

    main
    The physicsnemo-sym repository contains sample applications demonstrating various Physics-ML model architectures applied to real-world problems. Examples are categorized by domain and difficulty level (Introductory, Intermediate, Advanced), and specify the model type used (e.g., PINN, FNO, PINO) and execution attributes (e.g., Multi-GPU, Multi-Node).
  9. Automatic History Matching with PINO and $\alpha$REKI on the Norne Field

    main

    This project demonstrates an AI-enabled Automatic History Matching (AHM) workflow for reservoir calibration. It replaces traditional finite volume fully/adaptive implicit black oil reservoir simulators with a Physics Informed Neural Operator (PINO) surrogate.

    To solve the inverse problem (finding reservoir model parameters that honor observations), the workflow utilizes a newly developed method called PINO-CCR. This method combines:

    • $\alpha$REKI: A weighted adaptive Regularised Ensemble Kalman Inversion scheme.
    • Covariance Localisation: To improve the inversion process.
    • Mixture of Experts (MoE): To better handle non-Gaussian distributions of model parameters (such as facies) which traditional ensemble-based data assimilation methods often struggle to preserve.

    The workflow is designed for both forward and inverse uncertainty quantification in subsurface structures, applicable to petroleum and geothermal reservoir forecasting and CCUS (Carbon Capture, Utilization, and Storage) initiatives.

  10. Understand the 2D Reservoir Simulation PINO Implementation

    main

    This example demonstrates reservoir simulation forward modelling using a Physics Informed Neural Operator (PINO). The implementation models a 2D sandstone channelised reservoir with two lithofacies, simulating two phases (oil and water) over 2,340 days.

    Numerical Model Details:

    • Grid Size: $nx, ny, nz = 33, 33, 1$.
    • Well Configuration: An 'analogous 5-spot pattern' consisting of 4 injectors and 4 producers.
    • Control Variables:
      • Injectors: Controlled by injection rates; measurable quantity is bottom-hole pressure (BHP).
      • Producers: Controlled by bottom-hole pressure (BHP); measurable quantities include oil rate, water rate, and water-cut.
    • Surrogate Models Compared:
      • FNO: Fourier Neural Operator.
      • PINO: Physics Informed Neural Operator.
      • AFNOD: Data-driven Adaptive Fourier Neural Operator.
      • AFNOP: Physics + Data-driven Adaptive Fourier Neural Operator.
  11. Explore PhysicsNeMo Sym examples

    main

    PhysicsNeMo Sym provides a variety of examples categorized by complexity and methodology. You can use these examples to learn the basics, understand physics-informed foundations, implement neural operators, or dive into intermediate and advanced case studies.

    Example Categories

    • Basics: Fundamental workflows, such as the lid_driven_cavity_flow.
    • Physics-Informed Foundations: Core physics problems including 1D/2D wave equations, ODE spring-mass systems, zero-equation turbulence, scalar transport, linear elasticity, and inverse problems.
    • Neural Operators: Implementations of specific operator architectures like darcy_fno, darcy_afno, darcy_pino, and deeponet.
    • Intermediate Case Studies: More complex scenarios such as variational methods, adding STL files, moving time windows, electromagnetic (EM) problems, two-equation turbulent channel flows, and turbulence super-resolution.
    • Advanced Case Studies: High-fidelity or specialized applications including conjugate heat transfer, parametrized simulations, 2D heat transfer, FPGA integration, and industrial heat sink modeling.
  12. Use PhysicsNeMo Sym IO utilities for plotting, VTK, and CSV

    main

    The physicsnemo.sym.utils.io module provides utilities for handling common input and output tasks in symbolic physics modeling, including visualization and data serialization.

    Available submodules:

    • physicsnemo.sym.utils.io.plotter: For generating plots and visualizations.
    • physicsnemo.sym.utils.io.vtk: For exporting data to VTK format (commonly used with ParaView).
    • physicsnemo.sym.utils.io.csv_rw: For reading and writing CSV files.