Skip to content

Make the NEMO total-energy under-relaxation check reachable - #2884

Open
bellonarts wants to merge 2 commits into
su2code:developfrom
babybluechips:fix_nemo_energy_underrelaxation
Open

Make the NEMO total-energy under-relaxation check reachable#2884
bellonarts wants to merge 2 commits into
su2code:developfrom
babybluechips:fix_nemo_energy_underrelaxation

Conversation

@bellonarts

@bellonarts bellonarts commented Sep 5, 2026

Copy link
Copy Markdown

The total energy check was inside the species block, so it never ran. I moved the closing brace so the check can run and limit the energy update.

I added a test that checks large energy updates are limited and smaller updates are left alone. I also updated the expected regression values.

This PR overlaps with #2883, which fixes the coarse viscous Jacobian edge length, and #2885, which fixes the viscous Jacobian blocks and assembly. All three update visc_cone in serial_regression.py and visc_cone, super_cat, and ion_gy in parallel_regression.py. After each merge, rebase the remaining PRs and update those expected values from their new CI runs.

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.

bellonarts and others added 2 commits September 3, 2026 13:25
In CNEMOEulerSolver::ComputeUnderRelaxationFactor the total-energy check
(iVar == nVar-2) was nested inside the species block (iVar < nSpecies).
Total energy sits at nSpecies+nDim, so the check could never run and the
energy update was never under-relaxed. Close the species block first and
evaluate the energy check on its own; no new logic is added.

This changes the implicit update wherever the energy bound is active, so
the affected NEMO regression vectors are rebaselined (serial: invwedge,
visc_cone; parallel: invwedge_a, invwedge_msw, invwedge_roe, invwedge_lax,
invwedge_ss_inlet, visc_cone, super_cat, ion_gy). The aarch64 vectors are
left for a maintainer. A unit test builds a NEMO Euler solver on the unit
box and checks that an over-large energy update is limited (it stays
unlimited on the previous code) alongside a species control.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Update the branch-specific serial and two-rank aarch64 expectations from GitHub Actions run 33998938091 at exact pre-update head a495681. Artifact digest: sha256:4c9d814dd9a373592fce4c9f33f74e565e26016ee855b2df8660bbcc99e4d560. No x86 expectation or solver source changes.
@bigfooted

Copy link
Copy Markdown
Contributor

you don't have to write almost 100 lines to explain basically the movement of a closing brace :-)

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.

2 participants