Skip to content

Comments

Remove duplicate R3bar accumulation line that doubles bubble perturbation#1183

Open
sbryngelson wants to merge 1 commit intoMFlowCode:masterfrom
sbryngelson:fix/duplicate-r3bar
Open

Remove duplicate R3bar accumulation line that doubles bubble perturbation#1183
sbryngelson wants to merge 1 commit intoMFlowCode:masterfrom
sbryngelson:fix/duplicate-r3bar

Conversation

@sbryngelson
Copy link
Member

@sbryngelson sbryngelson commented Feb 21, 2026

Summary

Severity: HIGH — doubles bubble perturbation for QBMM cases.

File: src/pre_process/m_assign_variables.fpp, lines 235-236

Character-for-character identical duplicate line in the QBMM branch of the R3bar accumulation loop. This doubles the computed value of R3bar.

Before

if (qbmm) then
    do i = 1, nb
        R3bar = R3bar + weight(i)*0.5_wp*(q_prim_vf(...))**3._wp
        R3bar = R3bar + weight(i)*0.5_wp*(q_prim_vf(...))**3._wp   ! duplicate
    end do

After

if (qbmm) then
    do i = 1, nb
        R3bar = R3bar + weight(i)*0.5_wp*(q_prim_vf(...))**3._wp
    end do

Why this went undetected

QBMM is a specialized bubble dynamics feature. The doubled R3bar produces a systematically wrong (but not obviously broken) bubble volume fraction initialization.

Test plan

  • Run QBMM bubble test case
  • Verify R3bar matches expected bubble radius statistics

🤖 Generated with Claude Code

Fixes #1203

Copilot AI review requested due to automatic review settings February 21, 2026 03:23
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 21, 2026

Warning

Rate limit exceeded

@sbryngelson has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 28 minutes and 31 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codeant-ai
Copy link
Contributor

codeant-ai bot commented Feb 21, 2026

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai
Copy link
Contributor

codeant-ai bot commented Feb 21, 2026

CodeAnt AI finished reviewing your PR.

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

Removes a character-for-character duplicate accumulation statement that caused R3bar to be double-counted in QBMM bubble perturbation calculations.

Changes:

  • Delete the duplicated R3bar accumulation line inside the qbmm loop to prevent doubling the computed moment.

cubic-dev-ai[bot]

This comment was marked as off-topic.

…tion

Character-for-character identical duplicate line causes R3bar to
always be 2x the intended value for QBMM cases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Feb 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.05%. Comparing base (84c46e0) to head (febe506).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1183   +/-   ##
=======================================
  Coverage   44.05%   44.05%           
=======================================
  Files          70       70           
  Lines       20498    20497    -1     
  Branches     1990     1991    +1     
=======================================
  Hits         9030     9030           
+ Misses      10329    10328    -1     
  Partials     1139     1139           

☔ 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.

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.

Bubble k_v and k_g module-level variables not initialized

1 participant