Skip to content

Commit

Permalink
Implement suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
bennibolm committed Oct 24, 2023
1 parent 535f520 commit 5b2b888
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
13 changes: 9 additions & 4 deletions src/solvers/dgsem_tree/dg_2d_subcell_limiters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,15 @@ end
return nothing
end

@inline function get_boundary_outer_state(u_inner, cache, t,
boundary_condition::BoundaryConditionDirichlet,
orientation_or_normal, direction, equations,
dg, indices...)
"""
get_boundary_outer_state(boundary_condition::BoundaryConditionDirichlet,
cache, t, equations, dg, indices...)
For subcell limiting, the calculation of local bounds for non-periodic domains require the boundary
outer state. This function returns the boundary value at time `t` and for node with spatial
indices `indices`.
"""
@inline function get_boundary_outer_state(boundary_condition::BoundaryConditionDirichlet,
cache, t, equations, dg, indices...)
(; node_coordinates) = cache.elements

x = get_node_coords(node_coordinates, equations, dg, indices...)
Expand Down
4 changes: 2 additions & 2 deletions src/solvers/dgsem_tree/subcell_limiters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ end
Subcell invariant domain preserving (IDP) limiting used with [`VolumeIntegralSubcellLimiting`](@ref)
including:
- maximum/minimum Zalesak-type limiting for conservative variables (`local_minmax_variables_cons`)
- positivity limiting for conservative variables (`positivity_variables_cons`)
- Local maximum/minimum Zalesak-type limiting for conservative variables (`local_minmax_variables_cons`)
- Positivity limiting for conservative variables (`positivity_variables_cons`)
The bounds are calculated using the low-order FV solution. The positivity limiter uses
`positivity_correction_factor` such that `u^new >= positivity_correction_factor * u^FV`.
Expand Down
7 changes: 2 additions & 5 deletions src/solvers/dgsem_tree/subcell_limiters_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,8 @@ end
index = reverse(index)
boundary_index += 2
end
u_inner = get_node_vars(u, equations, dg, index..., element)
u_outer = get_boundary_outer_state(u_inner, cache, t,
boundary_conditions[boundary_index],
orientation, boundary_index,
equations, dg, index..., element)
u_outer = get_boundary_outer_state(boundary_conditions[boundary_index], cache,
t, equations, dg, index..., element)
var_outer = u_outer[variable]

var_min[index..., element] = min(var_min[index..., element], var_outer)
Expand Down

0 comments on commit 5b2b888

Please sign in to comment.