-
Notifications
You must be signed in to change notification settings - Fork 112
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
WIB: Subcell limiting with IDP and MCL approach #1502
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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1502 +/- ##
==========================================
- Coverage 96.36% 96.30% -0.06%
==========================================
Files 477 500 +23
Lines 37753 39791 +2038
==========================================
+ Hits 36378 38319 +1941
- Misses 1375 1472 +97
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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. |
* Merge main (first version) * Fix bug * Fix setup in tutorial * Adapt tests * Add bar_states variable to unit test * fmt
* Add structured mesh support * Fix non-periodic computation of bounds * Use local limiting and nonperiodic domain in source terms elixir * Use local limiting in free stream elixir * Remove not needed lines * Remove P4estMesh * Add non-periodic tests with local bounds * fmt * Fix test * Use `get_inverse_jacobian` instead of dispatching all routines * Simplify `perform_idp_correction!` * Revert stuff * Remove free stream elixir * Use sedov blast instead of source term setup; add news * Update dispatching for mesh types * Remove dispatching for mesh types * Move new sedov tests within the test file * Move new tests within test file * Adapt dispatching * Fix typo * Remove not-needed parameter * Add subcell limiting support for StructuredMesh (trixi-framework#1946) * Add structured mesh support * Fix non-periodic computation of bounds * Use local limiting and nonperiodic domain in source terms elixir * Use local limiting in free stream elixir * Remove not needed lines * Remove P4estMesh * Add non-periodic tests with local bounds * fmt * Fix test * Use `get_inverse_jacobian` instead of dispatching all routines * Simplify `perform_idp_correction!` * Revert stuff * Remove free stream elixir * Use sedov blast instead of source term setup; add news * Update dispatching for mesh types * Move new tests within test file * Adapt dispatching * Fix typo * Remove not-needed parameters * Dispatch `check_bounds` for dimension using u
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
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