From a1421f0e85e1f659f8292135780a1ee7fad140df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Rueda-Ram=C3=ADrez?= Date: Mon, 11 Nov 2024 15:14:05 +0100 Subject: [PATCH] Added back the absolute values to avoid rounding errors and divisions by 0 --- src/solvers/dgsem_tree/dg_2d_subcell_limiters.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/solvers/dgsem_tree/dg_2d_subcell_limiters.jl b/src/solvers/dgsem_tree/dg_2d_subcell_limiters.jl index 34eabf55fb2..14d72537299 100644 --- a/src/solvers/dgsem_tree/dg_2d_subcell_limiters.jl +++ b/src/solvers/dgsem_tree/dg_2d_subcell_limiters.jl @@ -1720,7 +1720,7 @@ end alpha = 1 # Initialize alpha for plotting if (entProd_FV - delta_entProd > 0.0) && (delta_entProd != 0.0) alpha = min(1.0, - (entProd_FV + eps()) / (delta_entProd + eps())) + (abs(entProd_FV) + eps()) / (abs(delta_entProd) + eps())) for v in eachvariable(equations) antidiffusive_flux1_L[v, i, j, element] = alpha * antidiffusive_flux1_L[v, @@ -1768,7 +1768,7 @@ end alpha = 1 # Initialize alpha for plotting if (entProd_FV - delta_entProd > 0.0) && (delta_entProd != 0.0) alpha = min(1.0, - (entProd_FV + eps()) / (delta_entProd + eps())) + (abs(entProd_FV) + eps()) / (abs(delta_entProd) + eps())) for v in eachvariable(equations) antidiffusive_flux2_L[v, i, j, element] = alpha * antidiffusive_flux2_L[v,