Skip to content

Fix periodic neighbor counts, intersecting stencils and coarse flags - #2964

Draft
rois1995 wants to merge 7 commits into
su2code:developfrom
rois1995:fix_periodic_counts
Draft

rois1995 wants to merge 7 commits into
su2code:developfrom
rois1995:fix_periodic_counts

Conversation

@rois1995

@rois1995 rois1995 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Proposed Changes

Periodic geometry was counted twice with weak heat, halo neighbor counts were stale, and intersecting or one-cell periodic directions lost stencil contributions. This PR corrects the volume/count bookkeeping and completes the affected sensors, Laplacians and least-squares stencils.

The geometry bookkeeping prevents the weak heat solver from adding periodic geometry twice, refresh halo neighbor counts and correct the MSW pressure sensor. Stencil communication completes counts, sensors, Laplacians and least-squares stencils at intersecting periodic pairs using shared-face weights. It also inherits boundary flags on coarse nodes and preserves opposite-face neighbors in a one-cell periodic direction.

Tests cover two/three translated pairs, diagonal edges, compressible/incompressible JST, MSW, primitive least squares, coarse flags and a one-cell BOX. The inc_periodic_weak_heat regression checks flow/heat consistency. The existing MPI sbs_backward_step reference change is explained in the testcase comment; further full-suite reference impact remains to be checked. General intersecting rotational pairs still need solution-level validation.

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 4 commits October 6, 2026 08:28
Both solvers accumulated the periodic volume and the number of neighbors
on the same geometry, the heat solver now does it only without a flow
solver.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UkNcoCEH8nFNrHWzhJCar
The periodic communication adds the neighbors of the periodic match to
the owned points only, the halo copies kept the old count, which is used
by the centered schemes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013UkNcoCEH8nFNrHWzhJCar
The division by the pressure was applied to the running maximum instead
of the pressure difference of each edge.

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

Files (configurations, histories, meshes, statistics, scripts) for each case: periodicBoundaries/counts. 2 MPI ranks, "develop" = 6db10127d1. The values of the new test are from my machine and will be updated from the CI.

1. Flow with the weakly coupled heat equation: periodic pin array with a body force (mesh of chtPinArray_2d). The heat equation should not change the flow here.

iterations to rms[P] = -16 largest change of the pressure when the heat equation is on
develop 359 without, 378 with 0.21 Pa (2 % of the range)
this PR 359 without, 359 with 0

heat

New test inc_periodic_weak_heat (10 iterations): rms[P] -4.965552 on develop, -4.712559 with this PR.

2. Neighbors of the halo points: the existing test sbs_backward_step (LD2, translational periodicity, 2 ranks): rms[P] and rms[W] are -6.352885 and -3.906544 with 1 rank (develop and this PR), -6.352884 and -3.906545 with 2 ranks on develop, and equal to the 1 rank values with this PR. This is the only reference value that changes.

The folder periodic2d_jst has a second check, run with this fix and the Jacobian fix of #2961 together: navierstokes/periodic2D with JST, converged with 1 and with 2 ranks. Largest difference of the momentum between the two runs: 2.2e-5 (2.4e-7 relative) on develop, 3.4e-9 with both fixes.

3. MSW sensor: only visible with triangles at the periodic boundary and a strong pressure jump there. mms/fvm_euler mesh with MSW, the pressure doubled at one neighbor of a periodic point, one iteration: rms[Rho] 0.094707 on develop, 0.064866 with this PR. No regression test: the field is artificial.

Existing tests

Unchanged history files, develop against this PR: poiseuille, bars_SST_2D, solid_periodic_pins, inc_heatTransfer_BC, sp_pinArray_cht_2d_dp_hf.

Additional tests (Oct 7)

Reproducers, configurations, numeric logs and scripts: stencils. 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
Two/three-pair stencils, diagonal edges, JST/MSW/INC JST 52/80 assertions fail; count 4 vs 6, sensor 0.00217549 vs 0.00578035, Laplacian 0.1875 vs 0.75 passes
Primitive LS stencils errors 0.75 / 1.5 passes
Coarse boundary flags 115/116 assertions fail passes
One-cell periodic direction count 5 vs 6, Rxx 1 vs 2 passes

neighbors

This extends the original tests above. General intersecting rotational pairs and full-suite solution/reference effects remain pending.

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.

Comment thread SU2_CFD/src/solvers/CSolver.cpp Fixed
Comment thread SU2_CFD/src/solvers/CSolver.cpp Fixed
Comment thread SU2_CFD/src/solvers/CSolver.cpp Fixed
Comment thread SU2_CFD/src/solvers/CSolver.cpp Fixed
Comment thread SU2_CFD/src/solvers/CSolver.cpp Fixed
Comment thread SU2_CFD/src/solvers/CSolver.cpp Fixed
Comment thread SU2_CFD/src/solvers/CSolver.cpp Fixed
Comment thread SU2_CFD/src/solvers/CSolver.cpp Fixed
Comment thread SU2_CFD/src/solvers/CSolver.cpp Fixed

This branch has not been deployed

No deployments
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.

2 participants