Repository navigation
Conversation
After LIMITER_ITER the scalar flux kernel set its limiter type to NONE, so the turbulence and species reconstruction was no longer limited at all, while the flow solvers keep applying the last stored limiter. The scalar limiter is now frozen in the same way: CScalarSolver stops recomputing it and the kernel keeps applying it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
The scalar flux kernel already applies the edge limiter, but CScalarSolver still computed point limiters for it and stopped with "Unknown limiter type". The point limiter and its volume outputs are now skipped for VAN_ALBADA_EDGE, as in the flow solvers. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…structs GetReconstructionGradientRequired is true for the whole case as soon as the flow uses a separate reconstruction gradient, so e.g. SST with MUSCL_TURB= NO computed an unused least-squares gradient at every iteration. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…e flow does The velocity that convects the scalars was reconstructed without any limiter when the flow used VAN_ALBADA_EDGE. The edge limiter needs no stored values, so it is now applied as in the flow. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
The divergence correction of BOUNDED_SCALAR cancels the part of the upwind flux due to the discrete divergence of the mass flux, so it must use the coefficients of that flux: - SA is not conservative: its flux uses the volume flux mdot+/rho_i + mdot-/rho_j, while the correction used the mass flux, so the correction was rho times too large (e.g. ~1000 for water); - SST, transition and species are conservative: the residual was right, but the Jacobian with respect to rho*phi must be -mdot/rho_i, not -mdot. With rho = 1 nothing changes. With dimensional water (rho = 998.2) the bounded SA flat plate stalled and gave a CD 5% off, now it converges like the non-dimensional case. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…bounds The MUSCL reconstruction of the turbulence and species variables was not kept within the bounds that clip the solution (e.g. k, omega > 0). In regions where a variable is small and varies a lot, like the decaying omega of the far field on coarse cells, the face values became negative, omega was clipped to its floor and the eddy viscosity grew without limit. The SST NACA0012 at 10 deg with MUSCL_TURB and VENKATAKRISHNAN_WANG did not converge (CD 0.47 after 10000 iterations instead of 0.0158). A face value outside [lowerlimit, upperlimit] of its variable now falls back to the point value. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
SST NACA0012 from the converged restart, with MUSCL_TURB and VAN_ALBADA_EDGE for both the flow and the turbulence, and LIMITER_ITER = 3. It stops with "Unknown limiter type" on develop, and its values change if the limiter is switched off after LIMITER_ITER again or if the flow edge limiter is not applied to the velocity of the turbulence flux. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…nterfaces At a fluid interface the scalar flux of each donor is weighted by its interpolation weight, but the bounded scalar correction was added with weight 1 for every donor, so with several donors (e.g. KIND_INTERPOLATION= WEIGHTED_AVERAGE) it was counted about as many times as there are donors. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
Test casesFiles (configurations, histories, plot script) for each case: scalarMuscl. Meshes are from the TestCases repository. 2 MPI ranks, "develop" = 1. Values outside the allowed range:
2. Bounded scheme with density ≠ 1:
3. Limiter lost after
4. 5. Flow 6. Sliding interfaces: 7. Reconstruction gradient without MUSCL: case 4 with first-order turbulence and New regression test |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013UkNcoCEH8nFNrHWzhJCar
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013UkNcoCEH8nFNrHWzhJCar
|
can you check that the changed options are used in regression tests? I don't think we use van_albada_edge for instance for any species case or bounded scalar scheme with varying density? |
|
@bigfooted added the missing species |
…and limiters (#2961) ## Proposed Changes This is one of **seven related periodic-boundary bug-fix PRs**. | PR | Scope | |---|---| | #2961 (this PR) | Rotational Jacobian, multigrid velocity rotation and limiters | | #2963 | Axis points, slip-wall normals and moving donor volumes | | #2964 | Periodic volumes, neighbor counts, sensors, stencils and coarse flags | | #2965 | Streamwise periodicity, auxiliary gradients and flamelet metadata | | #2966 | Inverse affine transforms in the parser and FEM | | #2968 | Diagnostics for unsupported periodic solver combinations | | #2969 | Translated wall-distance images | The other bug-fix PRs are drafts with their remaining validation and implementation limits documented. Their grouping does not imply a linear merge order; #2963 depends on this PR. The fully coupled implicit operator proposed in #2967 is a separate experimental enhancement. It has been closed and deferred because no overall benefit has been established and convergence/validation issues remain. This PR retains the existing implicit approximation. Three fixes for rotational periodic boundaries, one commit each. The test cases are in the comment below. - **Implicit runs:** the Jacobian block that a periodic point gets from its match was rotated on one side only. It is now rotated on both sides. - **Multigrid:** the coarse levels did not rotate the velocity, so the run did not converge. The velocity is now rotated on all levels. - **Limiters:** the limiters of the velocity components were rotated like a vector, but they are separate numbers. On the periodic boundary one velocity component became first order, and limiters could be negative. Each side now sends the velocity bounds and reconstruction increments in the frame of the other side, so each limiter uses the complete stencil. Nothing changes for a translation. New tests `periodic2d_no_limiter` and `periodic2d_multigrid`; `periodic2d` is now also in the MPI regression. Their x86 reference values pass in CI. Existing reference values that change: `aachen_turbine_restart`, `jones_turbocharger_restart` and `multi_interface` (rotational periodic, the Jacobian block), and the hybrid `periodic2d` (the Jacobian block and the limiters). The x86 periodic tests and the other changed cases pass in CI; the Jones restart residual references were refreshed from the serial, MPI and hybrid CI logs. The aarch64 references still need the CI runs. No conflict with #2945 and #2959. #2956 also changes the reference values of `jones_turbocharger_restart`; whichever is merged second takes them from the CI. ## Related Work - #652 added the present implementation of the periodic boundaries. - #1563 fixed the rotation in 2D and added the `periodic2D` case used here. - #1467, #763 and #1585 discuss the incomplete linear system at periodic points; this PR keeps the existing approximation. ## 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. - [ ] I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary. --------- Co-authored-by: rois1995 <rauxa1995@hotmail.it> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Josh Kelly <81244680+joshkellyjak@users.noreply.github.com> Co-authored-by: Nijso <bigfootedrockmidget@hotmail.com>
|
@rois1995 if you can fix the issues in the regression tests then we can finalize this. |
|
@bigfooted There's still a problem with eigen that is outside the scope of this PR. |
that's probably the server being overloaded, it tries to get external packages but fails due to time-out:
|
|
@rois1995 can you check this:
lim = (Δ² + 1e-6 + p·Δ) / (p² + Δ² + 1e-6) lim = Δ(p + Δ) / (p² + Δ² + 1e-16) The fixed 1e-6 also sits in the numerator, so as Δ→0 the limiter goes to 1 instead of 0. At an extremum the slope is left unlimited. |
| * Both the scalar and the flow limiters are frozen after LIMITER_ITER by no longer | ||
| * recomputing them: the last stored values keep being applied. |
There was a problem hiding this comment.
For VAN_ALBADA_EDGE, it is recomputed on every edge and never frozen.
There was a problem hiding this comment.
Clarified in eef97f4: stored point limiters keep their last values after LIMITER_ITER; VAN_ALBADA_EDGE is recomputed on every edge and never frozen. The regression-script comment and config-template explanation now make the same distinction.
|
My Claude analysis found something: What's wrong now. BoundedScalarBCFlux always builds the mass flux from the interior density:   The fix, in CScalarSolver.hpp:  |
|
Gradient_Aux is the second gradient array a scalar solver keeps for MUSCL reconstruction. The PR stopped computing it when the scalar doesn't reconstruct, but each scalar variable still allocates it. The fix. Make the variable use the same condition that CommonPreprocessing now uses. In the constructor, the generic config->GetMUSCL() is not set yet (it's a per-solver global parameter set during the iteration), so each derived class passes its own flag: // CScalarVariable.hpp / .cpp CScalarVariable::CScalarVariable(..., const CConfig* config, bool muscl) |
|
@bigfooted addressed the October 14 findings in eef97f4:
Validation: 50 supported normal unit cases pass (75,383 assertions); the three new scalar tests pass on two MPI ranks and with two OpenMP threads (380 assertions per rank/run). All four focused MPI regressions pass. Formatting hooks pass. The local build disables MLPCpp, so its existing ANN fluid unit was excluded; CI will run the complete configured matrix. The separate epsilon improvement is now open as #2978, with the |
|
@bigfooted the remaining eight x86_64 V&V/adjoint failures were reproduced with the binaries from CI run 38595536164. The shared edge helper also serves SIMD flow reconstruction, so its van Albada correction changes those cases. Updated their references in 48e871b; all eight pass with those same CI binaries, without changing tolerances. New unit files also carry author attribution (a3968c9). The variable-relative scalar limiter epsilon follow-up is now #2978, labeled |
|
ok, so this one goes first after updating regressions, then #2978 |
The scalar review change replaced the VAN_ALBADA_EDGE form in the shared muscl helper, which also changed the SIMD flow reconstruction and stopped the 30P30N and DSMA661 V&V cases from converging. The flow form (delta^2 + 1e-6) is restored for the flow solver and for the flow velocity and density that the scalar convection reconstructs, so both see the same face values. Only the transported scalars use the van Albada function of the point limiters, selected with MusclLimiter::EDGE_SCALAR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the flow van Albada edge limiter restored, 30P30N, DSMA661, the flat plate, bump and SWBLI V&V cases and the axial stage adjoint return to the references they had before the scalar review change. The NACA0012 MUSCL edge test now uses the flow form for the flow and the point-limiter van Albada function for the turbulence variables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@bigfooted correction to my previous comment: the van Albada change in eef97f4 also changed the flow solver's |
Values from CI run 38717278593 for rae2822_sst (serial, hybrid), species2_primitiveVenturi_JST, species2_primitiveVenturi_Lax_Friedrich and species_active_transport_temp_limits (parallel). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One flow-limiter face cancels to zero in exact arithmetic, so its value is only rounding, which depends on the compiler. Use a margin far above that rounding and a tight relative tolerance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r2956_flow_vanalbada # Conflicts: # TestCases/hybrid_regression.py # TestCases/parallel_regression.py # TestCases/serial_regression.py # TestCases/tutorials.py # TestCases/vandv.py

Proposed Changes
Fixes for
MUSCL_TURB,MUSCL_SPECIESand the bounded scalar scheme. One commit per fix; the test cases follow in the comments.LIMITER_ITER: the turbulence and species were then reconstructed with no limiter at all. Now the last limiter values are kept, as in the flow.VAN_ALBADA_EDGEstopped the run for turbulence and species. It now works, as in the flow.VAN_ALBADA_EDGEwas ignored for the velocity that carries the turbulence. Now it is applied.MUSCL_TURB= NO(orMUSCL_SPECIES= NO), the turbulence and species still computed a separate reconstruction gradient when the flow used one. Now only when they reconstruct.New test
turb_naca0012_sst_muscl_edge. Reference values ofrae2822_sa,rae2822_sst, the venturi and flamelet species tests andbars_SST_2Dwill be updated from the CI.Related Work
PR Checklist
pre-commit run --allto format old commits.🤖 Generated with Claude Code