Repository navigation
Conversation
Describe the MARKER_PERIODIC syntax with a wedge example, and how the implicit solver couples passive periodic points to their masters (su2code/SU2#3016). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 tasks done
bigfooted
added a commit
to su2code/SU2
that referenced
this pull request
Nov 29, 2026
#3016) ## Proposed Changes With implicit periodicity, the passive rows (first marker of each pair) are deleted and only their diagonal block is added to the master, so all off-diagonal couplings of periodic points are lost. On a wedge one cell thick every point is periodic and the Newton step becomes useless above CFL ~25. - `CSolver::CouplePeriodicJacobian` moves the off-diagonal blocks of passive rows and columns to their masters (rotated) before the periodic comms. The table of coupled points is built once, on the first call; the moved blocks are passive, except in forward AD where the Jacobian itself is active. - Coupling is all-or-nothing per point: a passive point is coupled only if its master is on the same rank, both lie on a single periodic marker, and every moved block exists in the sparsity pattern. On meshes that are one cell thick in the periodic direction (wedges) this holds for almost all periodic points; on thicker meshes no point qualifies and the treatment is unchanged from develop. Moving only the blocks that happen to fit (partial coupling) slowed down the primal and the discrete adjoint on thick meshes. - Works with the quantized Q_LU_SGS storage (blocks are decoded, added and re-encoded, since accumulating `SetBlock` is a no-op there). - With implicit periodicity, the edge between a point and its own periodic image on the same rank is left out of the local time step (it made dt ~60x too small on the axis of a wedge). - The periodic part of the dual volume is communicated again when the mesh coordinates are recorded (`CSolver::CommunicatePeriodicVolume`), so the discrete adjoint includes its derivative. Without it the adjoint gradient on the Morse case had the wrong sign (+22.6 vs -2.14 by finite differences). - The passive face of a periodic pair now shows the (rotated) residual of its master in the volume output; the solution is unchanged. - Comments in `CompletePeriodicComms` corrected: the second marker of each pair is the master. - New case `TestCases/incomp_rans/morse_swirl_jet` (Morse 1980 swirling jet, 5 deg one-cell wedge, SA), primal regression test `inc_turb_morse_swirl_jet` (10 iterations from a converged solution) and discrete-adjoint test `discadj_incomp_turb_morse_swirl_jet` (10 adjoint iterations, every point periodic, so the coupled Jacobian is in the adjoint linear solve). ## Results Morse swirling jet from uniform flow, 4 ranks, develop c7dffa3 vs this PR, SA and SST (SST with the same inlet velocities, k from the measured normal stresses and omega = k / nu_t). With the coupling both models reach rms[P] = -10 in about 400 iterations; develop stalls near -7.  | | iterations | final rms[P] | |---|---|---| | SA, develop | 1000 (limit) | -6.90 | | SA, this PR | 404 | -10.03 | | SST, develop | 2000 (limit) | -7.15 | | SST, this PR | 412 | -10.00 | An iteration of this PR costs more (about 47 linear iterations instead of 5 on develop), since the linear system now carries the periodic couplings. Converged solutions against the measurements of Morse (1980): centreline velocity, maximum swirl velocity and half-width. Both models under-predict the extra mixing caused by the swirl up to x/D = 6; SST also decays too slowly further downstream.  | x/D | 1 | 2 | 4 | 6 | 10 | 15 | |---|---|---|---|---|---|---| | U_cl error, SA [%] | -1.9 | +6.8 | +39.5 | +41.2 | +19.3 | +1.3 | | U_cl error, SST [%] | -1.5 | +6.8 | +40.8 | +51.0 | +39.4 | +30.7 | | r_1/2 error, SA [%] | -0.5 | -12.9 | -30.9 | -31.1 | -21.7 | | | r_1/2 error, SST [%] | -0.4 | -11.9 | -30.0 | -33.6 | -30.7 | | Discrete adjoint on the same case (objective: inlet static pressure, design variable: amplitude of a smooth axisymmetric mesh deformation): -2.02 vs -2.14 by central finite differences. ## Regression values - New: `inc_turb_morse_swirl_jet`, `discadj_incomp_turb_morse_swirl_jet`. - Changed, points coupled: `sp_pipeSlice_3d_dp_hf_tp`, `sp_pipeSlice_3d_dp_ihf_tp` (one-cell periodic slices) and `periodic3d_axis` (30 deg one-cell wedge, new in develop). `periodic3d_axis` now converges in 1170 instead of 1900 iterations to the same solution, so its values at iteration 100 change. - `transonic_stator` (serial discrete adjoint) changes at the 1e-5 level on CI only. No point is coupled in this case, and local builds of develop and of this branch give bit-identical results for it. The parallel discrete-adjoint values are those of develop. - All other periodic cases (turbomachinery, CHT, periodic channels, ...) couple no points and keep their develop values, including hybrid, AD and aarch64. ## Related Work - Mesh and converged solution: su2code/TestCases#215 (merged); inlet profile script: su2code/TestCases#216 (merged). - #3014 (wall distance without viscous walls) is merged; the Morse values include it. - Documentation of `MARKER_PERIODIC` and the implicit treatment: su2code/su2code.github.io#234. ## PR Checklist - [X] I am submitting my contribution to the develop branch. - [X] My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson). - [X] My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/). - [X] I used the pre-commit hook to prevent dirty commits and used `pre-commit run --all` to format old commits. - [X] I have added a test case that demonstrates my contribution, if necessary. - [X] I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the
MARKER_PERIODICsyntax to the periodic boundary section of Markers and Boundary Conditions, with a 5 degree wedge example, and a paragraph on implicit time integration:Companion to su2code/SU2#3016.
🤖 Generated with Claude Code