Skip to content

Finish rotated free-slip prescribed-normal datum: wire FreeSurface consistent solve, pyx API, parallel, nonlinear #403

Description

@lmoresi

Context

The rotated strong free-slip constraint now supports a prescribed non-zero wall-normal
datum u.n = ũ_n on the LINEAR solve path (commit 1a08d398 on
feature/free-surface-tangent): one rotated matrix, a switchable datum (0 = free-slip /
held, ũ_n = prescribed radial), differing only in the constraint RHS. Validated serial
in tests/test_1018_rotated_freeslip.py (datum-zero matches free-slip to round-off;
u.n = cos θ imposed to machine precision).

This lets the free-surface consistent solve drop its ill-conditioned penalty natural
BC (penalty=1e5·(n̂·v − ũ_n)·n̂) — the term that trips newtonls line search on an
otherwise linear solve — in favour of the strong rotated constraint.

Remaining work

  1. Wire the FreeSurface manager. In free_surface.py::_build_consistent, register
    rotated free-slip on the surface and set consistent._rotated_freeslip_datum = {surface: un_target.sym} (updated each step in _solve_consistent), removing the
    add_natural_bc penalty. Confirm the material-surface advection is unchanged /
    improved (no penalty leak).

  2. Clean pyx API. Let add_rotated_freeslip_bc(conds, boundary, normal=...) accept a
    non-zero conds (constant / sympy expr / field .sym) and store it, replacing the
    private solver._rotated_freeslip_datum route. Needs a Cython rebuild. Update
    _classify_walls (currently unpacks 2-tuples) if the stored form changes.

  3. Parallel np2/np4. The datum application (_set_rows_local, the xhat ownership
    loop, build_rotation per-node datum eval) is written ownership-safe but untested in
    parallel. Add an np2 case to the datum test.

  4. Nonlinear path. solve_rotated_freeslip_nonlinear currently raises on a datum.
    Extend it (the datum enters the constrained residual / initial-feasible guess) if a
    prescribed normal is ever needed with a nonlinear rheology.

  5. CBF σ_nn regression. datum=0 is bit-path-identical (so σ_nn recovery is safe), but
    add an explicit test that boundary_normal_traction is unchanged with the new code.

Origin

Found while building a fresh annulus free-surface convection driver and tracing why a
linear solve tripped newtonls (the penalty BC). See also #402 (composition transport
for temperature convection).

Underworld development team with AI support from Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions