Skip to content
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

Add a Lax-Friedrichs-type entropy-stable dissipation operator and its specialization for multi-ion MHD #2204

Merged
merged 18 commits into from
Dec 18, 2024

Conversation

amrueda
Copy link
Contributor

@amrueda amrueda commented Dec 11, 2024

This PR adds an entropy-stable dissipation operator DissipationLaxFriedrichsEntropyVariables and its specialization for multi-ion MHD.

Copy link
Contributor

Review checklist

This checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging.

Purpose and scope

  • The PR has a single goal that is clear from the PR title and/or description.
  • All code changes represent a single set of modifications that logically belong together.
  • No more than 500 lines of code are changed or there is no obvious way to split the PR into multiple PRs.

Code quality

  • The code can be understood easily.
  • Newly introduced names for variables etc. are self-descriptive and consistent with existing naming conventions.
  • There are no redundancies that can be removed by simple modularization/refactoring.
  • There are no leftover debug statements or commented code sections.
  • The code adheres to our conventions and style guide, and to the Julia guidelines.

Documentation

  • New functions and types are documented with a docstring or top-level comment.
  • Relevant publications are referenced in docstrings (see example for formatting).
  • Inline comments are used to document longer or unusual code sections.
  • Comments describe intent ("why?") and not just functionality ("what?").
  • If the PR introduces a significant change or new feature, it is documented in NEWS.md with its PR number.

Testing

  • The PR passes all tests.
  • New or modified lines of code are covered by tests.
  • New or modified tests run in less then 10 seconds.

Performance

  • There are no type instabilities or memory allocations in performance-critical parts.
  • If the PR intent is to improve performance, before/after time measurements are posted in the PR.

Verification

  • The correctness of the code was verified using appropriate tests.
  • If new equations/methods are added, a convergence test has been run and the results
    are posted in the PR.

Created with ❤️ by the Trixi.jl community.

@amrueda amrueda marked this pull request as draft December 11, 2024 19:41
@amrueda amrueda marked this pull request as ready for review December 11, 2024 19:54
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.36%. Comparing base (d01e4a7) to head (c98006f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2204      +/-   ##
==========================================
+ Coverage   96.35%   96.36%   +0.01%     
==========================================
  Files         485      485              
  Lines       38974    39075     +101     
==========================================
+ Hits        37553    37654     +101     
  Misses       1421     1421              
Flag Coverage Δ
unittests 96.36% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ranocha ranocha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not check the math

examples/tree_2d_dgsem/elixir_mhdmultiion_ec.jl Outdated Show resolved Hide resolved
Copy link
Member

@andrewwinters5000 andrewwinters5000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like adding the generic wrapper for an ES dissipation term. I just posed a few questions and comments regarding the multi-ion version.

src/equations/ideal_glm_mhd_multiion.jl Outdated Show resolved Hide resolved
src/equations/ideal_glm_mhd_multiion.jl Outdated Show resolved Hide resolved
src/equations/ideal_glm_mhd_multiion.jl Outdated Show resolved Hide resolved
src/equations/ideal_glm_mhd_multiion.jl Outdated Show resolved Hide resolved
src/equations/ideal_glm_mhd_multiion.jl Outdated Show resolved Hide resolved
Copy link
Member

@andrewwinters5000 andrewwinters5000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @amrueda ! The new comments are very helpful. I just left one small suggestion.

src/equations/ideal_glm_mhd_multiion.jl Outdated Show resolved Hide resolved
Copy link
Contributor

@DanielDoehring DanielDoehring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool stuff, I added some minor comments/suggestions regarding documentation.

@amrueda amrueda force-pushed the arr/dissipation_entropy_stable branch from 4024f3d to 9918a67 Compare December 16, 2024 19:12
Copy link
Member

@andrewwinters5000 andrewwinters5000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I already left a comment with my two cents in the discussion about documentation for flux_ec.

@jlchan
Copy link
Contributor

jlchan commented Dec 17, 2024

From the Trixi Zoom meeting discussion - what about DissipationEntropyVariables?

@DanielDoehring
Copy link
Contributor

From the Trixi Zoom meeting discussion - what about DissipationEntropyVariables?

Maybe we also make use of abstract types and define an AbstractDissipationEntropyStable if that makes some functions more elegant.

@ranocha
Copy link
Member

ranocha commented Dec 17, 2024

As discussed: Dissipation at the beginning, something like Scalar should be included to clarify what it is doing

@jlchan
Copy link
Contributor

jlchan commented Dec 17, 2024

Maybe we also make use of abstract types and define an AbstractDissipationEntropyStable if that makes some functions more elegant.

Sure, that sounds nice as well, but I was just trying to suggest a precise name with minimal additional changes.

Since this dissipation is scalar (not a matrix dissipation in the sense of Roe, etc) and uses jumps of the entropy variables as opposed to conservative variables, maybe ScalarDissipationEntropyVariables?

@amrueda
Copy link
Contributor Author

amrueda commented Dec 17, 2024

What about DissipationLaxFriedrichsEntropyVariables? While the name is a bit long, it clearly conveys the key aspects: it is a Lax-Friedrichs-type dissipation that uses the jump in entropy variables.

I think the use of the term "scalar" might be confusing for some users, as this flux can be used with non-scalar equations.

I am not suggesting DissipationLocalLaxFriedrichsEntropyVariables, even though it would be more consistent with the existing DissipationLocalLaxFriedrichs and DissipationGlobalLaxFriedrichs. That name feels unnecessarily long. Moreover, one can still apply a global Lax-Friedrichs strategy by prescribing a constant maximum wave speed with this flux.

@amrueda amrueda changed the title Add entropy-stable dissipation operator Add a Lax-Friedrichs-type entropy-stable dissipation operator and its specialization for multi-ion MHD Dec 17, 2024
src/equations/numerical_fluxes.jl Outdated Show resolved Hide resolved
src/equations/numerical_fluxes.jl Outdated Show resolved Hide resolved
src/equations/numerical_fluxes.jl Outdated Show resolved Hide resolved
src/equations/numerical_fluxes.jl Outdated Show resolved Hide resolved
amrueda and others added 2 commits December 18, 2024 12:26
DanielDoehring
DanielDoehring previously approved these changes Dec 18, 2024
src/equations/numerical_fluxes.jl Outdated Show resolved Hide resolved
src/equations/ideal_glm_mhd_multiion.jl Outdated Show resolved Hide resolved
Copy link
Member

@JoshuaLampert JoshuaLampert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@amrueda amrueda enabled auto-merge (squash) December 18, 2024 13:45
@amrueda amrueda merged commit 1f31fd4 into main Dec 18, 2024
39 of 40 checks passed
@amrueda amrueda deleted the arr/dissipation_entropy_stable branch December 18, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants