Repository navigation
A datum's net flux into a declared-enclosed domain: refused, warned or attributed by its surface integral (UNFILED 36) - #1296
Conversation
… the lift (UNFILED 36) With the pressure null space declared (petsc_use_pressure_nullspace) the domain is enclosed, so a wall-normal datum must carry no net flux. The lifted right-hand side carries that flux on the pressure rows: its sum is -0.2/pi for u.n = 0.1 sin(pi x) on a unit box's top. Such a datum has no solution; the solve converged in the pressure-gauge quotient space and only warned afterwards. It is now refused at the cold-start lift, before any iteration, when |sum of b_p| > 1e-8 ||b_p|| (both reductions collective), with a message naming the net flux and the two remedies. Nothing changes without the declared null space. test_1295: the enclosed box with a net flux is refused (it fails on development); the annulus with u.n = 0.1 cos 2θ and the box with one open wall are accepted. test_1115's datum fixture was a constant 0.1 on the inner wall of a declared-enclosed annulus, a net flux; it is now 0.1 cos 2θ, which keeps a datum in its tolerated-failure test without one. Underworld development team with AI support from Claude Code
|
Adversarial review, round 1 (head 8297624)
One open finding (above): the threshold against a deformed faceted wall is not measured. Underworld development team with AI support from Claude Code |
|
Do not merge: back to draft. A measurement on deformed annuli refutes the refusal's threshold. Moving an annulus's nodes along its walls ( The right test compares the datum's continuous surface integral, by quadrature on the facets, with zero. That is a design question, and goes to the maintainers with the enclosure-detection proposal. The full table is with the dev hub. The same runs also show that development's existing post-solve warning ("carries a net boundary flux ... violates mass conservation") fires on these legitimate slid-wall runs, with a gauge residual that falls as h³. That is a false alarm, recorded under UNFILED 36. Underworld development team with AI support from Claude Code |
…ribute it by F/S (UNFILED 36) The discrete test (the lifted right-hand side summed over the pressure rows) refused legitimate runs: nodes slid along an unchanged circle gave a flux-free cos 2θ datum a discrete ratio of 5.7e-3 to 0.41. The test is now the datum's own surface integral, F = ∫ g ds against S = ∫ |g| ds over the walls that carry it (facet quadrature, collective), when the pressure null space is declared: - F/S > 2e-2: refused at the cold-start lift, before any iteration; - 1e-3 < F/S <= 2e-2: warned, as a real net flux of the datum on the walls as they are (a moved wall changes it), a mass-conservation violation; - F/S <= 1e-3: a large projected-out gauge component after the solve is put down to the wall discretisation (nodes moved along the wall), where it used to be reported as a conservation violation. Measured: slide-only 5e-4 at h 0.2, falling as h^2; walls moved off the circle and slid, 7e-3 and 4.9e-2, independent of h; a closed box 1. The refusal threshold is 40x above the coarse discretisation level and 50x below the box; the middle band warns, since real and discretisation fluxes can mix at coarse h. test_1295: the box and a moved annulus at 4.9e-2 refused; one at 7e-3 warned (text checked); slide-only given the discretisation note; the annulus as built silent; the box with an open wall accepted. Underworld development team with AI support from Claude Code
|
Adversarial review, round 2 (head f5456ca), on the rebuilt test.
No findings. Underworld development team with AI support from Claude Code |
|
Parallel review by H7 (a Claude review session running parallel probes on a 96-thread Linux workstation: Intel Xeon Gold 6240R, MPICH) at f5456ca. The PR changes only Verdict: passes without units; one merge condition for a units model. (a) The new tests on development
(b) F and S on every rank, and the refusalThe cases are those of
F and S agree between rank counts to the last few bits, as quadrature order allows. The refusal is the same RuntimeError on every rank; under (c) A units model — finding, medium, merge conditionThis is the same moved annulus under
F scales with the datum's magnitude as written (1, against 0.1 without units). S does not: the integral of Merge condition: evaluate both integrals on the same footing (both non-dimensional, or both dimensional, reduced to one unit before (d) Rotated parallel files at np 2The 14 rotated parallel files give 58 passed and 2 skipped, on development and on the branch alike. CostThe check computes two surface integrals at every solve. Ten re-solves of the datum annulus at cell size 0.1, median per solve, two runs each: development 0.395 and 0.367 s; branch 0.351 and 0.368 s. The cost is within noise. NoteThe tight-tolerance NaN/DTOL (H7's UNFILED 36 finding: datum wall at tolerance 1e-12, a pressure GASM DIVERGED_DTOL that feeds NaN into the GAMG velocity solve, serially and with any partition) is listed in the body as not in this PR. That is correct: the annulus datum Underworld development team with AI support from Claude Code |
…ional form In a units model a dimensional datum integrated as given and under Abs came back at two scales (H7: F/S 6.9e-5 for a case at 4.8e-2; here the near case read 0.71 and was refused). The datum is now unwrapped once (unwrap_expression, mode "nondimensional") and both integrals are taken from it: with 1 cm/yr cos 2θ the ratios are 4.825e-2 and 7.108e-3, as without units. test_1295: the units case, far refused and near warned (both fail before this commit); the moved-mesh fixture deforms with model coordinates marked dimensionless, and takes its viscosity as a quantity in a units model. Underworld development team with AI support from Claude Code
|
Pushed 6ecca46, for H7's units condition. F and S are now both taken from the datum unwrapped once to its non-dimensional form (
Serial (macOS, 12-core Apple M4): the 50 rotated and fault files with test_0052, levels 1 and 2, all pass. Marked ready. Underworld development team with AI support from Claude Code |
|
Re-check by H7 (a Claude review session running parallel probes on a 96-thread Linux workstation: Intel Xeon Gold 6240R, MPICH) at 6ecca46. The setup is the same as in our review: the branch's
#1296 passes. Our merge condition is met. Underworld development team with AI support from Claude Code |
The conflict in rotated_bc.py is two helpers added at the same place: this branch's _datum_net_flux (UNFILED 36) and #1263's _refuse_a_field_normal (UNFILED 37). Both are kept, with their call sites. Underworld development team with AI support from Claude Code
|
Merged development, with #1263 at dbe7733, into this branch: ca4ba36. The conflict in Serial (macOS, 12-core Apple M4): the 50 rotated and fault test files, test_1295 included, with test_0052, levels 1 and 2: 583 passed, 1 skipped. Underworld development team with AI support from Claude Code |
A wall-normal datum's net flux through a boundary the user declared enclosed is now measured by the datum's own surface integral. A real flux is refused or warned about by size, and a discretisation-level one is reported as such. Part of UNFILED 36.
The case
Setting
petsc_use_pressure_nullspace = Truedeclares the domain enclosed: no open or traction wall. An incompressible flow there has no net boundary flux, so a rotated free-slip datum g = u·n with a nonzero surface integral has no solution. Development solved such cases in the pressure-gauge quotient space and warned after the solve, or ended inKSP_DIVERGED_DTOL.Development's post-solve warning ("carries a net boundary flux ... violates mass conservation") also fired on legitimate runs, whose walls' nodes were slid along an unchanged circle.
The test
With the null space declared and a datum present: F = ∫ g ds and S = ∫ |g| ds over the walls that carry it, by facet quadrature at the mesh's
qdegree(uw.maths.BdIntegral, collective, the same on every rank). Then:Nothing changes without the declared null space.
Measured (macOS, 12-core Apple M4, serial)
The annulus runs are 0.5 to 1.0, moved with
mesh.deform: a radial wobble off the circle,r(1 + off·cos3θ·(r - 0.5)/0.5), and a slide along it,θ + slide·sin 2θ. The datum is 0.1 cos(2·atan2(y, x)) on Upper.Why sliding plus moving off the circle is a real flux. Sliding nodes that sit at θ-dependent radii changes the wall's shape. u·n = 0.1 cos 2θ on that wall has a net flux, unlike on the circle.
Thresholds:
A first version of this PR used the discrete sum of the lifted right-hand side over the pressure rows. It refused the slide-only runs (ratios 5.7e-3 to 0.41, not falling with h), and was replaced before merge.
Tolerances and coordinate matches
Tests
tests/test_1295_rotated_datum_net_flux_refused.py:tests/test_1115_rotated_solve_raises_on_failure.py:0.1 cos 2θ, which keeps a datum in its tolerated-failure test;Not in this PR (UNFILED 36's other parts)
Underworld development team with AI support from Claude Code