Skip to content

Remove the BARTH_JESPERSEN slope limiter - #2911

Closed
ManasBagul23 wants to merge 3 commits into
su2code:developfrom
ManasBagul23:fix-barth-jespersen-limiter
Closed

ManasBagul23 wants to merge 3 commits into
su2code:developfrom
ManasBagul23:fix-barth-jespersen-limiter

Conversation

@ManasBagul23

@ManasBagul23 ManasBagul23 commented Sep 16, 2026 •

Copy link
Copy Markdown

Proposed Changes

Removes the BARTH_JESPERSEN slope limiter, as suggested in the review. The option did not implement the Barth-Jespersen limiter (it used the Venkatakrishnan function with a machine-epsilon parameter), and a proper min(1, delta/proj) implementation converges poorly.

Removed:

  • LIMITER::BARTH_JESPERSEN and its entry in Limiter_Map (option_structure.hpp)
  • the CLimiterDetails<LIMITER::BARTH_JESPERSEN> specialization and its case in computeLimiters
  • the case in the CConfig limiter summary and the option in the config_template.cfg list

A configuration that still uses it now stops with:

SLOPE_LIMITER_FLOW: invalid option value BARTH_JESPERSEN.
Did you mean, NISHIKAWA_R3, NISHIKAWA_R4, NISHIKAWA_R5, NONE, SHARP_EDGES, VAN_ALBADA_EDGE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, WALL_DISTANCE?

No TestCases use BARTH_JESPERSEN. The residuals of TestCases/euler/naca0012/inv_NACA0012_Roe.cfg with VENKATAKRISHNAN are unchanged. The limiter documentation on the website (Slope-Limiters-and-Shock-Resolution.md and three tutorial configs) still mentions the option, I will update it once this is merged.

Related Work

Closes #1841, which proposed either implementing the limiter or removing the option.

PR Checklist

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • 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.

LIMITER::BARTH_JESPERSEN used the Venkatakrishnan function with a
machine-epsilon parameter, which is a smooth limiter and does not
enforce the Barth-Jespersen bound. Use min(1, delta/proj), with 1 when
the projection vanishes, so the reconstructed values do not exceed the
neighbor extrema.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The epsilon guard can incorrectly return 1 for genuinely limiting nonzero projections.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Implements the bounded Barth–Jespersen limiter.

Changes:

  • Replaces the Venkatakrishnan calculation with min(1, delta / proj).
  • Handles zero projections by returning 1.
File summaries
File Review
SU2_CFD/include/limiters/CLimiterDetails.hpp Critical: the epsilon guard can skip limiting for nonzero projections; use an exact-zero check.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

inline su2double limiterFunction(size_t, su2double proj, su2double delta) const
{
return LimiterHelpers<>::venkatFunction(proj, delta, eps2);
if (fabs(proj) <= eps) return 1.0;
A projection smaller than machine epsilon is still a projection that
may need limiting, only proj == 0 has nothing to limit.
@ManasBagul23

Copy link
Copy Markdown
Author

@pcarruscag could you have a look at this one when you have time? It implements the Barth-Jespersen limiter as discussed in #1841. All CI checks pass except label, since I cannot add labels myself; it would need changelog:fix.

@bigfooted

Copy link
Copy Markdown
Contributor

Hi @ManasBagul23 can you add a regression test for this?

@pcarruscag

Copy link
Copy Markdown
Member

Let's just remove this limiter, it's terrible, nothing converges well with it.

The option did not implement the Barth-Jespersen limiter (it used the
Venkatakrishnan function), and a proper implementation converges poorly.
Remove the option instead, as suggested in the review.
@ManasBagul23

Copy link
Copy Markdown
Author

@pcarruscag done, the PR now removes BARTH_JESPERSEN instead (enum, option map, limiter details, config summary and config_template). A config that still uses it stops with "invalid option value BARTH_JESPERSEN" and the list of valid limiters.

@bigfooted with the limiter removed there is no code path left to test, so I did not add a regression test. Thanks for adding the label.

@bigfooted bigfooted closed this Sep 18, 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.

4 participants