-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First version of tutorial for subcell IDP limiting
- Loading branch information
Showing
3 changed files
with
98 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#src # Subcell limiting with the IDP Limiter | ||
|
||
# In the previous tutorial, the element-wise limiting with [`IndicatorHennemannGassner`](@ref) | ||
# and [`VolumeIntegralShockCapturingHG`](@ref) was explained. This tutorial contains a short | ||
# introduction to the idea and implementation of subcell shock capturing approaches in Trixi.jl, | ||
# which is also based on the DGSEM scheme in flux differencing formulation. | ||
# Trixi.jl contains the a-posteriori invariant domain-preserving (IDP) limiter which was | ||
# introduced by [Rueda-Ramírez, Pazner, Gassner (2022)](https://doi.org/10.1016/j.compfluid.2022.105627) | ||
# and [Pazner (2020)](https://doi.org/10.1016/j.cma.2021.113876). It is a flux-corrected | ||
# transport-type (FCT) limiter and is implemented using [`SubcellLimiterIDP`](@ref) and | ||
# [`VolumeIntegralSubcellLimiting`](@ref). | ||
# Since it is an a-posteriori limiter you have to apply a correction stage after each Runge-Kutta | ||
# stage. This is done by passing the stage callback [`SubcellLimiterIDPCorrection`](@ref) to the | ||
# time integration method. | ||
|
||
# TODO: Some comment about the time integration method. (Don't have to be here) | ||
# - Using Trixi-intern SSPRK methods with `Trixi.solve(ode, algorithm; ...)` | ||
|
||
# TODO: Some comments about | ||
# - parameters of Newton method (max_iterations_newton = 10, newton_tolerances = (1.0e-12, 1.0e-14), gamma_constant_newton = 2 * ndims(equations))) | ||
# - positivity_correction_factor (Maybe show calculation of bounds, also of local bounds) | ||
|
||
using Trixi | ||
|
||
# # `SubcellLimiterIDP` | ||
# The IDP limiter supports several options of limiting which are passed very flexible as parameters to | ||
# the limiter individually. | ||
|
||
# ## Global bounds | ||
# First, there is the use of global bounds. If enabled, they enforce physical admissibility | ||
# conditions, such as non-negativity of variables. | ||
# This can be done for conservative variables, where the limiter is of a one-sided Zalesak-type, and | ||
# general non-linear variables, where a Newton-bisection algorithm is used to enforce the bounds. | ||
|
||
# ### Conservative variables | ||
# The procedure to enforce global bounds for a conservative variables is as follows: | ||
# If you want to guarantee non-negativity for the density of compressible Euler equations, | ||
# you pass the specific quantity name of the conservative variable. | ||
equations = CompressibleEulerEquations2D(1.4) | ||
|
||
# The quantity name of the density is `rho` shich is how we enable its limiting. | ||
positivity_variables_cons = ["rho"] | ||
|
||
# The quantity names are passed as a vector to allow several quantities. | ||
# This is for instance used if you want to limit the density of two different components using | ||
# the multicomponent compressible Euler equations. | ||
equations = CompressibleEulerMulticomponentEquations2D(gammas = (1.4, 1.648), | ||
gas_constants = (0.287, 1.578)) | ||
|
||
# Then, we just pass both quantity names. | ||
positivity_variables_cons = ["rho1", "rho2"] | ||
|
||
# Alternatively, it is possible to all limit all density variables with a general command using | ||
# ````julia | ||
# positivity_variables_cons = ["rho" * string(i) for i in eachcomponent(equations)] | ||
# ```` | ||
|
||
# ### Non-linear variables | ||
# To allow limitation for all possible non-linear variables including on-the-fly defined ones, | ||
# you directly pass function here. | ||
# For instance, if you want to enforce non-negativity for the pressure, do as follows. | ||
positivity_variables_nonlinear = [pressure] | ||
|
||
# ## Local bounds (Shock capturing) | ||
# Second, Trixi.jl supports the limiting with local bounds for conservative variables. They | ||
# allow to avoid spurious oscillations within the global bounds and to improve the | ||
# shock-capturing capabilities of the method. The corresponding numerical admissibility | ||
# conditions are frequently formulated as local maximum or minimum principles. | ||
# There are different option to choose local bounds. We calculate them using the low-order FV | ||
# solution. | ||
|
||
# As for the limiting with global bounds you are passing the quantity names of the conservative | ||
# variables you want to limit. So, to limit the density with lower and upper local bounds pass | ||
# the following. | ||
local_minmax_variables_cons = ["rho"] | ||
|
||
# ## Exemplary simulation | ||
# TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters