Skip to content

Commit

Permalink
Added back the absolute values to avoid rounding errors and divisions…
Browse files Browse the repository at this point in the history
… by 0
  • Loading branch information
amrueda committed Nov 11, 2024
1 parent 2caf256 commit a1421f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/solvers/dgsem_tree/dg_2d_subcell_limiters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit a1421f0

Please sign in to comment.