@@ -87,6 +87,36 @@ struct LimiterHelpers
8787 Type factor = 0.5 *(1.0 +dist+sin (PI_NUMBER*dist)/PI_NUMBER);
8888 return max (0.0 , min (factor, 1.0 ));
8989 }
90+
91+ FORCEINLINE static Type r3Function (const Type& proj, const Type& delta, const Type& epsp)
92+ {
93+ Type Dp = fabs (delta);
94+ Type Dm = fabs (proj);
95+ if (Dp>(2.0 *Dm)) return 1.0 ;
96+ Type y = pow (Dp, 3 ) + epsp;
97+ Type S3 = 4.0 *Dm*Dm;
98+ return (y + Dp*S3) / (y + Dm*(delta*delta+S3));
99+ }
100+
101+ FORCEINLINE static Type r4Function (const Type& proj, const Type& delta, const Type& epsp)
102+ {
103+ Type Dp = fabs (delta);
104+ Type Dm = fabs (proj);
105+ if (Dp>(2.0 *Dm)) return 1.0 ;
106+ Type y = pow (Dp, 4 ) + epsp;
107+ Type S4 = 2.0 *Dm*(Dp*Dp-2.0 *Dm*(Dp-2.0 *Dm));
108+ return (y + Dp*S4) / (y + Dm*(pow (delta,3 )+S4));
109+ }
110+
111+ FORCEINLINE static Type r5Function (const Type& proj, const Type& delta, const Type& epsp)
112+ {
113+ Type Dp = fabs (delta);
114+ Type Dm = fabs (proj);
115+ if (Dp>(2.0 *Dm)) return 1.0 ;
116+ Type y = pow (Dp, 5 ) + epsp;
117+ Type S5 = 8.0 *Dm*Dm*(Dp*Dp-2.0 *Dm*(Dp-Dm));
118+ return (y + Dp*S5) / (y + Dm*(pow (delta,4 )+S5));
119+ }
90120};
91121
92122
@@ -159,6 +189,119 @@ struct CLimiterDetails<LIMITER::VENKATAKRISHNAN>
159189};
160190
161191
192+ /* !
193+ * \brief Nishikawa's R3 limiter specialization.
194+ * \ingroup FvmAlgos
195+ */
196+ template <>
197+ struct CLimiterDetails <LIMITER::NISHIKAWA_R3>
198+ {
199+ su2double epsp;
200+
201+ /* !
202+ * \brief Store the reference lenght based eps^3 parameter,
203+ * limited to a small number to avoid divisions by 0.
204+ */
205+ template <class ... Ts>
206+ inline void preprocess (CGeometry&, const CConfig& config, Ts&...)
207+ {
208+ su2double L = config.GetRefElemLength ();
209+ su2double K = config.GetVenkat_LimiterCoeff ();
210+ su2double eps1 = fabs (L*K);
211+ epsp = max (pow (eps1, 4 ), LimiterHelpers<>::epsilon ());
212+ }
213+
214+ /* !
215+ * \brief No geometric modification for this kind of limiter.
216+ */
217+ template <class ... Ts>
218+ inline su2double geometricFactor (Ts&...) const {return 1.0 ;}
219+
220+ /* !
221+ * \brief Smooth function that disables limiting in smooth regions.
222+ */
223+ inline su2double limiterFunction (size_t , su2double proj, su2double delta) const
224+ {
225+ return LimiterHelpers<>::r3Function (proj, delta, epsp);
226+ }
227+ };
228+
229+
230+ /* !
231+ * \brief Nishikawa's R4 limiter specialization.
232+ * \ingroup FvmAlgos
233+ */
234+ template <>
235+ struct CLimiterDetails <LIMITER::NISHIKAWA_R4>
236+ {
237+ su2double epsp;
238+
239+ /* !
240+ * \brief Store the reference lenght based eps^4 parameter,
241+ * limited to a small number to avoid divisions by 0.
242+ */
243+ template <class ... Ts>
244+ inline void preprocess (CGeometry&, const CConfig& config, Ts&...)
245+ {
246+ su2double L = config.GetRefElemLength ();
247+ su2double K = config.GetVenkat_LimiterCoeff ();
248+ su2double eps1 = fabs (L*K);
249+ epsp = max (pow (eps1, 5 ), LimiterHelpers<>::epsilon ());
250+ }
251+
252+ /* !
253+ * \brief No geometric modification for this kind of limiter.
254+ */
255+ template <class ... Ts>
256+ inline su2double geometricFactor (Ts&...) const {return 1.0 ;}
257+
258+ /* !
259+ * \brief Smooth function that disables limiting in smooth regions.
260+ */
261+ inline su2double limiterFunction (size_t , su2double proj, su2double delta) const
262+ {
263+ return LimiterHelpers<>::r4Function (proj, delta, epsp);
264+ }
265+ };
266+
267+
268+ /* !
269+ * \brief Nishikawa's R5 limiter specialization.
270+ * \ingroup FvmAlgos
271+ */
272+ template <>
273+ struct CLimiterDetails <LIMITER::NISHIKAWA_R5>
274+ {
275+ su2double epsp;
276+
277+ /* !
278+ * \brief Store the reference lenght based eps^5 parameter,
279+ * limited to a small number to avoid divisions by 0.
280+ */
281+ template <class ... Ts>
282+ inline void preprocess (CGeometry&, const CConfig& config, Ts&...)
283+ {
284+ su2double L = config.GetRefElemLength ();
285+ su2double K = config.GetVenkat_LimiterCoeff ();
286+ su2double eps1 = fabs (L*K);
287+ epsp = max (pow (eps1, 6 ), LimiterHelpers<>::epsilon ());
288+ }
289+
290+ /* !
291+ * \brief No geometric modification for this kind of limiter.
292+ */
293+ template <class ... Ts>
294+ inline su2double geometricFactor (Ts&...) const {return 1.0 ;}
295+
296+ /* !
297+ * \brief Smooth function that disables limiting in smooth regions.
298+ */
299+ inline su2double limiterFunction (size_t , su2double proj, su2double delta) const
300+ {
301+ return LimiterHelpers<>::r5Function (proj, delta, epsp);
302+ }
303+ };
304+
162305/* !
163306 * \brief Venkatakrishnan-Wang specialization.
164307 * \ingroup FvmAlgos
0 commit comments