refactor: simplify hypoelastic source terms in m_hypoelastic.fpp#1399
refactor: simplify hypoelastic source terms in m_hypoelastic.fpp#1399sbryngelson wants to merge 1 commit intoMFlowCode:masterfrom
Conversation
…s and drop zero-sum terms
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one. |
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
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. Comment |
Automated Code ReviewSummary: No issues found. ✅ Performed term-by-term algebraic verification of every simplification in the
All simplifications are algebraically exact. Precision conventions respected throughout ( |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1399 +/- ##
=======================================
Coverage 64.75% 64.75%
=======================================
Files 71 71
Lines 18721 18721
Branches 1551 1551
=======================================
Hits 12123 12123
Misses 5640 5640
Partials 958 958 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Addresses #1343 (readability only — no correctness change).
The source term formula is$S^e_{ij} = \rho(l_{ik}\tau_{kj} + \tau_{ik}l^T_{kj} - \tau_{ij},\mathrm{tr}(\mathbf{D}) + 2G,D^d_{ij})$ . Because $\mathbf{l}\tau + \tau\mathbf{l}^T$ is symmetric and doubles the off-diagonal contributions, the old code wrote e.g. $\mathbf{l}\tau + \tau\mathbf{l}^T$ before simplifying.
τ_12*du_dy + τ_12*du_dyas two separate lines. The zero-sum pairs (e.g.+ τ_12*du_dx - τ_12*du_dxin the τ_12 update) are algebraic cancellations from expandingThis PR collapses each duplicate pair to
2._wp * τ * dvand removes the zero-sum pairs, making the code match the formula directly. The change is purely cosmetic: no numerical values change.Changes
src/simulation/m_hypoelastic.fpp,idir == 2andidir == 3blocks:x + x→2._wp*xfor the doubled off-diagonal rotation terms+a - azero-sum pairs in the τ_12, τ_13, τ_23 shear updates2._wp*G*(1._wp/2._wp)*...→G*...and2._wp*G*(1._wp/3._wp)*...→(2._wp/3._wp)*G*...Net: 36 lines → 19 lines (−17 lines).
Test plan