Skip to content

[Docs] Missing examples for direct Python-ML coupling (PyTorch/TensorFlow) #2637

@ayush4874

Description

@ayush4874

Problem Description

The current Python Wrapper examples primarily focus on shape optimization (FADO) or basic fluid driver execution. However, with the growing interest in Physics-Informed Machine Learning (PIML) and the integration of MLPCpp, there are no clear examples demonstrating how to couple the SU2 solver with external ML libraries (like PyTorch) in a single process.

Users currently have to guess how to extract field variables (e.g., RMS_DENSITY) from memory and pass them to a training loop in real-time.

Proposed Solution

I propose adding a dedicated example directory SU2_PY/examples/hybrid_ml_coupling/ containing a script that demonstrates:

  1. Initializing the CSinglezoneDriver with mpi4py.
  2. Running a time-stepping loop where the solver runs alongside a lightweight surrogate model.
  3. Extracting flow data from memory (using GetOutputValue) to train the model online.

I have prototyped a working script using PyTorch and would like to submit a PR to add this to the documentation/examples.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions