[Resource] Hybrid PyTorch-SU2 Coupling with Python Wrapper (Example & Docs) #2642
Replies: 2 comments
-
|
Hi Ayush. |
Beta Was this translation helpful? Give feedback.
-
|
Hi Evert, thanks for running the case! You are completely right, mapping My actual target application is Data-Driven Turbulence Modeling (Closure Modeling). The goal is to use the neural network to predict closure terms (like eddy viscosity) and update them on-the-fly to match experimental data (Inverse Design/Data Assimilation). This is the PR I just opened on MLPCpp (PR #4). The tutorial showed we can read from SU2; the PR enables us to write (update the model) to do the actual turbulence work. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I've been working on setting up an online (in-situ) coupling between SU2 and PyTorch using the Python Wrapper, and I noticed there wasn't a standalone example for this workflow in the tutorials yet.
I've successfully prototyped a bidirectional loop where SU2 runs within an MPI process, and a PyTorch model extracts flow physics (like
RMS_DENSITY) in real-time.To help others getting started with Physics-ML coupling, I've submitted the scripts and documentation to the official repositories:
train_online.pyand configs)CSinglezoneDriverloop)Current Limitation & Next Steps:
Currently, this workflow is excellent for extraction (Physics -> ML). However, I've noticed that injecting updated weights back into the C++
MLPCppmodule during runtime is tricky due to encapsulation.I am currently prototyping a C++ patch to allow dynamic weight injection (Online Learning), which I hope to propose for GSoC 2026.
I'd love any feedback from those working on data-driven surrogates!
Best,
Ayush
Beta Was this translation helpful? Give feedback.
All reactions