-
Notifications
You must be signed in to change notification settings - Fork 126
WIB: Subcell limiting with IDP and MCL approach #1502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This is currently the newest and most complete version of Subcell Limiting. The different limiters are briefly mentioned above. In addition, there are some smaller TODOs, but they don't have much to do with the first (already existing) IDP positivity limiter #1476. For this one, I would only add the implementation of the antidiffusive stage as a stage callback. This allows other stage callbacks in the future (as the BoundsCheck routine or possible IMEX-type-Methods for Multi-Ion simulations, @amrueda is thinking about). So the question. Do we keep the current structure with its own volume integral |
Can you elaborate a little bit? That is, what are the alternatives and what are the pros/cons for the various approaches? |
I personally think that the current structure is not bad. Rn we need some dispatches to distinguish between An alternative would be a custom solver for the subcell limiting. I think this strict distinction would lead to more confusion than to advantages (if there are any at all). Especially after the changes from the last week, where one is very flexible and can also run Elixirs without limiting with the implemented SSPRK algorithm. |
I have to revise myself a bit. Due to the fact that we partly use limiters based on the so-called bar states, we need the boundary condition and the current time within the volume integral for their calculation. This could not really be solved by a separate solver, but the problem would then only exist there. |
I don't see this additional dispatch in the current PR? Is there a third PR coming? Also, it would be great to clarify the relationship between #1476 and this one here. |
As I said, some limiter uses the bar states to calculate the bounds. The positivity limiting of IDP limiting (as included in the current PR) does not require the bar states. That's why I omitted it for now. I thought it would be the best to divide this big PR into many small ones and started with the positivity limiter. When it is merged, there are some smaller PRs with simple additional routines. In total, there will be many more to come. I will add an overview over the PR's relationships in the description. Hopefully this makes it clearer. |
Ah, never mind, I had looked at this in the wrong way, and I now found the relevant sections where the From a first look, the Thus, for now I tend to lean towards keeping it as a super-special volume integral but to move everything IDP/MCL-related to a new file |
Yeah, I know, that's heavy. Maybe it would be better to remove it from the volume integral. But then, we would have an additional function somewhere.
I wasn't sure if it all made sense in the current location anyway. So, I think it's a good idea. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1502 +/- ##
==========================================
- Coverage 95.18% 88.02% -7.16%
==========================================
Files 512 536 +24
Lines 42388 44492 +2104
==========================================
- Hits 40345 39163 -1182
- Misses 2043 5329 +3286
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
So, finally we had our discussion yesterday about the naming issue. To summarize the results, I think we could agree on the names Additionally, I will add all possible remarks (in the documentation and the code itself) for IDP limiting, to clarify that Is everyone happy with this or does anyone have any other suggestions? @sloede @ranocha @amrueda @gregorgassner @andrewwinters5000 @jlchan |
I was thinking about the reordering of the subcell limiting code. First, of course, the new limiters can't stay in An alternative would be an additional folder I prefer the current option. What do you think @sloede @ranocha? Maybe it would be useful to discuss this as well. Possibly in a smaller round. |
ff380dd
to
6c095a8
Compare
Implement variable_bounds as Dict
…ative systems -> A working version of this implementation is added for the GLM-MHD system -> The flux-differencing formula requires non-conservative terms of the form (local * symmetric)... I modified equations/ideal_glm_mhd_2d.jl and solvers/dgsem_tree/dg_2d.jl to make it work -> In this first implementation, we only use the Powell term and deactivate the GLM term
…2d.jl back to its original state
…he modified Powell source term. This was needed due to incompatibility on non-conforming meshes.
Make sure I adapted everything correctly.
In this discussion, I thought that I could easily remove When such a function is called within a simulation using a
Since the function header of There is already an issue about the interface of |
* Add tests for alpha analysis * Add comments; Fix two tests * Fix test * Update alpha tests * Rm not needed code * Simplify test
* Merge main * Fix time step calculation * Remove testing without coverage * Fix tests
* Simplify pure_and_blended_elements... * Clean up
The Downstream tests of Trixi2Vtk.jl are failing for the subcell cases (using elixir: |
It seems that |
Ähm, the coefficient should still be exported. But now you need to add I looked at it again, and actually I'm more surprised that the tests were working before than that they aren't right now because here we are using a different setup in the regarding elixir (see here). |
I see. I missed that... I only noticed that I could not visualize the limiting coefficient of my simulations and thought that this could be related to the failing Trixi2Vtk downstream tests that you observed. |
* Fixed bug in the semi-discrete entropy limiter and added elixirs to test it * Added back the absolute values to avoid rounding errors and divisions by 0 * Add comments for explanation * Update comments * Adapt tests * Adapt tests * Remove Inf testing again * Set up tests --------- Co-authored-by: bennibolm <benjamin.bolm@gmx.de>
* Small fix * Clean up * Fix dimension of container * Small fix * Set bar_states to false in new elixir
* Merge main * Fix elixir
This PR includes the complete implementation of subcell limiting methods (IDP and MCL). The volume integral
VolumeIntegralSubcellLimiting
is used. This contains the following features:IDP Limiting:
SubcellLimiterIDP
(uses stage callbackSubcellLimiterIDPCorrection
)local_twosided_variables_cons
positivity_variables_cons
andpositivity_variables_nonlinear
local_onesided_variables_nonlinear
MCL:
SubcellLimiterMCL
density_limiter
: Local maximum/minimum limiter forcons(1)
density_coefficient_for_all
: Applycons(1)
blending coefficient for all quantitiessequential_limiter
: Local maximum/minimum for variablesphi:=cons(i)/cons(1)
for i in 2:nvariablesconservative_limiter
: Local maximum/minimum for conservative variables 2:nvariablespositivity_limiter_pressure
: Positivity limiter for pressure à la Kuzmin. (Sharp version withpositivity_limiter_pressure_exact=true
positivity_limiter_density
: Positivity limiter forcons(1)
entropy_limiter_semidiscrete
: Semi-discrete entropy fixAdditional features:
IndicatorHennemannGassner
(hard switch)TODOs:
StructuredMesh
density_tvd
for arbitrary conservative variables (Generalizing two-sided state limiting for conservative variables bennibolm/Trixi.jl#112)resize!(semi, nelements)
to allow using Time Integrations methods by OrdinaryDiffEq for MCL(?):- Possible at end of
semidisretize
?- in Elixirs before
solve
function?snake_case
dg_2d_subcell_limiters.jl
,subcell_limiters(_2d).jl
? Issue:dg_2d
andindicators_2d
file much longer than before. -> Created specific files for subcell limiter codevariable_bounds
asDict
? Saves a lot of messy stuff. Subcell limiting: Revise order of bounds using aDict
#1649create_cache()
type stable when askingif bar_sates ... end
?Plotting
variable: Keeping, deleting, renaming?subcell-limiting
bennibolm/Trixi.jl#121