TAAFT
Free mode
100% free
Freemium
Free Trial
Deals

NVIDIA / physicsnemo-cfd

L​ibrary for using the models trained in PhysicsNeMo in Engineering and CFD workflows

82 15 Language: Jupyter Notebook License: Apache-2.0 Updated: 1d ago

README

PhysicsNeMo CFD

Project Status: Active - The project has reached a stable, usable state and
is being actively
developed.
GitHub
Code style:
black

PhysicsNeMo CFD | Getting
started
| Contributing
Guidelines
|
Communication

What is PhysicsNeMo CFD?

NVIDIA PhysicsNeMo-CFD is a sub-module of NVIDIA PhysicsNeMo
framework
that provides the tools
needed to integrate pretrained AI models into engineering and CFD workflows.

The library is a collection of loosely-coupled workflows around the trained AI
models for CFD, with abstractions and relevant data structures.

Refer to the PhysicsNeMo
framework
to learn
more about the full stack.

The library offers utilities for:

  • NIM Inference:

    • An inference recipe calling pre-trained AI models that were trained using
      PhysicsNeMo and hosted as NVIDIA Inference Microservices (for example, the
      DoMINO Automotive Aerodynamics
      NIM
      )
      from a Python interface, facilitating scalable deployment of trained models.
  • Benchmarking of ML Model Accuracy:

    • A benchmark for evaluating and validating the results of trained ML models
      against traditional CFD results using a broad set of built-in engineering
      metrics (for example, pointwise errors, integrated quantities, spectral
      metrics, PDE residuals). Related publication
    • Utilities to extend and build custom metrics, analyze, and visualize the
      results of trained ML models, both mesh-based and point-cloud based models
  • Hybrid Initialization:

    • An end-to-end recipe for initializing a CFD simulation with a
      trained ML model hybridized with potential flow solutions, to accelerate CFD
      convergence (particularly for high-fidelity, unsteady cases). Related
      publication

Installation

PhysicsNeMo-CFD is a Python package that depends on the NVIDIA PhysicsNeMo
framework
.

PhysicsNeMo-CFD depends on PhysicsNeMo. The pip installation command below will install
PhysicsNeMo automatically if not present.

For maximum cross-platform compatibility, we recommend using the PhysicsNeMo
Docker container. Steps to use the PhysicsNeMo container
can be found in the Getting Started guide.

You can install PhysicsNeMo-CFD via pip:

git clone https://github.com/NVIDIA/physicsnemo-cfd.git
cd physicsnemo-cfd
pip install .

To get access to GPU-accelerated functionalities from this repository when installing
in a conda or custom Python environment, please run the commands below.

If you are using the PhysicsNeMo container,
the GPU-specific dependencies are pre-installed, so this additional step is
not required.

pip install .[gpu] --extra-index-url=https://pypi.nvidia.com

[!Note] PhysicsNeMo-CFD is an experimental library and currently v0; expect
breaking changes. PhysicsNeMo-CFD is for demonstrating workflows, rather
than providing a stable API for production-level deployments.

When updating, see the latest changes in the CHANGELOG.md
file.

Getting started

To get started, use the DoMINO NIM on a sample as shown below:

from physicsnemo.cfd.inference.domino_nim import call_domino_nim
import subprocess

filenames = [
    "drivaer_202.stl",
]
urls = [
    "https://huggingface.co/datasets/neashton/drivaerml/resolve/main/run_202/drivaer_202.stl",
]

for url, filename in zip(urls, filenames):
    subprocess.run(["wget", url, "-O", filename], check=True)

output_dict = call_domino_nim(
    stl_path="./drivaer_202.stl",
    inference_api_url="http://localhost:8000/v1/infer",
    data={
        "stream_velocity": "38.89",
        "stencil_size": "1",
        "point_cloud_size": "500000",
    },
    verbose=True,
)

Refer to the workflows directory for detailed instructions on
executing individual reference workflows and samples. These are primarily
packaged as Jupyter notebooks where possible, to provide inline
documentation and visualization of expected results.

Contributing to PhysicsNeMo

PhysicsNeMo is an open-source collaboration and its success is rooted in
community contributions to further the field of Physics-ML. Thank you for
contributing to the project so others can build on top of your contributions.

For guidance on contributing to PhysicsNeMo, refer to the contributing
guidelines
.

Cite PhysicsNeMo

If PhysicsNeMo helped your research and you would like to cite it, refer to the
guidelines.

Communication

  • GitHub Discussions: Discuss new architectures, implementations, and Physics-ML
    research.
  • GitHub Issues: Bug reports, feature requests, and installation issues.
  • PhysicsNeMo Forum: The PhysicsNeMo
    Forum

    hosts an audience of new to moderate-level users and developers for general
    chat, online discussions, and collaboration.

Feedback

Want to suggest some improvements to PhysicsNeMo? Use our feedback
form
.

License

PhysicsNeMo is provided under the Apache License 2.0, see
LICENSE.txt for full license text.

0 AIs selected
Clear selection
#
Name
Task