From d4407e430e56946ae3798f784f03aa64e1e7f7c9 Mon Sep 17 00:00:00 2001 From: ManasBagul23 Date: Thu, 17 Sep 2026 01:52:25 +0530 Subject: [PATCH 1/3] Implement the Barth-Jespersen limiter function 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. --- SU2_CFD/include/limiters/CLimiterDetails.hpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/SU2_CFD/include/limiters/CLimiterDetails.hpp b/SU2_CFD/include/limiters/CLimiterDetails.hpp index 2fe298261006..900b332a3d31 100644 --- a/SU2_CFD/include/limiters/CLimiterDetails.hpp +++ b/SU2_CFD/include/limiters/CLimiterDetails.hpp @@ -144,13 +144,13 @@ struct LimiterHelpers template<> struct CLimiterDetails { - su2double eps2; + su2double eps; /*! * \brief Set a small epsilon to avoid divisions by 0. */ template - inline void preprocess(Ts&...) {eps2 = LimiterHelpers<>::epsilon();} + inline void preprocess(Ts&...) {eps = LimiterHelpers<>::epsilon();} /*! * \brief No geometric modification for this kind of limiter. @@ -159,11 +159,13 @@ struct CLimiterDetails inline su2double geometricFactor(Ts&...) const {return 1.0;} /*! - * \brief Venkatakrishnan function with a numerical epsilon. + * \brief Barth-Jespersen function, min(1, delta/proj). + * \note proj and delta have the same sign, without a projection there is nothing to limit. */ inline su2double limiterFunction(size_t, su2double proj, su2double delta) const { - return LimiterHelpers<>::venkatFunction(proj, delta, eps2); + if (fabs(proj) <= eps) return 1.0; + return min(delta / proj, 1.0); } }; From 5f1ac9621721de015621341621cf497ea69d91c7 Mon Sep 17 00:00:00 2001 From: ManasBagul23 Date: Thu, 17 Sep 2026 12:39:52 +0530 Subject: [PATCH 2/3] Only skip Barth-Jespersen limiting for a zero projection A projection smaller than machine epsilon is still a projection that may need limiting, only proj == 0 has nothing to limit. --- SU2_CFD/include/limiters/CLimiterDetails.hpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/SU2_CFD/include/limiters/CLimiterDetails.hpp b/SU2_CFD/include/limiters/CLimiterDetails.hpp index 900b332a3d31..5d6e1ed42776 100644 --- a/SU2_CFD/include/limiters/CLimiterDetails.hpp +++ b/SU2_CFD/include/limiters/CLimiterDetails.hpp @@ -144,13 +144,11 @@ struct LimiterHelpers template<> struct CLimiterDetails { - su2double eps; - /*! - * \brief Set a small epsilon to avoid divisions by 0. + * \brief Nothing to precompute for this kind of limiter. */ template - inline void preprocess(Ts&...) {eps = LimiterHelpers<>::epsilon();} + inline void preprocess(Ts&...) {} /*! * \brief No geometric modification for this kind of limiter. @@ -164,7 +162,7 @@ struct CLimiterDetails */ inline su2double limiterFunction(size_t, su2double proj, su2double delta) const { - if (fabs(proj) <= eps) return 1.0; + if (proj == 0.0) return 1.0; return min(delta / proj, 1.0); } }; From 97b3a4b5eebec752fa7e4a171ae15332dfa3d01f Mon Sep 17 00:00:00 2001 From: ManasBagul23 Date: Fri, 18 Sep 2026 21:45:44 +0530 Subject: [PATCH 3/3] Remove the BARTH_JESPERSEN slope limiter 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. --- Common/include/option_structure.hpp | 2 -- Common/src/CConfig.cpp | 3 -- SU2_CFD/include/limiters/CLimiterDetails.hpp | 31 -------------------- SU2_CFD/include/limiters/computeLimiters.hpp | 5 ---- config_template.cfg | 2 +- 5 files changed, 1 insertion(+), 42 deletions(-) diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 03b00b23e3d8..1d20fe469049 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -1030,7 +1030,6 @@ enum class LIMITER { NISHIKAWA_R4 , /*!< \brief Slope limiter using Nishikawa's R4 method (stencil formulation). */ NISHIKAWA_R5 , /*!< \brief Slope limiter using Nishikawa's R5 method (stencil formulation). */ VENKATAKRISHNAN_WANG , /*!< \brief Slope limiter using Venkatakrisnan method, eps based on solution (stencil formulation). */ - BARTH_JESPERSEN , /*!< \brief Slope limiter using Barth-Jespersen method (stencil formulation). */ VAN_ALBADA_EDGE , /*!< \brief Slope limiter using Van Albada method (edge formulation). */ SHARP_EDGES , /*!< \brief Slope limiter using sharp edges. */ WALL_DISTANCE /*!< \brief Slope limiter using wall distance. */ @@ -1042,7 +1041,6 @@ static const MapType Limiter_Map = { MakePair("NISHIKAWA_R4", LIMITER::NISHIKAWA_R4) MakePair("NISHIKAWA_R5", LIMITER::NISHIKAWA_R5) MakePair("VENKATAKRISHNAN_WANG", LIMITER::VENKATAKRISHNAN_WANG) - MakePair("BARTH_JESPERSEN", LIMITER::BARTH_JESPERSEN) MakePair("VAN_ALBADA_EDGE", LIMITER::VAN_ALBADA_EDGE) MakePair("SHARP_EDGES", LIMITER::SHARP_EDGES) MakePair("WALL_DISTANCE", LIMITER::WALL_DISTANCE) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 503160942f79..dfc4dd2bdc53 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -7302,9 +7302,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { case LIMITER::VENKATAKRISHNAN_WANG: cout << "Venkatakrishnan-Wang slope-limiting method, with constant: " << Venkat_LimiterCoeff << "." << endl; break; - case LIMITER::BARTH_JESPERSEN: - cout << "Barth-Jespersen slope-limiting method." << endl; - break; case LIMITER::VAN_ALBADA_EDGE: cout << "Van Albada slope-limiting method implemented by edges." << endl; break; diff --git a/SU2_CFD/include/limiters/CLimiterDetails.hpp b/SU2_CFD/include/limiters/CLimiterDetails.hpp index 5d6e1ed42776..f10a2bf3d8a4 100644 --- a/SU2_CFD/include/limiters/CLimiterDetails.hpp +++ b/SU2_CFD/include/limiters/CLimiterDetails.hpp @@ -137,37 +137,6 @@ struct LimiterHelpers }; -/*! - * \brief Barth-Jespersen specialization. - * \ingroup FvmAlgos - */ -template<> -struct CLimiterDetails -{ - /*! - * \brief Nothing to precompute for this kind of limiter. - */ - template - inline void preprocess(Ts&...) {} - - /*! - * \brief No geometric modification for this kind of limiter. - */ - template - inline su2double geometricFactor(Ts&...) const {return 1.0;} - - /*! - * \brief Barth-Jespersen function, min(1, delta/proj). - * \note proj and delta have the same sign, without a projection there is nothing to limit. - */ - inline su2double limiterFunction(size_t, su2double proj, su2double delta) const - { - if (proj == 0.0) return 1.0; - return min(delta / proj, 1.0); - } -}; - - /*! * \brief Venkatakrishnan specialization. * \ingroup FvmAlgos diff --git a/SU2_CFD/include/limiters/computeLimiters.hpp b/SU2_CFD/include/limiters/computeLimiters.hpp index b7fe304a4f5f..28381506e830 100644 --- a/SU2_CFD/include/limiters/computeLimiters.hpp +++ b/SU2_CFD/include/limiters/computeLimiters.hpp @@ -73,11 +73,6 @@ if (geometry.GetnDim() == 2) {\ END_SU2_OMP_FOR break; } - case LIMITER::BARTH_JESPERSEN: - { - INSTANTIATE(LIMITER::BARTH_JESPERSEN); - break; - } case LIMITER::VENKATAKRISHNAN: { INSTANTIATE(LIMITER::VENKATAKRISHNAN); diff --git a/config_template.cfg b/config_template.cfg index f2aa561f9619..33184e20ef36 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -1603,7 +1603,7 @@ KIND_MUSCL_RAMP= ITERATION % Values range from -1 (fully one-sided) to 1 (central difference). MUSCL_KAPPA_FLOW= 0.0 % -% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, BARTH_JESPERSEN, VAN_ALBADA_EDGE, +% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, VAN_ALBADA_EDGE, % NISHIKAWA_R3, NISHIKAWA_R4, NISHIKAWA_R5) SLOPE_LIMITER_FLOW= VENKATAKRISHNAN %