Summary
The current penalty-based free-slip boundary condition path looks too fragile for spherical shell models and would benefit from alternative implementations.
In annulus benchmarks, the penalty method remains stable even for very large velocity penalties, although it can become very expensive. In spherical benchmarks, the same approach appears much more sensitive: free-slip runs can become unstable / memory-heavy at moderate resolution, and the solution quality is strongly penalty-dependent.
This suggests a scalability and/or formulation issue that is much more pronounced in spherical geometries than in annulus geometries.
Reproduction
Benchmark script:
Example spherical free-slip run that became problematic:
mpirun -np 8 python ex_stokes_kramer.py -uw_cellsize 1/16 -uw_case case2 -uw_vel_penalty 1e2
At coarser resolution (1/8), the same spherical free-slip case shows strong penalty sensitivity:
vel_penalty=1e2: solves quickly, but accuracy degrades (v_l2 ~ 2.88e-1, p_l2 ~ 3.83e-2)
vel_penalty=1e4: much better accuracy (v_l2 ~ 5.15e-2, p_l2 ~ 1.69e-2)
vel_penalty=1e7: run became impractically slow / stalled
So for spherical shells, the penalty is doing double duty:
- too small: free-slip is under-enforced and errors increase
- too large: conditioning and runtime become problematic
Why this seems geometry-specific
In the annulus Kramer benchmarks, the penalty approach is much more robust. Even with a very large penalty (2.5e8), the free-slip run remains stable, although it is substantially more expensive than the no-slip run.
From the annulus timing comparison at the same resolution / MPI size:
- free-slip:
case2_inv_lc_32_..._bc_paper
- no-slip:
case4_inv_lc_32_..._bc_paper
Key PETSc timings:
SNES_Stokes_SaddlePt.solve: 3.3674e+02 s (free-slip) vs 7.1149e+00 s (no-slip)
MatMult: 3.2254e+02 s vs 1.6257e+00 s
PCApply: 1.9113e+02 s vs 1.0640e+00 s
PCSetUpOnBlocks: 1.3967e+02 s vs 7.3120e-01 s
KSPSolve_FS_Schu: 1.6947e+02 s vs 9.5761e-01 s
VecScatterEnd: 1.1411e+02 s vs 5.9967e-01 s
So the annulus penalty method is already expensive, but still usable/stable. In spherical models, the same general approach appears much less robust.
Request
It would be useful to add alternative free-slip boundary condition implementations to Underworld, especially for curved shell geometries.
Possible directions:
- strong enforcement in a local normal/tangential basis (equivalently: enforce zero normal velocity strongly while leaving tangential components free)
- Lagrange multiplier approaches for the normal constraint
- Nitsche-type slip enforcement or other weak methods that are less penalty-sensitive than a pure penalty term
Comparison with the benchmark paper
The original Kramer benchmark paper does not describe a pure penalty free-slip treatment for the Fluidity reference implementation.
Instead, it states that:
- strong Dirichlet boundary conditions are used
- for free-slip, the boundary velocity basis is locally rotated into normal/tangential components
- the normal component is constrained to zero strongly
- tangential components remain free
- rigid-body rotation modes are then projected out before computing errors
That is a materially different approach from the current penalty-based workaround, and it seems worth considering a UW implementation that is closer to that benchmark treatment for shell geometries.
Why this matters
This is relevant beyond the benchmark itself. If penalty-based free-slip is highly geometry- and penalty-sensitive in spherical shells, that can affect larger-scale spherical applications where free-slip is a natural boundary choice.
A more robust shell free-slip implementation would likely improve:
- reproducibility across resolutions
- solver conditioning / runtime
- pressure and velocity convergence behavior in curved geometries
Summary
The current penalty-based free-slip boundary condition path looks too fragile for spherical shell models and would benefit from alternative implementations.
In annulus benchmarks, the penalty method remains stable even for very large velocity penalties, although it can become very expensive. In spherical benchmarks, the same approach appears much more sensitive: free-slip runs can become unstable / memory-heavy at moderate resolution, and the solution quality is strongly penalty-dependent.
This suggests a scalability and/or formulation issue that is much more pronounced in spherical geometries than in annulus geometries.
Reproduction
Benchmark script:
Example spherical free-slip run that became problematic:
At coarser resolution (
1/8), the same spherical free-slip case shows strong penalty sensitivity:vel_penalty=1e2: solves quickly, but accuracy degrades (v_l2 ~ 2.88e-1,p_l2 ~ 3.83e-2)vel_penalty=1e4: much better accuracy (v_l2 ~ 5.15e-2,p_l2 ~ 1.69e-2)vel_penalty=1e7: run became impractically slow / stalledSo for spherical shells, the penalty is doing double duty:
Why this seems geometry-specific
In the annulus Kramer benchmarks, the penalty approach is much more robust. Even with a very large penalty (
2.5e8), the free-slip run remains stable, although it is substantially more expensive than the no-slip run.From the annulus timing comparison at the same resolution / MPI size:
case2_inv_lc_32_..._bc_papercase4_inv_lc_32_..._bc_paperKey PETSc timings:
SNES_Stokes_SaddlePt.solve:3.3674e+02 s(free-slip) vs7.1149e+00 s(no-slip)MatMult:3.2254e+02 svs1.6257e+00 sPCApply:1.9113e+02 svs1.0640e+00 sPCSetUpOnBlocks:1.3967e+02 svs7.3120e-01 sKSPSolve_FS_Schu:1.6947e+02 svs9.5761e-01 sVecScatterEnd:1.1411e+02 svs5.9967e-01 sSo the annulus penalty method is already expensive, but still usable/stable. In spherical models, the same general approach appears much less robust.
Request
It would be useful to add alternative free-slip boundary condition implementations to Underworld, especially for curved shell geometries.
Possible directions:
Comparison with the benchmark paper
The original Kramer benchmark paper does not describe a pure penalty free-slip treatment for the Fluidity reference implementation.
Instead, it states that:
That is a materially different approach from the current penalty-based workaround, and it seems worth considering a UW implementation that is closer to that benchmark treatment for shell geometries.
Why this matters
This is relevant beyond the benchmark itself. If penalty-based free-slip is highly geometry- and penalty-sensitive in spherical shells, that can affect larger-scale spherical applications where free-slip is a natural boundary choice.
A more robust shell free-slip implementation would likely improve: