Skip to content

Damp hyper-cleaning psi with the current-stage value - #2120

Draft
sbryngelson wants to merge 1 commit into
MFlowCode:masterfrom
sbryngelson:wave1/hyper-cleaning-psi
Draft

sbryngelson wants to merge 1 commit into
MFlowCode:masterfrom
sbryngelson:wave1/hyper-cleaning-psi

Conversation

@sbryngelson

Copy link
Copy Markdown
Member

What

The psi damping term in s_compute_rhs read q_prim_vf(psi), the time stepper's primitive array. That array is only refreshed at the end of s_compute_rhs, and only when run_time_info, probe_wrt, ib or bubbles_lagrange is set, so the damping used the previous stage's psi or, with none of those flags, a never-written array. Toggling run_time_info changed the solution.

Use q_prim_qp%vf(psi), which aliases the current-stage conservative psi.

Results change

Yes, for hyper-cleaning MHD cases. run_time_info = T and F now give bit-identical output on a shrunk 2D_orszag_tang_hyper_cleaning case (they differed before). The golden for B4DC99F9 (2D -> MHD -> hyper_cleaning) is regenerated; max abs deviation from the old golden is 3.9e-4. golden-metadata.txt is left unchanged.

Verification

Testing. Built with GPU offload (OpenMP, AMD) and ran the full test suite with this fix and three other independent fixes applied together: 729 tests in 4 shards, 0 failures (three shards on MI300A, one on MI250X).

Prepared with Claude Code (AI-assisted); I reviewed the change and ran the tests.

The psi damping term in s_compute_rhs read q_prim_vf(psi), the time
stepper's primitive array. That array is only refreshed at the end of
s_compute_rhs, and only when run_time_info, probe_wrt, ib or
bubbles_lagrange is set, so the damping used the previous stage's psi
or, with none of those flags, a never-written array. Toggling
run_time_info changed the solution.

Use q_prim_qp%vf(psi), which aliases the current-stage conservative psi.
run_time_info = T and F now give bit-identical output on a shrunk
2D_orszag_tang_hyper_cleaning case.

Regenerated golden for B4DC99F9 (2D -> MHD -> hyper_cleaning); max
abs deviation 3.9e-4.
@sbryngelson
sbryngelson requested a review from a team as a code owner November 3, 2026 03:26
@sbryngelson
sbryngelson requested review from danieljvickers and removed request for a team November 3, 2026 03:26
@sbryngelson
sbryngelson marked this pull request as draft November 3, 2026 03:39
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Claude Code Review

Head SHA: 3260207

Files changed:

  • 1
  • src/simulation/m_rhs.fpp

Findings:
No issues found. Checked in step 4: src/simulation/m_rhs.fpp (the hyper-cleaning psi loop against its q_prim_qp/q_prim_vf declarations and uses).

@codecov

codecov Bot commented Nov 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.90%. Comparing base (a03848a) to head (3260207).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2120   +/-   ##
=======================================
  Coverage   61.90%   61.90%           
=======================================
  Files          86       86           
  Lines       22948    22948           
  Branches     3386     3386           
=======================================
  Hits        14205    14205           
  Misses       6229     6229           
  Partials     2514     2514           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Development

Successfully merging this pull request may close these issues.

1 participant