Skip to content

Use the ghost-cell spacing for the z one-sided viscous gradient - #2119

Draft
sbryngelson wants to merge 1 commit into
MFlowCode:masterfrom
sbryngelson:wave1/viscous-z-ghost-spacing
Draft

sbryngelson wants to merge 1 commit into
MFlowCode:masterfrom
sbryngelson:wave1/viscous-z-ghost-spacing

Conversation

@sbryngelson

Copy link
Copy Markdown
Member

What

s_compute_fd_gradient's one-sided z derivative at idwbuff(3)%beg divided by z_cc(beg + 2) - z_cc(is3_viscous%beg). is3_viscous%beg is idwbuff(3)%beg + 1 there, so the denominator spanned one cell instead of two and the outermost ghost gradient was doubled on a uniform grid.

Divide by z_cc(beg + 2) - z_cc(beg), matching the x and y stencils.

Who it affects

3D viscous runs (viscous = T) with the Reynolds-number flux path: the outermost ghost-layer z gradient at the lower z boundary.

Verification

No existing golden changes: the 27 3D Viscous tests pass against the current goldens, so no test covers the affected ghost gradient.

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.

s_compute_fd_gradient's one-sided z derivative at idwbuff(3)%beg
divided by z_cc(beg + 2) - z_cc(is3_viscous%beg). is3_viscous%beg is
idwbuff(3)%beg + 1 there, so the denominator spanned one cell instead
of two and the outermost ghost gradient was doubled on a uniform grid.

Divide by z_cc(beg + 2) - z_cc(beg), matching the x and y stencils.

The 27 3D Viscous tests pass against the existing goldens.
@sbryngelson
sbryngelson requested a review from a team as a code owner November 3, 2026 03:26
@sbryngelson
sbryngelson requested review from wilfonba and removed request for a team November 3, 2026 03:26
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Claude Code Review

Head SHA: 2db6102

Files changed:

  • 1
  • src/simulation/m_viscous.fpp

Findings:
No issues found. Checked in step 4: src/simulation/m_viscous.fpp. The z-direction one-sided gradient at idwbuff(3)%beg now divides by z_cc(idwbuff(3)%beg + 2) - z_cc(idwbuff(3)%beg). This matches the x and y analogues, and it replaces the stale is3_viscous%beg, which can differ from idwbuff(3)%beg.

@sbryngelson
sbryngelson marked this pull request as draft November 3, 2026 03:39
@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 (2db6102).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2119   +/-   ##
=======================================
  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