Skip to content

Fix LM transition model state on dual-time steady restart - #2999

Open
PhaGe8539 wants to merge 1 commit into
su2code:developfrom
PhaGe8539:fix_lm_dualtime_restart
Open

PhaGe8539 wants to merge 1 commit into
su2code:developfrom
PhaGe8539:fix_lm_dualtime_restart

Conversation

@PhaGe8539

Copy link
Copy Markdown

Proposed Changes

A dual-time run started from a steady solution, or restarted, loses the LM transition state. CFVMFlowSolverBase::LoadRestart's dual-time handling covers FLOW and TURB but not TRANS, and the time levels in CTransLMVariable start at zero. The first physical step then sees a wrong Solution_time_n / Solution_time_n1 for the LM equations.

This PR:

  • pushes TRANS_SOL to time levels n and n-1 alongside FLOW and TURB;
  • loads the second restart file for the transition model on 2nd-order restarts, and pushes it to level n;
  • initialises Solution_time_n and Solution_time_n1 from the initial state in CTransLMVariable when dual time stepping is on.

Test

2-D RG14 airfoil, Re 2e5, alpha 1.97 deg, SST + LM, DUAL_TIME_STEPPING-2ND_ORDER, no multigrid. I ran 10 physical steps continuously and compared them with 9 steps + restart + 1 step, using the same steady seed for both.

Values at step 10, continuous vs restarted:

Binary rms[LM_1] rms[LM_2] CD
8.5.0 release -3.8146 vs -0.3549 -0.8087 vs 0.3235 0.00975976 vs 0.00975678
develop f4b67d2 + this PR -6.9209 vs -6.9209 -1.5798 vs -1.5798 0.00975914 vs 0.00975914

With this PR, all residuals, CL and CD at step 10 match to the printed digits, for both WRT_RESTART_COMPACT YES and NO.

Limits of this test:

  • The "before" row is the 8.5.0 release, not unpatched develop. I read the develop code and the same gaps are there, but I did not run an unpatched develop build.
  • Not tested with multigrid, compressible cases other than this one, or MPI (OpenMP build only).
  • No regression case added yet. I am happy to add one if you can suggest the right place.

Related Work

Fixes #2993.

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.

This fix was written with AI assistance (Claude) and tested by running the case above.

🤖 Generated with Claude Code

The dual-time handling in LoadRestart covered FLOW and TURB but not
TRANS, and the time levels in CTransLMVariable started at zero. Push
TRANS_SOL to time levels n and n-1, load its second restart file on
2nd-order restarts, and initialise the time levels from the initial
state when dual time stepping is on.

Fixes su2code#2993

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant