[Resource] Hybrid PyTorch-SU2 Coupling with Python Wrapper (Example & Docs) #2642
ayush4874
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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