Skip to content

Add a fully coupled periodic implicit operator - #2967

Closed
rois1995 wants to merge 11 commits into
su2code:developfrom
rois1995:fix_periodic_implicit
Closed

rois1995 wants to merge 11 commits into
su2code:developfrom
rois1995:fix_periodic_implicit

Conversation

@rois1995

@rois1995 rois1995 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Proposed Changes

Closed at the author’s request: deferred experimental enhancement. No overall benefit has been established; the branch and benchmark evidence are retained for possible future investigation. The low-linear-budget convergence regression remains unresolved; the preconditioner experiment is unpublished and fails expanded mixed-precision solve checks. Full CFD/geometry adjoint, multigrid, ALE/GCL and regression validation are incomplete.

This PR proposes a fully coupled periodic implicit operator in place of the existing approximate linearization. The omitted neighboring Jacobian terms were a deliberate tradeoff to reduce communication and avoid extending the sparse matrix. A more complete operator is a numerical enhancement; disagreement with its dense reference alone does not establish a bug in that approximation. This PR is classified as changelog:feature, without priority.

Dependencies: #2961 and #2963. Their commits are included until those PRs merge; the focused diff is axis...implicit.

The proposed matrix product includes neighboring contributions from all periodic copies through the constrained operator P A P + I-P, where P averages periodic copies in a common frame. Forward/transpose products and linear-solve reverse callbacks use the same operator; residual averaging and time terms follow that representation. Unsupported CUDA and direct PaStiX solves are rejected rather than silently applying an incomplete operator.

An independent dense reference verifies the proposed operator through products, transpose dot identities and forward/reverse solves for translation, helical rotation and two/three pairs on genuinely partitioned grids. Actual reverse-AD callback sensitivities agree with finite differences. Controlled annular/axis implicit sector/full steps agree below 4e-11 relative.

An isolated comparison now measures the practical effect of this coupling while keeping the other periodic fixes identical. Both modes use identical input, CFL, linear tolerance and iteration cap, and stop at log10(rms[Rho]) <= -10:

Serial case Outer iterations, legacy → this PR Total linear iterations, legacy → this PR
45° annulus, CFL100, max50 linear iterations 2337 → 807 5063 → 19818
30° pipe with axis, CFL10, max20 linear iterations 1698 → 1062 6792 → 21240

The PR reduces outer iterations in these cases, but increases total linear work and is slower in the recorded runs. No general speedup is established. With the annulus restricted to four linear iterations per step, legacy converges while this PR stalls through 4000 outer iterations; the regression also occurs with two MPI ranks. Raising the linear iteration cap does not resolve that robustness concern.

Exact cases, histories, timings, convergence plot and reproduction instructions are published in evidence commit 2667a182cf. An unpublished projected-preconditioner experiment reduces linear work in some cases, but still stalls in the low-budget case and fails expanded mixed-precision solve checks. It is not included in this PR; the branch source is unchanged.

Unresolved validation: the low-linear-budget convergence regression and preconditioning assessment remain open. This changes the implicit periodic discretization and can change existing periodic regression references. Full CFD/geometry sensitivities, multigrid forcing, ALE/GCL and full regression/reference updates remain open. The callback check proves RHS sensitivity of the linear solve, not all flow/mesh derivatives. Enabled GPU/PaStiX builds also remain untested.

Validation of the combined periodic source passes serial, partitioned MPI2, OpenMP2 and MPI2×OpenMP2 (10 cases / 3175 serial assertions). Individual branch CI and complete regression/reference checks are pending. Test configurations, meshes, logs and before/after values are in the testcase comment. New regression references are local x86 values and need CI confirmation.

Related Work

PR Checklist

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (complete branch CI pending).
  • My contribution is commented and consistent with SU2 style.
  • I ran the repository pre-commit checks on the changed files.
  • I have added tests that demonstrate the contribution.
  • I have updated appropriate documentation, if necessary.

rois1995 and others added 10 commits October 6, 2026 08:27
…aries

The residual of the periodic match is added as Q*R, and the solution of the
match is Q*U, so the block added to the diagonal must be Q*J*Q^T. Only the
rows were rotated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UkNcoCEH8nFNrHWzhJCar
The coarse levels summed the momentum residuals, gradients and Jacobian
blocks of a rotational periodic pair without rotating them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UkNcoCEH8nFNrHWzhJCar
…stencil

The limiters of the velocity components were rotated like a vector when
taking the minimum over a periodic pair, and the min and max velocity
vectors were rotated instead of the velocity of each neighbour.
Now each side sends, in the frame of its match, the min/max of the
rotated velocities and of the rotated reconstruction increments, and
the limiter is computed once. Nothing changes without rotation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UkNcoCEH8nFNrHWzhJCar
A point on the rotation axis is its own periodic match. It was handled like
a pair of points: it received its own data rotated once in each direction,
and in implicit runs its residual and Jacobian were then removed, so its
solution never changed.
Now it receives the data of every other copy of its control volume (the
rotation applied 1 to N-1 times, N = 360 deg / angle), it keeps its
equations, and after an implicit update its solution is averaged over the
copies, which removes the velocity normal to the axis.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UkNcoCEH8nFNrHWzhJCar
The mesh of the new test periodic3d_axis is in the TestCases branch
fix_periodic_axis.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UkNcoCEH8nFNrHWzhJCar
@rois1995

rois1995 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Test cases

Reproducers, configurations, numeric logs and scripts: implicit. Develop = 6db10127d1; BOX fixtures generate their meshes. The original B–D evidence above was recorded before the expanded follow-ups.

Check develop fixed combined source
Independent dense constrained operator, 4 layouts 16/2924 assertions fail passes
Translation forward product / solve max error 2.4272 / 0.9857 passes
Translation transpose / reverse solve max error 1.51059 / 0.86296 passes
Helical product / solve / transpose / reverse 3.4644 / 1.40676 / 2.21873 / 4.07183 passes
Controlled implicit sector/full physical step, annulus and axis, extra translation pair dense operator defect establishes baseline; no baseline sector-flow result claimed all field-relative differences below 4e-11
Actual external reverse callback vs finite differences no baseline callback result claimed translation/helical, 4 assertions/rank, serial and partitioned MPI2

The dense reference is assembled independently from local blocks and global connectivity; MPI tests require owned points on both ranks. Products and transpose checks keep 1e-5 bounds. Float Krylov solution checks use sqrt(float epsilon), with requested residual 1e-7; double uses 1e-10 and 1e-5 solution bounds. An initially double-only float-solve criterion failed and is documented as a testcase precision issue, not hidden as a pass.

The controlled step uses physical dt 1e-4 and zero JST dissipation. Split-face nonlinear dissipation and local pseudo-time conventions can still produce different sector/full results in other setups. Full CFD/geometry AD, multigrid forcing, ALE/GCL, complete regression references and GPU/direct-solver builds remain open; this PR stays a draft.

Combined release checks: serial and OpenMP2 pass 10 cases / 3175 assertions; partitioned MPI2 and MPI2×OpenMP2 pass on both ranks (2334 / 2238 assertions). These are combined-source checks, not standalone builds of every branch. Complete branch CI and full regression/reference checks remain pending.

@rois1995 rois1995 changed the title Complete periodic implicit coupling and its reverse operator Add a fully coupled periodic implicit operator Oct 7, 2026
@rois1995 rois1995 closed this Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant