diff --git a/examples/structured_2d_dgsem/elixir_euler_convergence_wavingflag_MCL.jl b/examples/structured_2d_dgsem/elixir_euler_convergence_wavingflag_MCL.jl index 20a20a9c20b..7255781d3b1 100644 --- a/examples/structured_2d_dgsem/elixir_euler_convergence_wavingflag_MCL.jl +++ b/examples/structured_2d_dgsem/elixir_euler_convergence_wavingflag_MCL.jl @@ -14,13 +14,13 @@ volume_flux = flux_ranocha polydeg = 3 basis = LobattoLegendreBasis(polydeg) limiter_mcl = SubcellLimiterMCL(equations, basis; - DensityLimiter = false, - DensityAlphaForAll = false, - SequentialLimiter = false, - ConservativeLimiter = false, - DensityPositivityLimiter = true, - PressurePositivityLimiterKuzmin = true, - PressurePositivityLimiterKuzminExact = true, + density_limiter = false, + density_coefficient_for_all = false, + sequential_limiter = false, + conservative_limiter = false, + positivity_limiter_density = true, + positivity_limiter_pressure = true, + positivity_limiter_pressure_exact = true, Plotting = true) volume_integral = VolumeIntegralSubcellLimiting(limiter_mcl; diff --git a/examples/structured_2d_dgsem/elixir_euler_double_mach_MCL.jl b/examples/structured_2d_dgsem/elixir_euler_double_mach_MCL.jl index c7df12f27af..6a04b39ec4f 100644 --- a/examples/structured_2d_dgsem/elixir_euler_double_mach_MCL.jl +++ b/examples/structured_2d_dgsem/elixir_euler_double_mach_MCL.jl @@ -22,13 +22,13 @@ polydeg = 4 basis = LobattoLegendreBasis(polydeg) limiter_mcl = SubcellLimiterMCL(equations, basis; - DensityLimiter = true, - DensityAlphaForAll = false, - SequentialLimiter = true, - ConservativeLimiter = false, - DensityPositivityLimiter = false, - PressurePositivityLimiterKuzmin = false, - SemiDiscEntropyLimiter = false, + density_limiter = true, + density_coefficient_for_all = false, + sequential_limiter = true, + conservative_limiter = false, + positivity_limiter_density = false, + positivity_limiter_pressure = false, + entropy_limiter_semidiscrete = false, Plotting = true) volume_integral = VolumeIntegralSubcellLimiting(limiter_mcl; volume_flux_dg = volume_flux, diff --git a/examples/structured_2d_dgsem/elixir_euler_free_stream_MCL.jl b/examples/structured_2d_dgsem/elixir_euler_free_stream_MCL.jl index 163cc6519a9..623e69bcaa4 100644 --- a/examples/structured_2d_dgsem/elixir_euler_free_stream_MCL.jl +++ b/examples/structured_2d_dgsem/elixir_euler_free_stream_MCL.jl @@ -14,14 +14,14 @@ volume_flux = flux_ranocha polydeg = 3 basis = LobattoLegendreBasis(polydeg) limiter_mcl = SubcellLimiterMCL(equations, basis; - DensityLimiter = false, - DensityAlphaForAll = false, - SequentialLimiter = false, - ConservativeLimiter = false, - PressurePositivityLimiterKuzmin = true, - PressurePositivityLimiterKuzminExact = true, - DensityPositivityLimiter = true, - SemiDiscEntropyLimiter = false, + density_limiter = false, + density_coefficient_for_all = false, + sequential_limiter = false, + conservative_limiter = false, + positivity_limiter_pressure = true, + positivity_limiter_pressure_exact = true, + positivity_limiter_density = true, + entropy_limiter_semidiscrete = false, smoothness_indicator = false, Plotting = true) diff --git a/examples/structured_2d_dgsem/elixir_euler_shock_upstream_MCL.jl b/examples/structured_2d_dgsem/elixir_euler_shock_upstream_MCL.jl index 06eaceb4f7c..cc12990ab10 100644 --- a/examples/structured_2d_dgsem/elixir_euler_shock_upstream_MCL.jl +++ b/examples/structured_2d_dgsem/elixir_euler_shock_upstream_MCL.jl @@ -37,14 +37,14 @@ polydeg = 5 basis = LobattoLegendreBasis(polydeg) limiter_mcl = SubcellLimiterMCL(equations, basis; - DensityLimiter = true, - DensityAlphaForAll = false, - SequentialLimiter = true, - ConservativeLimiter = false, - PressurePositivityLimiterKuzmin = false, - PressurePositivityLimiterKuzminExact = false, - DensityPositivityLimiter = false, - SemiDiscEntropyLimiter = false, + density_limiter = true, + density_coefficient_for_all = false, + sequential_limiter = true, + conservative_limiter = false, + positivity_limiter_pressure = false, + positivity_limiter_pressure_exact = false, + positivity_limiter_density = false, + entropy_limiter_semidiscrete = false, Plotting = true) volume_integral = VolumeIntegralSubcellLimiting(limiter_mcl; volume_flux_dg = volume_flux, diff --git a/examples/tree_2d_dgsem/elixir_euler_astro_jet_MCL.jl b/examples/tree_2d_dgsem/elixir_euler_astro_jet_MCL.jl index 69148f5bdb6..b34ac71644c 100644 --- a/examples/tree_2d_dgsem/elixir_euler_astro_jet_MCL.jl +++ b/examples/tree_2d_dgsem/elixir_euler_astro_jet_MCL.jl @@ -42,12 +42,12 @@ basis = LobattoLegendreBasis(polydeg) # shock capturing necessary for this tough example limiter_mcl = SubcellLimiterMCL(equations, basis; - DensityLimiter = true, - DensityAlphaForAll = true, - SequentialLimiter = true, - PressurePositivityLimiterKuzmin = true, - DensityPositivityLimiter = false, - SemiDiscEntropyLimiter = false, + density_limiter = true, + density_coefficient_for_all = true, + sequential_limiter = true, + positivity_limiter_pressure = true, + positivity_limiter_density = false, + entropy_limiter_semidiscrete = false, Plotting = true) volume_integral = VolumeIntegralSubcellLimiting(limiter_mcl; volume_flux_dg = volume_flux, diff --git a/examples/tree_2d_dgsem/elixir_euler_blast_wave_MCL.jl b/examples/tree_2d_dgsem/elixir_euler_blast_wave_MCL.jl index 3e90ef7da2e..ba5f27d9f9f 100644 --- a/examples/tree_2d_dgsem/elixir_euler_blast_wave_MCL.jl +++ b/examples/tree_2d_dgsem/elixir_euler_blast_wave_MCL.jl @@ -39,14 +39,14 @@ surface_flux = flux_lax_friedrichs volume_flux = flux_ranocha basis = LobattoLegendreBasis(3) limiter_mcl = SubcellLimiterMCL(equations, basis; - DensityLimiter = true, - DensityAlphaForAll = true, - SequentialLimiter = false, - ConservativeLimiter = true, - DensityPositivityLimiter = true, - PressurePositivityLimiterKuzmin = true, - PressurePositivityLimiterKuzminExact = false, - SemiDiscEntropyLimiter = true, + density_limiter = true, + density_coefficient_for_all = true, + sequential_limiter = false, + conservative_limiter = true, + positivity_limiter_density = true, + positivity_limiter_pressure = true, + positivity_limiter_pressure_exact = false, + entropy_limiter_semidiscrete = true, smoothness_indicator = true, Plotting = false) volume_integral = VolumeIntegralSubcellLimiting(limiter_mcl; diff --git a/examples/tree_2d_dgsem/elixir_euler_convergence_MCL.jl b/examples/tree_2d_dgsem/elixir_euler_convergence_MCL.jl index d82aed8ba32..02ebaa2b3cb 100644 --- a/examples/tree_2d_dgsem/elixir_euler_convergence_MCL.jl +++ b/examples/tree_2d_dgsem/elixir_euler_convergence_MCL.jl @@ -14,13 +14,13 @@ volume_flux = flux_ranocha polydeg = 3 basis = LobattoLegendreBasis(polydeg) limiter_mcl = SubcellLimiterMCL(equations, basis; - DensityLimiter = false, - DensityAlphaForAll = false, - SequentialLimiter = false, - ConservativeLimiter = false, - DensityPositivityLimiter = true, - PressurePositivityLimiterKuzmin = true, - PressurePositivityLimiterKuzminExact = true, + density_limiter = false, + density_coefficient_for_all = false, + sequential_limiter = false, + conservative_limiter = false, + positivity_limiter_density = true, + positivity_limiter_pressure = true, + positivity_limiter_pressure_exact = true, Plotting = true) volume_integral = VolumeIntegralSubcellLimiting(limiter_mcl; diff --git a/examples/tree_2d_dgsem/elixir_euler_kelvin_helmholtz_instability_MCL.jl b/examples/tree_2d_dgsem/elixir_euler_kelvin_helmholtz_instability_MCL.jl index 548485a1abc..549054f41fe 100644 --- a/examples/tree_2d_dgsem/elixir_euler_kelvin_helmholtz_instability_MCL.jl +++ b/examples/tree_2d_dgsem/elixir_euler_kelvin_helmholtz_instability_MCL.jl @@ -38,14 +38,14 @@ polydeg = 3 basis = LobattoLegendreBasis(polydeg) limiter_mcl = SubcellLimiterMCL(equations, basis; - DensityLimiter = false, - DensityAlphaForAll = false, - SequentialLimiter = false, - ConservativeLimiter = false, - PressurePositivityLimiterKuzmin = true, - PressurePositivityLimiterKuzminExact = true, - DensityPositivityLimiter = true, - SemiDiscEntropyLimiter = false, + density_limiter = false, + density_coefficient_for_all = false, + sequential_limiter = false, + conservative_limiter = false, + positivity_limiter_pressure = true, + positivity_limiter_pressure_exact = true, + positivity_limiter_density = true, + entropy_limiter_semidiscrete = false, Plotting = true) volume_integral = VolumeIntegralSubcellLimiting(limiter_mcl; volume_flux_dg = volume_flux, diff --git a/examples/tree_2d_dgsem/elixir_euler_sedov_blast_wave_MCL.jl b/examples/tree_2d_dgsem/elixir_euler_sedov_blast_wave_MCL.jl index a5e7532854e..51e42bf4a0e 100644 --- a/examples/tree_2d_dgsem/elixir_euler_sedov_blast_wave_MCL.jl +++ b/examples/tree_2d_dgsem/elixir_euler_sedov_blast_wave_MCL.jl @@ -42,14 +42,14 @@ surface_flux = flux_lax_friedrichs volume_flux = flux_chandrashekar basis = LobattoLegendreBasis(3) limiter_mcl = SubcellLimiterMCL(equations, basis; - DensityLimiter = true, - DensityAlphaForAll = false, - SequentialLimiter = true, - ConservativeLimiter = false, - DensityPositivityLimiter = false, - PressurePositivityLimiterKuzmin = true, - PressurePositivityLimiterKuzminExact = true, - SemiDiscEntropyLimiter = true, + density_limiter = true, + density_coefficient_for_all = false, + sequential_limiter = true, + conservative_limiter = false, + positivity_limiter_density = false, + positivity_limiter_pressure = true, + positivity_limiter_pressure_exact = true, + entropy_limiter_semidiscrete = true, smoothness_indicator = false, Plotting = true) volume_integral = VolumeIntegralSubcellLimiting(limiter_mcl; diff --git a/src/callbacks_stage/subcell_bounds_check.jl b/src/callbacks_stage/subcell_bounds_check.jl index 527bcb0750a..16cf3abeee9 100644 --- a/src/callbacks_stage/subcell_bounds_check.jl +++ b/src/callbacks_stage/subcell_bounds_check.jl @@ -123,7 +123,7 @@ function init_callback(callback::BoundsCheckCallback, semi, limiter::SubcellLimi open("$output_directory/deviations.txt", "a") do f print(f, "# iter, simu_time", join(", $(v)_min, $(v)_max" for v in varnames(cons2cons, semi.equations))) - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure print(f, ", pressure_min") end # TODO: Bounds check for entropy limiting @@ -200,11 +200,11 @@ end println(variables[v], ":\n- lower bound: ", mcl_bounds_delta[2, 1, v], "\n- upper bound: ", mcl_bounds_delta[2, 2, v]) end - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure println("pressure:\n- positivity: ", mcl_bounds_delta[2, 1, nvariables(semi.equations) + 1]) end - if limiter.SemiDiscEntropyLimiter + if limiter.entropy_limiter_semidiscrete # TODO: Bounds check for entropy limiting println("\nWARNING: No bounds check for the entropy limiter.") end diff --git a/src/callbacks_stage/subcell_bounds_check_2d.jl b/src/callbacks_stage/subcell_bounds_check_2d.jl index cf47c0fc534..747ef8410cd 100644 --- a/src/callbacks_stage/subcell_bounds_check_2d.jl +++ b/src/callbacks_stage/subcell_bounds_check_2d.jl @@ -136,7 +136,7 @@ end n_vars = nvariables(equations) - if limiter.DensityLimiter + if limiter.density_limiter # New solution u^{n+1} for element in eachelement(solver, cache) for j in eachnode(solver), i in eachnode(solver) @@ -189,9 +189,9 @@ end rho_limited - var_max[1, i, j, element]) end end - end # limiter.DensityLimiter + end # limiter.density_limiter - if limiter.SequentialLimiter + if limiter.sequential_limiter # New solution u^{n+1} for element in eachelement(solver, cache) for j in eachnode(solver), i in eachnode(solver) @@ -204,7 +204,7 @@ end var_limited - var_max[v, i, j, element]) end - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure error_pressure = 0.5 * (u[2, i, j, element]^2 + u[3, i, j, element]^2) - u[1, i, j, element] * u[4, i, j, element] @@ -239,11 +239,11 @@ end mcl_bounds_delta[1, 2, v] = max(mcl_bounds_delta[1, 2, v], var_limited / rho_limited - var_max[v, i, j, element]) - if limiter.PressurePositivityLimiterKuzmin && (v == 2 || v == 3) + if limiter.positivity_limiter_pressure && (v == 2 || v == 3) error_pressure += 0.5 * var_limited^2 end end - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure error_pressure -= var_limited * rho_limited mcl_bounds_delta[1, 1, n_vars + 1] = max(mcl_bounds_delta[1, 1, n_vars + 1], @@ -264,11 +264,11 @@ end mcl_bounds_delta[1, 2, v] = max(mcl_bounds_delta[1, 2, v], var_limited / rho_limited - var_max[v, i, j, element]) - if limiter.PressurePositivityLimiterKuzmin && (v == 2 || v == 3) + if limiter.positivity_limiter_pressure && (v == 2 || v == 3) error_pressure += 0.5 * var_limited^2 end end - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure error_pressure -= var_limited * rho_limited mcl_bounds_delta[1, 1, n_vars + 1] = max(mcl_bounds_delta[1, 1, n_vars + 1], @@ -289,11 +289,11 @@ end mcl_bounds_delta[1, 2, v] = max(mcl_bounds_delta[1, 2, v], var_limited / rho_limited - var_max[v, i, j, element]) - if limiter.PressurePositivityLimiterKuzmin && (v == 2 || v == 3) + if limiter.positivity_limiter_pressure && (v == 2 || v == 3) error_pressure += 0.5 * var_limited^2 end end - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure error_pressure -= var_limited * rho_limited mcl_bounds_delta[1, 1, n_vars + 1] = max(mcl_bounds_delta[1, 1, n_vars + 1], @@ -314,11 +314,11 @@ end mcl_bounds_delta[1, 2, v] = max(mcl_bounds_delta[1, 2, v], var_limited / rho_limited - var_max[v, i, j, element]) - if limiter.PressurePositivityLimiterKuzmin && (v == 2 || v == 3) + if limiter.positivity_limiter_pressure && (v == 2 || v == 3) error_pressure += 0.5 * var_limited^2 end end - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure error_pressure -= var_limited * rho_limited mcl_bounds_delta[1, 1, n_vars + 1] = max(mcl_bounds_delta[1, 1, n_vars + 1], @@ -327,7 +327,7 @@ end end end end - elseif limiter.ConservativeLimiter + elseif limiter.conservative_limiter # New solution u^{n+1} for element in eachelement(solver, cache) for j in eachnode(solver), i in eachnode(solver) @@ -339,7 +339,7 @@ end u[v, i, j, element] - var_max[v, i, j, element]) end - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure error_pressure = 0.5 * (u[2, i, j, element]^2 + u[3, i, j, element]^2) - u[1, i, j, element] * u[4, i, j, element] @@ -374,11 +374,11 @@ end mcl_bounds_delta[1, 2, v] = max(mcl_bounds_delta[1, 2, v], var_limited - var_max[v, i, j, element]) - if limiter.PressurePositivityLimiterKuzmin && (v == 2 || v == 3) + if limiter.positivity_limiter_pressure && (v == 2 || v == 3) error_pressure += 0.5 * var_limited^2 end end - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure error_pressure -= var_limited * rho_limited mcl_bounds_delta[1, 1, n_vars + 1] = max(mcl_bounds_delta[1, 1, n_vars + 1], @@ -399,11 +399,11 @@ end mcl_bounds_delta[1, 2, v] = max(mcl_bounds_delta[1, 2, v], var_limited - var_max[v, i, j, element]) - if limiter.PressurePositivityLimiterKuzmin && (v == 2 || v == 3) + if limiter.positivity_limiter_pressure && (v == 2 || v == 3) error_pressure += 0.5 * var_limited^2 end end - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure error_pressure -= var_limited * rho_limited mcl_bounds_delta[1, 1, n_vars + 1] = max(mcl_bounds_delta[1, 1, n_vars + 1], @@ -424,11 +424,11 @@ end mcl_bounds_delta[1, 2, v] = max(mcl_bounds_delta[1, 2, v], var_limited - var_max[v, i, j, element]) - if limiter.PressurePositivityLimiterKuzmin && (v == 2 || v == 3) + if limiter.positivity_limiter_pressure && (v == 2 || v == 3) error_pressure += 0.5 * var_limited^2 end end - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure error_pressure -= var_limited * rho_limited mcl_bounds_delta[1, 1, n_vars + 1] = max(mcl_bounds_delta[1, 1, n_vars + 1], @@ -449,11 +449,11 @@ end mcl_bounds_delta[1, 2, v] = max(mcl_bounds_delta[1, 2, v], var_limited - var_max[v, i, j, element]) - if limiter.PressurePositivityLimiterKuzmin && (v == 2 || v == 3) + if limiter.positivity_limiter_pressure && (v == 2 || v == 3) error_pressure += 0.5 * var_limited^2 end end - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure error_pressure -= var_limited * rho_limited mcl_bounds_delta[1, 1, n_vars + 1] = max(mcl_bounds_delta[1, 1, n_vars + 1], @@ -462,7 +462,7 @@ end end end end - elseif limiter.PressurePositivityLimiterKuzmin + elseif limiter.positivity_limiter_pressure # New solution u^{n+1} for element in eachelement(solver, cache) for j in eachnode(solver), i in eachnode(solver) @@ -554,9 +554,9 @@ end error_pressure) end end - end # limiter.PressurePositivityLimiterKuzmin + end # limiter.positivity_limiter_pressure - if limiter.DensityPositivityLimiter + if limiter.positivity_limiter_density # New solution u^{n+1} for element in eachelement(solver, cache) for j in eachnode(solver), i in eachnode(solver) @@ -566,7 +566,7 @@ end end # Limited bar states \bar{u}^{Lim} = \bar{u} + Δf^{Lim} / λ - beta = limiter.DensityPositivityCorrectionFactor + beta = limiter.positivity_limiter_correction_factor # Checking the bounds for... # - density (rho): # beta * \bar{rho} <= \bar{rho}^{Lim} @@ -594,7 +594,7 @@ end mcl_bounds_delta[1, 1, 1] = max(mcl_bounds_delta[1, 1, 1], -rho_limited) end end - end # limiter.DensityPositivityLimiter + end # limiter.positivity_limiter_density for v in eachvariable(equations) mcl_bounds_delta[2, 1, v] = max(mcl_bounds_delta[2, 1, v], @@ -602,7 +602,7 @@ end mcl_bounds_delta[2, 2, v] = max(mcl_bounds_delta[2, 2, v], mcl_bounds_delta[1, 2, v]) end - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure mcl_bounds_delta[2, 1, n_vars + 1] = max(mcl_bounds_delta[2, 1, n_vars + 1], mcl_bounds_delta[1, 1, n_vars + 1]) end @@ -615,7 +615,7 @@ end for v in eachvariable(equations) print(f, ", ", mcl_bounds_delta[1, 1, v], ", ", mcl_bounds_delta[1, 2, v]) end - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure print(f, ", ", mcl_bounds_delta[1, 1, n_vars + 1]) end println(f) @@ -624,7 +624,7 @@ end mcl_bounds_delta[1, 1, v] = zero(eltype(mcl_bounds_delta)) mcl_bounds_delta[1, 2, v] = zero(eltype(mcl_bounds_delta)) end - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure mcl_bounds_delta[1, 1, n_vars + 1] = zero(eltype(mcl_bounds_delta)) end diff --git a/src/callbacks_step/limiting_analysis.jl b/src/callbacks_step/limiting_analysis.jl index 55e48cbaf83..5bbf8c8b801 100644 --- a/src/callbacks_step/limiting_analysis.jl +++ b/src/callbacks_step/limiting_analysis.jl @@ -91,10 +91,10 @@ function initialize!(cb::DiscreteCallback{Condition, Affect!}, u_ode, t, integra open("$output_directory/$file", "a") do f print(f, "# iter, simu_time", join(", alpha_min_$v, alpha_avg_$v" for v in vars)) - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure print(f, ", alpha_min_pressure, alpha_avg_pressure") end - if limiter.SemiDiscEntropyLimiter + if limiter.entropy_limiter_semidiscrete print(f, ", alpha_min_entropy, alpha_avg_entropy") end println(f) @@ -172,11 +172,11 @@ end print(f, ", ", minimum(view(alpha, v, ntuple(_ -> :, n_vars - 1)...))) print(f, ", ", alpha_min_avg[v]) end - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure print(f, ", ", minimum(alpha_pressure), ", ", alpha_min_avg[n_vars + 1]) end - if limiter.SemiDiscEntropyLimiter - k = n_vars + limiter.PressurePositivityLimiterKuzmin + 1 + if limiter.entropy_limiter_semidiscrete + k = n_vars + limiter.positivity_limiter_pressure + 1 print(f, ", ", minimum(alpha_entropy), ", ", alpha_min_avg[k]) end println(f) @@ -187,12 +187,12 @@ end print(f, ", ", minimum(view(alpha_mean, v, ntuple(_ -> :, n_vars - 1)...))) print(f, ", ", alpha_mean_avg[v]) end - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure print(f, ", ", minimum(alpha_mean_pressure), ", ", alpha_mean_avg[n_vars + 1]) end - if limiter.SemiDiscEntropyLimiter - k = n_vars + limiter.PressurePositivityLimiterKuzmin + 1 + if limiter.entropy_limiter_semidiscrete + k = n_vars + limiter.positivity_limiter_pressure + 1 print(f, ", ", minimum(alpha_mean_entropy), ", ", alpha_mean_avg[k]) end println(f) diff --git a/src/callbacks_step/limiting_analysis_2d.jl b/src/callbacks_step/limiting_analysis_2d.jl index a6b5c498c3d..ef547c01967 100644 --- a/src/callbacks_step/limiting_analysis_2d.jl +++ b/src/callbacks_step/limiting_analysis_2d.jl @@ -47,11 +47,11 @@ function analyze_coefficient_MCL(mesh::TreeMesh2D, equations, dg, cache, limiter n_vars = nvariables(equations) alpha_avg = zeros(eltype(alpha), - n_vars + limiter.PressurePositivityLimiterKuzmin + - limiter.SemiDiscEntropyLimiter) + n_vars + limiter.positivity_limiter_pressure + + limiter.entropy_limiter_semidiscrete) alpha_mean_avg = zeros(eltype(alpha), - n_vars + limiter.PressurePositivityLimiterKuzmin + - limiter.SemiDiscEntropyLimiter) + n_vars + limiter.positivity_limiter_pressure + + limiter.entropy_limiter_semidiscrete) total_volume = zero(eltype(alpha)) for element in eachelement(dg, cache) @@ -63,14 +63,14 @@ function analyze_coefficient_MCL(mesh::TreeMesh2D, equations, dg, cache, limiter alpha_mean_avg[v] += jacobian * weights[i] * weights[j] * alpha_mean[v, i, j, element] end - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure alpha_avg[n_vars + 1] += jacobian * weights[i] * weights[j] * alpha_pressure[i, j, element] alpha_mean_avg[n_vars + 1] += jacobian * weights[i] * weights[j] * alpha_mean_pressure[i, j, element] end - if limiter.SemiDiscEntropyLimiter - k = n_vars + limiter.PressurePositivityLimiterKuzmin + 1 + if limiter.entropy_limiter_semidiscrete + k = n_vars + limiter.positivity_limiter_pressure + 1 alpha_avg[k] += jacobian * weights[i] * weights[j] * alpha_entropy[i, j, element] alpha_mean_avg[k] += jacobian * weights[i] * weights[j] * @@ -92,11 +92,11 @@ function analyze_coefficient_MCL(mesh::StructuredMesh{2}, equations, dg, cache, n_vars = nvariables(equations) alpha_avg = zeros(eltype(alpha), - n_vars + limiter.PressurePositivityLimiterKuzmin + - limiter.SemiDiscEntropyLimiter) + n_vars + limiter.positivity_limiter_pressure + + limiter.entropy_limiter_semidiscrete) alpha_mean_avg = zeros(eltype(alpha), - n_vars + limiter.PressurePositivityLimiterKuzmin + - limiter.SemiDiscEntropyLimiter) + n_vars + limiter.positivity_limiter_pressure + + limiter.entropy_limiter_semidiscrete) total_volume = zero(eltype(alpha)) for element in eachelement(dg, cache) @@ -108,14 +108,14 @@ function analyze_coefficient_MCL(mesh::StructuredMesh{2}, equations, dg, cache, alpha_mean_avg[v] += jacobian * weights[i] * weights[j] * alpha_mean[v, i, j, element] end - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure alpha_avg[n_vars + 1] += jacobian * weights[i] * weights[j] * alpha_pressure[i, j, element] alpha_mean_avg[n_vars + 1] += jacobian * weights[i] * weights[j] * alpha_mean_pressure[i, j, element] end - if limiter.SemiDiscEntropyLimiter - k = n_vars + limiter.PressurePositivityLimiterKuzmin + 1 + if limiter.entropy_limiter_semidiscrete + k = n_vars + limiter.positivity_limiter_pressure + 1 alpha_avg[k] += jacobian * weights[i] * weights[j] * alpha_entropy[i, j, element] alpha_mean_avg[k] += jacobian * weights[i] * weights[j] * diff --git a/src/solvers/dgsem_tree/dg_2d_subcell_limiters.jl b/src/solvers/dgsem_tree/dg_2d_subcell_limiters.jl index ed9c193725c..981ae1e97bd 100644 --- a/src/solvers/dgsem_tree/dg_2d_subcell_limiters.jl +++ b/src/solvers/dgsem_tree/dg_2d_subcell_limiters.jl @@ -971,7 +971,7 @@ end var_max[v, :, :, element] .= typemin(eltype(var_max)) end - if limiter.DensityLimiter + if limiter.density_limiter for j in eachnode(dg), i in eachnode(dg) # Previous solution var_min[1, i, j, element] = min(var_min[1, i, j, element], @@ -1003,9 +1003,9 @@ end var_max[1, i, j, element] = max(var_max[1, i, j, element], bar_state_rho) end - end #limiter.DensityLimiter + end #limiter.density_limiter - if limiter.SequentialLimiter + if limiter.sequential_limiter for j in eachnode(dg), i in eachnode(dg) # Previous solution for v in 2:nvariables(equations) @@ -1050,7 +1050,7 @@ end bar_state_phi) end end - elseif limiter.ConservativeLimiter + elseif limiter.conservative_limiter for j in eachnode(dg), i in eachnode(dg) # Previous solution for v in 2:nvariables(equations) @@ -1112,11 +1112,11 @@ end for j in eachnode(dg), i in eachnode(dg) alpha_mean[:, i, j, element] .= zero(eltype(alpha_mean)) alpha[:, i, j, element] .= one(eltype(alpha)) - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure alpha_mean_pressure[i, j, element] = zero(eltype(alpha_mean_pressure)) alpha_pressure[i, j, element] = one(eltype(alpha_pressure)) end - if limiter.SemiDiscEntropyLimiter + if limiter.entropy_limiter_semidiscrete alpha_mean_entropy[i, j, element] = zero(eltype(alpha_mean_entropy)) alpha_entropy[i, j, element] = one(eltype(alpha_entropy)) end @@ -1130,7 +1130,7 @@ end # Therefore we make sure that the flux keeps its sign during limiting. # Density limiter - if limiter.DensityLimiter + if limiter.density_limiter for j in eachnode(dg), i in 2:nnodes(dg) lambda = lambda1[i, j, element] bar_state_rho = bar_states1[1, i, j, element] @@ -1150,7 +1150,7 @@ end min(f_min, 0.0)) end - if limiter.Plotting || limiter.DensityAlphaForAll + if limiter.Plotting || limiter.density_coefficient_for_all if isapprox(antidiffusive_flux1_L[1, i, j, element], 0.0, atol = eps()) coefficient = 1.0 # flux_limited is zero as well else @@ -1172,7 +1172,7 @@ end antidiffusive_flux1_L[1, i, j, element] = flux_limited #Limit all quantities with the same alpha - if limiter.DensityAlphaForAll + if limiter.density_coefficient_for_all for v in 2:nvariables(equations) antidiffusive_flux1_L[v, i, j, element] = coefficient * antidiffusive_flux1_L[v, @@ -1202,7 +1202,7 @@ end min(f_min, 0.0)) end - if limiter.Plotting || limiter.DensityAlphaForAll + if limiter.Plotting || limiter.density_coefficient_for_all if isapprox(antidiffusive_flux2_L[1, i, j, element], 0.0, atol = eps()) coefficient = 1.0 # flux_limited is zero as well else @@ -1224,7 +1224,7 @@ end antidiffusive_flux2_L[1, i, j, element] = flux_limited #Limit all quantities with the same alpha - if limiter.DensityAlphaForAll + if limiter.density_coefficient_for_all for v in 2:nvariables(equations) antidiffusive_flux2_L[v, i, j, element] = coefficient * antidiffusive_flux2_L[v, @@ -1234,10 +1234,10 @@ end end end end - end # if limiter.DensityLimiter + end # if limiter.density_limiter # Sequential limiter - if limiter.SequentialLimiter + if limiter.sequential_limiter for j in eachnode(dg), i in 2:nnodes(dg) lambda = lambda1[i, j, element] bar_state_rho = bar_states1[1, i, j, element] @@ -1341,7 +1341,7 @@ end end end # Conservative limiter - elseif limiter.ConservativeLimiter + elseif limiter.conservative_limiter for j in eachnode(dg), i in 2:nnodes(dg) lambda = lambda1[i, j, element] for v in 2:nvariables(equations) @@ -1421,11 +1421,11 @@ end antidiffusive_flux2_L[v, i, j, element] = flux_limited end end - end # limiter.SequentialLimiter and limiter.ConservativeLimiter + end # limiter.sequential_limiter and limiter.conservative_limiter # Density positivity limiter - if limiter.DensityPositivityLimiter - beta = limiter.DensityPositivityCorrectionFactor + if limiter.positivity_limiter_density + beta = limiter.positivity_limiter_correction_factor for j in eachnode(dg), i in 2:nnodes(dg) lambda = lambda1[i, j, element] bar_state_rho = bar_states1[1, i, j, element] @@ -1442,7 +1442,7 @@ end min(f_min, 0.0)) end - if limiter.Plotting || limiter.DensityAlphaForAll + if limiter.Plotting || limiter.density_coefficient_for_all if isapprox(antidiffusive_flux1_L[1, i, j, element], 0.0, atol = eps()) coefficient = 1.0 # flux_limited is zero as well else @@ -1454,7 +1454,7 @@ end alpha[1, i - 1, j, element] = min(alpha[1, i - 1, j, element], coefficient) alpha[1, i, j, element] = min(alpha[1, i, j, element], coefficient) - if !limiter.DensityLimiter + if !limiter.density_limiter alpha_mean[1, i - 1, j, element] += coefficient alpha_mean[1, i, j, element] += coefficient end @@ -1463,7 +1463,7 @@ end antidiffusive_flux1_L[1, i, j, element] = flux_limited #Limit all quantities with the same alpha - if limiter.DensityAlphaForAll + if limiter.density_coefficient_for_all for v in 2:nvariables(equations) antidiffusive_flux1_L[v, i, j, element] = coefficient * antidiffusive_flux1_L[v, @@ -1490,7 +1490,7 @@ end min(f_min, 0.0)) end - if limiter.Plotting || limiter.DensityAlphaForAll + if limiter.Plotting || limiter.density_coefficient_for_all if isapprox(antidiffusive_flux2_L[1, i, j, element], 0.0, atol = eps()) coefficient = 1.0 # flux_limited is zero as well else @@ -1502,7 +1502,7 @@ end alpha[1, i, j - 1, element] = min(alpha[1, i, j - 1, element], coefficient) alpha[1, i, j, element] = min(alpha[1, i, j, element], coefficient) - if !limiter.DensityLimiter + if !limiter.density_limiter alpha_mean[1, i, j - 1, element] += coefficient alpha_mean[1, i, j, element] += coefficient end @@ -1511,7 +1511,7 @@ end antidiffusive_flux2_L[1, i, j, element] = flux_limited #Limit all quantities with the same alpha - if limiter.DensityAlphaForAll + if limiter.density_coefficient_for_all for v in 2:nvariables(equations) antidiffusive_flux2_L[v, i, j, element] = coefficient * antidiffusive_flux2_L[v, @@ -1521,13 +1521,13 @@ end end end end - end #if limiter.DensityPositivityLimiter + end #if limiter.positivity_limiter_density # Divide alpha_mean by number of additions if limiter.Plotting @unpack alpha_mean = limiter.cache.subcell_limiter_coefficients # Interfaces contribute with 1.0 - if limiter.DensityLimiter || limiter.DensityPositivityLimiter + if limiter.density_limiter || limiter.positivity_limiter_density for i in eachnode(dg) alpha_mean[1, i, 1, element] += 1.0 alpha_mean[1, i, nnodes(dg), element] += 1.0 @@ -1538,7 +1538,7 @@ end alpha_mean[1, i, j, element] /= 4 end end - if limiter.SequentialLimiter || limiter.ConservativeLimiter + if limiter.sequential_limiter || limiter.conservative_limiter for v in 2:nvariables(equations) for i in eachnode(dg) alpha_mean[v, i, 1, element] += 1.0 @@ -1554,7 +1554,7 @@ end end # Limit pressure à la Kuzmin - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure @unpack alpha_pressure, alpha_mean_pressure = limiter.cache.subcell_limiter_coefficients for j in eachnode(dg), i in 2:nnodes(dg) bar_state_velocity = bar_states1[2, i, j, element]^2 + @@ -1566,7 +1566,7 @@ end (bar_states1[1, i, j, element] * bar_states1[4, i, j, element] - 0.5 * bar_state_velocity) - if limiter.PressurePositivityLimiterKuzminExact + if limiter.positivity_limiter_pressure_exact # exact calculation of max(R_ij, R_ji) R_max = lambda1[i, j, element] * abs(bar_states1[2, i, j, element] * @@ -1621,7 +1621,7 @@ end (bar_states2[1, i, j, element] * bar_states2[4, i, j, element] - 0.5 * bar_state_velocity) - if limiter.PressurePositivityLimiterKuzminExact + if limiter.positivity_limiter_pressure_exact # exact calculation of max(R_ij, R_ji) R_max = lambda2[i, j, element] * abs(bar_states2[2, i, j, element] * @@ -1683,7 +1683,7 @@ end # Limit entropy # TODO: This is a very inefficient function. We compute the entropy four times at each node. # TODO: For now, this only works for Cartesian meshes. - if limiter.SemiDiscEntropyLimiter + if limiter.entropy_limiter_semidiscrete for j in eachnode(dg), i in 2:nnodes(dg) antidiffusive_flux_local = get_node_vars(antidiffusive_flux1_L, equations, dg, diff --git a/src/solvers/dgsem_tree/subcell_limiters.jl b/src/solvers/dgsem_tree/subcell_limiters.jl index 6a10f92b891..babc22f5676 100644 --- a/src/solvers/dgsem_tree/subcell_limiters.jl +++ b/src/solvers/dgsem_tree/subcell_limiters.jl @@ -238,32 +238,33 @@ end """ SubcellLimiterMCL(equations::AbstractEquations, basis; - DensityLimiter = true, - DensityAlphaForAll = false, - SequentialLimiter = true, - ConservativeLimiter = false, - PressurePositivityLimiterKuzmin = false, - PressurePositivityLimiterKuzminExact = true, - DensityPositivityLimiter = false, - DensityPositivityCorrectionFactor = 0.0, - SemiDiscEntropyLimiter = false, + density_limiter = true, + density_coefficient_for_all = false, + sequential_limiter = true, + conservative_limiter = false, + positivity_limiter_pressure = false, + positivity_limiter_pressure_exact = true, + positivity_limiter_density = false, + positivity_limiter_correction_factor = 0.0, + entropy_limiter_semidiscrete = false, smoothness_indicator = false, threshold_smoothness_indicator = 0.1, variable_smoothness_indicator = density_pressure, Plotting = true) Subcell monolithic convex limiting (MCL) used with [`VolumeIntegralSubcellLimiting`](@ref) including: -- local two-sided limiting for `cons(1)` (`DensityLimiter`) -- transfer amount of `DensityLimiter` to all quantities (`DensityAlphaForAll`) -- local two-sided limiting for variables `phi:=cons(i)/cons(1)` (`SequentialLimiter`) -- local two-sided limiting for conservative variables (`ConservativeLimiter`) -- positivity limiting for `cons(1)` (`DensityPositivityLimiter`) and pressure (`PressurePositivityLimiterKuzmin`) -- semidiscrete entropy fix (`SemiDiscEntropyLimiter`) - -The pressure positivity limiting preserves a sharp version (`PressurePositivityLimiterKuzminExact`) -and a more cautious one. The density positivity limiter uses a `DensityPositivityCorrectionFactor` -such that `u^new >= positivity_correction_factor * u^FV`. All additional analyses for plotting routines -can be disabled via `Plotting=false` (see `save_alpha` and `update_alpha_max_avg!`). +- local two-sided limiting for `cons(1)` (`density_limiter`) +- transfer amount of `density_limiter` to all quantities (`density_coefficient_for_all`) +- local two-sided limiting for variables `phi:=cons(i)/cons(1)` (`sequential_limiter`) +- local two-sided limiting for conservative variables (`conservative_limiter`) +- positivity limiting for `cons(1)` (`positivity_limiter_density`) +- positivity limiting pressure à la Kuzmin (`positivity_limiter_pressure`) +- semidiscrete entropy fix (`entropy_limiter_semidiscrete`) + +The pressure positivity limiting preserves a sharp version (`positivity_limiter_pressure_exact`) +and a more cautious one. The density positivity limiter uses a `positivity_limiter_correction_factor` +such that `u^new >= positivity_limiter_correction_factor * u^FV`. All additional analyses for plotting +routines can be disabled via `Plotting=false` (see `save_alpha` and `update_alpha_max_avg!`). A hard-switch [`IndicatorHennemannGassner`](@ref) can be activated (`smoothness_indicator`) with `variable_smoothness_indicator`, which disables subcell blending for element-wise @@ -283,41 +284,41 @@ indicator values <= `threshold_smoothness_indicator`. """ struct SubcellLimiterMCL{RealT <: Real, Cache, Indicator} <: AbstractSubcellLimiter cache::Cache - DensityLimiter::Bool # Impose local maximum/minimum for cons(1) based on bar states - DensityAlphaForAll::Bool # Use the cons(1) blending coefficient for all quantities - SequentialLimiter::Bool # Impose local maximum/minimum for variables phi:=cons(i)/cons(1) i 2:nvariables based on bar states - ConservativeLimiter::Bool # Impose local maximum/minimum for conservative variables 2:nvariables based on bar states - PressurePositivityLimiterKuzmin::Bool # Impose positivity for pressure â la Kuzmin - PressurePositivityLimiterKuzminExact::Bool # Only for PressurePositivityLimiterKuzmin=true: Use the exact calculation of alpha - DensityPositivityLimiter::Bool # Impose positivity for cons(1) - DensityPositivityCorrectionFactor::RealT # Correction Factor for DensityPositivityLimiter in [0,1) - SemiDiscEntropyLimiter::Bool # synchronized semidiscrete entropy fix - smoothness_indicator::Bool # activates smoothness indicator: IndicatorHennemannGassner - threshold_smoothness_indicator::RealT # threshold for smoothness indicator + density_limiter::Bool # Impose local maximum/minimum for cons(1) based on bar states + density_coefficient_for_all::Bool # Use the cons(1) blending coefficient for all quantities + sequential_limiter::Bool # Impose local maximum/minimum for variables phi:=cons(i)/cons(1) i 2:nvariables based on bar states + conservative_limiter::Bool # Impose local maximum/minimum for conservative variables 2:nvariables based on bar states + positivity_limiter_pressure::Bool # Impose positivity for pressure la Kuzmin + positivity_limiter_pressure_exact::Bool # Only for positivity_limiter_pressure=true: Use the sharp calculation of factor + positivity_limiter_density::Bool # Impose positivity for cons(1) + positivity_limiter_correction_factor::RealT # Correction Factor for positivity_limiter_density in [0,1) + entropy_limiter_semidiscrete::Bool # synchronized semidiscrete entropy fix + smoothness_indicator::Bool # activates smoothness indicator: IndicatorHennemannGassner + threshold_smoothness_indicator::RealT # threshold for smoothness indicator IndicatorHG::Indicator Plotting::Bool end # this method is used when the limiter is constructed as for shock-capturing volume integrals function SubcellLimiterMCL(equations::AbstractEquations, basis; - DensityLimiter = true, - DensityAlphaForAll = false, - SequentialLimiter = true, - ConservativeLimiter = false, - PressurePositivityLimiterKuzmin = false, - PressurePositivityLimiterKuzminExact = true, - DensityPositivityLimiter = false, - DensityPositivityCorrectionFactor = 0.0, - SemiDiscEntropyLimiter = false, + density_limiter = true, + density_coefficient_for_all = false, + sequential_limiter = true, + conservative_limiter = false, + positivity_limiter_pressure = false, + positivity_limiter_pressure_exact = true, + positivity_limiter_density = false, + positivity_limiter_correction_factor = 0.0, + entropy_limiter_semidiscrete = false, smoothness_indicator = false, threshold_smoothness_indicator = 0.1, variable_smoothness_indicator = density_pressure, Plotting = true) - if SequentialLimiter && ConservativeLimiter - error("Only one of the two can be selected: SequentialLimiter/ConservativeLimiter") + if sequential_limiter && conservative_limiter + error("Only one of the two can be selected: sequential_limiter/conservative_limiter") end cache = create_cache(SubcellLimiterMCL, equations, basis, - PressurePositivityLimiterKuzmin) + positivity_limiter_pressure) if smoothness_indicator IndicatorHG = IndicatorHennemannGassner(equations, basis, alpha_smooth = false, variable = variable_smoothness_indicator) @@ -326,13 +327,13 @@ function SubcellLimiterMCL(equations::AbstractEquations, basis; end SubcellLimiterMCL{typeof(threshold_smoothness_indicator), typeof(cache), typeof(IndicatorHG)}(cache, - DensityLimiter, DensityAlphaForAll, - SequentialLimiter, ConservativeLimiter, - PressurePositivityLimiterKuzmin, - PressurePositivityLimiterKuzminExact, - DensityPositivityLimiter, - DensityPositivityCorrectionFactor, - SemiDiscEntropyLimiter, + density_limiter, density_coefficient_for_all, + sequential_limiter, conservative_limiter, + positivity_limiter_pressure, + positivity_limiter_pressure_exact, + positivity_limiter_density, + positivity_limiter_correction_factor, + entropy_limiter_semidiscrete, smoothness_indicator, threshold_smoothness_indicator, IndicatorHG, Plotting) @@ -342,20 +343,20 @@ function Base.show(io::IO, limiter::SubcellLimiterMCL) @nospecialize limiter # reduce precompilation time print(io, "SubcellLimiterMCL(") - limiter.DensityLimiter && print(io, "; dens") - limiter.DensityAlphaForAll && print(io, "; dens alpha ∀") - limiter.SequentialLimiter && print(io, "; seq") - limiter.ConservativeLimiter && print(io, "; cons") - if limiter.PressurePositivityLimiterKuzmin + limiter.density_limiter && print(io, "; dens") + limiter.density_coefficient_for_all && print(io, "; dens alpha ∀") + limiter.sequential_limiter && print(io, "; seq") + limiter.conservative_limiter && print(io, "; cons") + if limiter.positivity_limiter_pressure print(io, - "; $(limiter.PressurePositivityLimiterKuzminExact ? "pres (Kuzmin ex)" : "pres (Kuzmin)")") + "; $(limiter.positivity_limiter_pressure_exact ? "pres (sharp)" : "pres (cautious)")") end - limiter.DensityPositivityLimiter && print(io, "; dens pos") - if limiter.DensityPositivityCorrectionFactor != 0 + limiter.positivity_limiter_density && print(io, "; dens pos") + if limiter.positivity_limiter_correction_factor != 0 print(io, - " with correction factor $(limiter.DensityPositivityCorrectionFactor)") + " with correction factor $(limiter.positivity_limiter_correction_factor)") end - limiter.SemiDiscEntropyLimiter && print(io, "; semid. entropy") + limiter.entropy_limiter_semidiscrete && print(io, "; semid. entropy") limiter.smoothness_indicator && print(io, "; Smoothness indicator: ", limiter.IndicatorHG, " with threshold ", limiter.threshold_smoothness_indicator) @@ -364,34 +365,36 @@ end function Base.show(io::IO, ::MIME"text/plain", limiter::SubcellLimiterMCL) @nospecialize limiter # reduce precompilation time - @unpack DensityLimiter, DensityAlphaForAll, SequentialLimiter, ConservativeLimiter, - PressurePositivityLimiterKuzminExact, DensityPositivityLimiter, SemiDiscEntropyLimiter = limiter + @unpack density_limiter, density_coefficient_for_all, sequential_limiter, conservative_limiter, + positivity_limiter_pressure_exact, positivity_limiter_density, entropy_limiter_semidiscrete = limiter if get(io, :compact, false) show(io, limiter) else setup = ["limiter" => ""] - DensityLimiter && (setup = [setup..., "" => "DensityLimiter"]) - DensityAlphaForAll && (setup = [setup..., "" => "DensityAlphaForAll"]) - SequentialLimiter && (setup = [setup..., "" => "SequentialLimiter"]) - ConservativeLimiter && (setup = [setup..., "" => "ConservativeLimiter"]) - if limiter.PressurePositivityLimiterKuzmin + density_limiter && (setup = [setup..., "" => "Density Limiter"]) + density_coefficient_for_all && + (setup = [setup..., "" => "Transfer density coefficient to all quantities"]) + sequential_limiter && (setup = [setup..., "" => "Sequential Limiter"]) + conservative_limiter && (setup = [setup..., "" => "Conservative Limiter"]) + if limiter.positivity_limiter_pressure setup = [ setup..., - "" => "PressurePositivityLimiterKuzmin $(PressurePositivityLimiterKuzminExact ? "(exact)" : "")", + "" => "$(positivity_limiter_pressure_exact ? "(Sharp)" : "(Cautious)") positivity limiter for Pressure à la Kuzmin", ] end - if DensityPositivityLimiter - if limiter.DensityPositivityCorrectionFactor != 0.0 + if positivity_limiter_density + if limiter.positivity_limiter_correction_factor != 0.0 setup = [ setup..., - "" => "DensityPositivityLimiter with correction factor $(limiter.DensityPositivityCorrectionFactor)", + "" => "Positivity Limiter for Density with correction factor $(limiter.positivity_limiter_correction_factor)", ] else - setup = [setup..., "" => "DensityPositivityLimiter"] + setup = [setup..., "" => "Positivity Limiter for Density"] end end - SemiDiscEntropyLimiter && (setup = [setup..., "" => "SemiDiscEntropyLimiter"]) + entropy_limiter_semidiscrete && + (setup = [setup..., "" => "Semidiscrete Entropy Limiter"]) if limiter.smoothness_indicator setup = [ setup..., @@ -414,12 +417,12 @@ function get_node_variables!(node_variables, limiter::SubcellLimiterMCL, node_variables[s] = alpha[v, ntuple(_ -> :, size(alpha, 2) + 1)...] end - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure @unpack alpha_pressure = limiter.cache.subcell_limiter_coefficients node_variables[:alpha_pressure] = alpha_pressure end - if limiter.SemiDiscEntropyLimiter + if limiter.entropy_limiter_semidiscrete @unpack alpha_entropy = limiter.cache.subcell_limiter_coefficients node_variables[:alpha_entropy] = alpha_entropy end @@ -430,12 +433,12 @@ function get_node_variables!(node_variables, limiter::SubcellLimiterMCL, node_variables[s] = copy(alpha_mean[v, ntuple(_ -> :, size(alpha, 2) + 1)...]) end - if limiter.PressurePositivityLimiterKuzmin + if limiter.positivity_limiter_pressure @unpack alpha_mean_pressure = limiter.cache.subcell_limiter_coefficients node_variables[:alpha_mean_pressure] = alpha_mean_pressure end - if limiter.SemiDiscEntropyLimiter + if limiter.entropy_limiter_semidiscrete @unpack alpha_mean_entropy = limiter.cache.subcell_limiter_coefficients node_variables[:alpha_mean_entropy] = alpha_mean_entropy end diff --git a/src/solvers/dgsem_tree/subcell_limiters_2d.jl b/src/solvers/dgsem_tree/subcell_limiters_2d.jl index c724ada5041..1f0f2d306d4 100644 --- a/src/solvers/dgsem_tree/subcell_limiters_2d.jl +++ b/src/solvers/dgsem_tree/subcell_limiters_2d.jl @@ -716,7 +716,7 @@ end # this method is used when the limiter is constructed as for shock-capturing volume integrals function create_cache(limiter::Type{SubcellLimiterMCL}, equations::AbstractEquations{2}, - basis::LobattoLegendreBasis, PressurePositivityLimiterKuzmin) + basis::LobattoLegendreBasis, positivity_limiter_pressure) subcell_limiter_coefficients = Trixi.ContainerSubcellLimiterMCL2D{real(basis) }(0, nvariables(equations), @@ -728,7 +728,7 @@ function create_cache(limiter::Type{SubcellLimiterMCL}, equations::AbstractEquat # Memory for bounds checking routine with `BoundsCheckCallback`. # [maximum since the last export / total maximum, min / max, variable] mcl_bounds_delta = zeros(real(basis), 2, 2, - nvariables(equations) + PressurePositivityLimiterKuzmin) + nvariables(equations) + positivity_limiter_pressure) return (; subcell_limiter_coefficients, container_bar_states, mcl_bounds_delta) end