Skip to content

Conversation

@guptapratykshh
Copy link
Contributor

Proposed Changes

This PR fixes the crash that occurs when restarting simulations with missing fields in restart files. I've implemented field-based restart loading for turbulence and transition solvers, so you can now restart a RANS simulation from an Euler solution, or switch between turbulence models (e.g., SA to SST) without SU2 crashing.

The implementation uses field name lookup instead of fixed offsets, making restart files more flexible. When a field is missing (like Nu_Tilde when restarting SA from Euler), SU2 now initializes it from defaults and shows a clear warning instead of crashing.

  • Added FindFieldIndices() helper to CSolver for batch field lookup using std::find
  • Refactored CTurbSolver::LoadRestart() to support SA and SST models with missing fields
  • Updated CTransLMSolver::LoadRestart() for LM transition model compatibility
  • Created test configs demonstrating Euler → RANS restart workflow

Related Work

Resolves #2483

This addresses the long-standing issue where SU2 would crash when enabling turbulence models or switching between models during restart. The implementation is backward compatible - existing restart workflows continue to work unchanged.

PR Checklist

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary.

@guptapratykshh guptapratykshh changed the base branch from master to develop January 14, 2026 13:05
@guptapratykshh guptapratykshh force-pushed the feature/field-based-restart-turb-2483 branch from 2bfc6c6 to fc0f151 Compare January 14, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restart with missing fields

2 participants