Skip to content

Comments

Fix GRCBC subsonic inflow using wrong L index#1224

Closed
sbryngelson wants to merge 1 commit intoMFlowCode:masterfrom
sbryngelson:fix/grcbc-L-index
Closed

Fix GRCBC subsonic inflow using wrong L index#1224
sbryngelson wants to merge 1 commit intoMFlowCode:masterfrom
sbryngelson:fix/grcbc-L-index

Conversation

@sbryngelson
Copy link
Member

@sbryngelson sbryngelson commented Feb 21, 2026

User description

Summary

  • In the GRCBC subsonic inflow boundary condition, the wave amplitude array was indexed as L(2) instead of L(i) inside a do i = 2, momxb loop
  • This meant only L(2) was repeatedly overwritten rather than setting each L(i) for the corresponding wave

Test plan

  • Verify GRCBC subsonic inflow test cases produce correct results
  • May need golden file regeneration if prior results silently used the buggy index

🤖 Generated with Claude Code


CodeAnt-AI Description

Fix GRCBC subsonic inflow to assign each wave amplitude correctly

What Changed

  • The subsonic inflow boundary now sets each wave amplitude L(i) inside the loop instead of repeatedly overwriting L(2), so every wave entry is updated.
  • This changes the computed inflow boundary state for cases using the GRCBC subsonic option and can affect any dependent simulation outputs or comparisons.

Impact

✅ Correct subsonic boundary wave amplitudes
✅ More accurate GRCBC inflow results
✅ Fewer silent simulation result mismatches

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue with subsonic inflow boundary condition handling in simulations to ensure corrections are applied consistently across all relevant parameters.

In the GRCBC subsonic inflow loop (do i = 2, momxb), L(2) was
hardcoded instead of L(i), causing only the second wave amplitude
to be updated rather than each wave amplitude in the loop.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codeant-ai

This comment has been minimized.

@coderabbitai

This comment has been minimized.

@codeant-ai codeant-ai bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Feb 21, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@codeant-ai

This comment has been minimized.

@codeant-ai

This comment has been minimized.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes a critical indexing bug in the GRCBC (Generalized Relaxation Characteristic Boundary Condition) subsonic inflow implementation within the characteristic boundary condition module. The bug caused incorrect wave amplitude calculations by repeatedly overwriting a single array element instead of populating the entire wave amplitude array.

Changes:

  • Fixed indexing bug in GRCBC subsonic inflow where L(2) was incorrectly used instead of L(i) inside a loop
  • This ensures each wave amplitude L(i) is correctly computed for i = 2 to momxb

@codecov
Copy link

codecov bot commented Feb 22, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 44.05%. Comparing base (d048c4b) to head (224c548).
⚠️ Report is 19 commits behind head on master.

Files with missing lines Patch % Lines
src/simulation/m_cbc.fpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1224      +/-   ##
==========================================
- Coverage   44.07%   44.05%   -0.02%     
==========================================
  Files          70       70              
  Lines       20431    20498      +67     
  Branches     1974     1990      +16     
==========================================
+ Hits         9004     9030      +26     
- Misses      10291    10329      +38     
- Partials     1136     1139       +3     

☔ View full report in Codecov by Sentry.
📢 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.

@sbryngelson
Copy link
Member Author

Superseded by #1242 (batched HPC-sensitive fixes)

@sbryngelson sbryngelson deleted the fix/grcbc-L-index branch February 22, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files

Development

Successfully merging this pull request may close these issues.

1 participant