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

[WIP] Add 1D multilayer shallow water equations #30

Merged
merged 16 commits into from
Apr 2, 2024

Conversation

patrickersing
Copy link
Contributor

@patrickersing patrickersing commented Mar 18, 2024

This PR will add the 1D multilayer shallow water equations, which are a generalization of the currently implemented two-layer shallow water equations for an arbitrary amount of layers. The implementation employs a specific formulation of the system with a nonconservative pressure term.

The implementation is done similar to the multicomponent equations in Trixi.jl with some modifications, to account for the layer-wise structure.

Additional tests:

  • Well-balanced tests
  • Convergence testing for more than two layers
  • Application tests

Additional functionality:

  • Add ES fluxes
  • Add additional analysis functions (lake_at_rest_error, energy_total, etc.)

@patrickersing patrickersing added the enhancement New feature or request label Mar 18, 2024
Copy link

codecov bot commented Mar 18, 2024

Codecov Report

Attention: Patch coverage is 98.19005% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 99.22%. Comparing base (cbabd75) to head (54b0f18).

Files Patch % Lines
src/equations/equations.jl 50.00% 2 Missing ⚠️
src/equations/shallow_water_multilayer_1d.jl 98.96% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #30      +/-   ##
==========================================
- Coverage   99.38%   99.22%   -0.16%     
==========================================
  Files          40       45       +5     
  Lines        1459     1680     +221     
==========================================
+ Hits         1450     1667     +217     
- Misses          9       13       +4     

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

@patrickersing
Copy link
Contributor Author

Here are some convergence results for elixir_shallowwater_multilayer_convergence.jl with
polydeg=3:

Screenshot from 2024-03-21 11-06-27

polydeg=4:

Screenshot from 2024-03-21 11-06-18

polydeg=5:

Screenshot from 2024-03-21 11-06-05

@andrewwinters5000
Copy link
Member

Here are some convergence results for elixir_shallowwater_multilayer_convergence.jl

These results all seem reasonable. Are these all with the EC scheme? It is a bit strange that the h1 and h1v tend to converge with polydeg+1/2 whereas the other layers tend more toward polydeg+1.

@patrickersing
Copy link
Contributor Author

Yes, all the results were obtained with the EC flux. The trend remains roughly the same when I test with flux_lax_friedrichs, here e.g. for polydeg=3

Screenshot from 2024-03-21 13-49-26

In most cases it seems that convergence for layer 2 is better than for layers 1 & 3 (even above the expected convergence order), but I don't have an explanation why that is.

@patrickersing patrickersing marked this pull request as ready for review March 21, 2024 13:14
@andrewwinters5000
Copy link
Member

It is quite strange that the "sandwiched" layer converges with slightly higher order than the other layers. It is also weird that the convergence of h2_v and h3_v are both higher than expected because you are setting the velocities to be constants. So I would assume that the convergence behavior of h3_v would match that of h (for instance)

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.

Nice work @patrickersing ! It is very cool that we can have an entropy stable scheme on an arbitrary number of layers. This abstraction should also make it easier to do the mullti-layer wetting and drying. I left a few comments and questions.

src/equations/equations.jl Show resolved Hide resolved
test/test_tree_1d.jl Show resolved Hide resolved
src/equations/shallow_water_multilayer_1d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_multilayer_1d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_multilayer_1d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_multilayer_1d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_multilayer_1d.jl 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.

LGTM! Although I still cannot work out why some functions are not reported as covered when they should be.

@andrewwinters5000 andrewwinters5000 merged commit 35126fb into trixi-framework:main Apr 2, 2024
6 of 9 checks passed
@patrickersing patrickersing deleted the ml_swe branch April 2, 2024 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants