Skip to content

Files

Latest commit

53d8288 · Mar 19, 2025

History

History

ldc_pinns

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Mar 19, 2025
Sep 24, 2024
Mar 18, 2025

Lid Driven Cavity Flow using Purely Physics Driven Neural Networks (PINNs)

This example demonstrates how to set up a purely physics-driven model for solving a Lid Driven Cavity (LDC) flow using PINNs. The goal of this example is to demonstrate the interoperability of PhysicsNeMo, PhysicsNeMo-Sym and PyTorch. This example adopts a workflow where appropriate utilities are imported from physicsnemo, physicsnemo.sym and torch to define the training pipeline.

Specifically, this example demonstrates how the geometry and physics utilites from PhysicsNeMo-Sym can be used in custom training pipelines to handle geometry objects (typically found in Computer Aided Engineering (CAE)) workflows and introduce physics residual and boundary condition losses.

This example takes a non-abstracted way to define the problem. The boundary condition constraints, residual constraints, and the subsequent physics loss computation are defined explicitly. For a more abstracted version of this workflow, where some of these steps are automated and abstracted, we recommend the Introductory example tutorial from PhysicsNeMo-Sym.

Getting Started

Prerequisites

If you are running this example outside of the PhysicsNeMo container, install PhysicsNeMo Sym using the instructions from here

Training

To train the model, run

python train.py

This should start training the model. Since this is training in a purely Physics based fashion, there is no dataset required.

Instead, we generate the geometry using the PhysicsNeMo Sym's geometry module and sample point cloud using GeometryDatapipe utility. For more details refer documentation here

For computing the physics losses, we will use the PhysicsInformer utility from PhysicsNeMo-Sym. For more details, refer documentation here

The results would get saved in the ./outputs/ directory.

Additional Reading

This example demonstrates computing physics losses on point clouds. For more examples on physics informing different type of models and model outputs, refer: