Skip to content

fix(darcy): correct sign conventions for Darcy flux and velocity#243

Open
jcgraciosa wants to merge 2 commits into
underworldcode:developmentfrom
jcgraciosa:fix/darcy-sign-convention
Open

fix(darcy): correct sign conventions for Darcy flux and velocity#243
jcgraciosa wants to merge 2 commits into
underworldcode:developmentfrom
jcgraciosa:fix/darcy-sign-convention

Conversation

@jcgraciosa

Copy link
Copy Markdown
Contributor

Summary

Fixes sign-convention inconsistencies in the Darcy and Poisson solvers.
Changes are in solvers.py and constitutive_models.py:

  1. SNES_Poisson docstrings — restored missing minus sign: -∇·[κ∇u] = f
  2. v_Field — removed double negation; now correctly stores the physical
    Darcy velocity q = -κ(∇h - s) (inflow positive)
  3. DarcyFlowModel.flux — now returns physical velocity q = -κ(∇h - s);
    permeability should be set as a positive value (matching literature convention)
  4. F1 Template — uses darcy_flux = q consistent with uw3's natural BC
    convention, where add_natural_bc(g, boundary) specifies inward Darcy flux
  5. TransientDarcy DFDt — negated to compensate for Fix 3, restoring the
    same net K(∇h−s) that DFDt tracked before any fixes

Validated against the Henry (1964) saltwater intrusion benchmark and the
Badon-Ghijben–Herzberg freshwater lens benchmark — both produce physically
correct results with the correct freshwater inflow direction and wedge geometry.

Tests

  • test_1004_DarcyCartesian
  • test_1005_TransientDarcyCartesian
  • test_0820_template_parameter_propagation

Follow-up

The natural BC sign convention for SNES_TransientDarcy (when f ≠ 0 or
when natural BCs are used on transient problems) will be addressed in a
separate PR.

Closes #214


Underworld development team with AI support from Claude Code

@jcgraciosa jcgraciosa requested a review from lmoresi as a code owner June 16, 2026 03:09
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