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

Two-layer shallow water equations #1297

Merged
merged 36 commits into from
Apr 19, 2023

Conversation

patrickersing
Copy link
Contributor

This adds an implementation for the two-layer shallow water equations with entropy conservative and entropy stable fluxes in 1D and 2D. The changes include:

  • 1D equations for Tree mesh
  • 2D equations for Tree mesh & Unstructured mesh
  • Initial condition & source terms for a manufactured solution
  • A slip-wall boundary condition (for Tree mesh in 1D & Unstructured mesh in 2D)
  • Example elixirs for convergence, well-balancedness and a dam break
  • Test files for the new features

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 am still working on my full review. But these two suggestions I believe will fix the broken tests due to the breaking changes introduced with Trixi v0.5. Is that right @ranocha ?

src/equations/shallow_water_two_layer_1d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_two_layer_2d.jl Outdated Show resolved Hide resolved
@ranocha
Copy link
Member

ranocha commented Dec 29, 2022

I am still working on my full review. But these two suggestions I believe will fix the broken tests due to the breaking changes introduced with Trixi v0.5. Is that right @ranocha ?

Yes, looks correct 👍

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.

Overall very nice work! This is a nice new set of equations to expand the capabilities of Trixi. A lot of my comments / suggestions are for cleanup of the elixirs. There are some naming conventions for the new equations that we need to decide on as well.

src/equations/shallow_water_two_layer_2d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_two_layer_2d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_two_layer_2d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_two_layer_2d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_two_layer_2d.jl Outdated Show resolved Hide resolved
@ranocha
Copy link
Member

ranocha commented Jan 11, 2023

@andrewwinters5000 Please feel free to request a review from me once your comments are addressed

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 overall! All my original comments were addressed. I left some additional comments, most of which are just spacing adjustments.

src/equations/shallow_water_two_layer_2d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_two_layer_2d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_two_layer_2d.jl Show resolved Hide resolved
src/equations/shallow_water_two_layer_2d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_two_layer_2d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_two_layer_1d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_two_layer_1d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_two_layer_1d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_two_layer_1d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_two_layer_1d.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.

LGTM! I just noted two small typos in the docstrings that need corrected. Also, @patrickersing you should add yourself to the AUTHORS.md list of contributors.

src/equations/shallow_water_two_layer_2d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_two_layer_1d.jl Outdated Show resolved Hide resolved
@sloede
Copy link
Member

sloede commented Apr 11, 2023

Does this also work for P4estMesh2D? Or is it "in general yes, but we haven't tried it yet"?

Copy link
Member

@sloede sloede 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 a not-in-super-depth review of this PR and mostly it LGTM. I've left a few comments, most of them on consistency and most of them thought as suggestions. I did not review the 1D part, but anything in 2D that affects a similar place in 1D should be considered for a change as well...

src/equations/shallow_water_two_layer_2d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_two_layer_2d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_two_layer_2d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_two_layer_2d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_two_layer_2d.jl Outdated Show resolved Hide resolved
src/equations/shallow_water_two_layer_2d.jl Show resolved Hide resolved
src/equations/shallow_water_two_layer_2d.jl Outdated Show resolved Hide resolved
@sloede
Copy link
Member

sloede commented Apr 11, 2023

Does this also work for P4estMesh2D? Or is it "in general yes, but we haven't tried it yet"?

Please let me know if I should review something more in depth or have a look at something in particular!

@andrewwinters5000
Copy link
Member

Does this also work for P4estMesh2D? Or is it "in general yes, but we haven't tried it yet"?

It could easily be adapted to work with the P4estMesh2D file format. This is not a problem. The main issue is that the AMR as it is currently implemented will not be well-balanced for these equations (neither for the original shallow water equations). The mortar projections would need to be done in a special way to allow for AMR meshes. This has been on my TODO list for sometime but I would propose it get separated to a different PR.

@sloede
Copy link
Member

sloede commented Apr 12, 2023

This has been on my TODO list for sometime but I would propose it get separated to a different PR.

Yes, that absolutely makes sense to separate from the current PR. Looking forward to review well-balanaced AMR :-)

Copy link
Member

@sloede sloede left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@sloede sloede enabled auto-merge (squash) April 12, 2023 08:02
@sloede sloede requested a review from ranocha April 12, 2023 11:25
@codecov
Copy link

codecov bot commented Apr 19, 2023

Codecov Report

Merging #1297 (f2c6c43) into main (cc2cda4) will increase coverage by 13.23%.
The diff coverage is 99.29%.

@@             Coverage Diff             @@
##             main    #1297       +/-   ##
===========================================
+ Coverage   82.75%   95.97%   +13.23%     
===========================================
  Files         344      351        +7     
  Lines       28515    29117      +602     
===========================================
+ Hits        23596    27945     +4349     
+ Misses       4919     1172     -3747     
Flag Coverage Δ
unittests 95.97% <99.29%> (+13.23%) ⬆️

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

Impacted Files Coverage Δ
src/Trixi.jl 71.43% <ø> (ø)
src/equations/equations.jl 97.87% <ø> (+4.26%) ⬆️
src/equations/shallow_water_two_layer_1d.jl 98.79% <98.79%> (ø)
src/equations/shallow_water_two_layer_2d.jl 99.38% <99.38%> (ø)
...1d_dgsem/elixir_shallowwater_twolayer_dam_break.jl 100.00% <100.00%> (ø)
...gsem/elixir_shallowwater_twolayer_well_balanced.jl 100.00% <100.00%> (ø)
...gsem/elixir_shallowwater_twolayer_well_balanced.jl 100.00% <100.00%> (ø)
...2d_dgsem/elixir_shallowwater_twolayer_dam_break.jl 100.00% <100.00%> (ø)
...gsem/elixir_shallowwater_twolayer_well_balanced.jl 100.00% <100.00%> (ø)

... and 93 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ranocha ranocha disabled auto-merge April 19, 2023 12:55
@ranocha ranocha merged commit 5e28148 into trixi-framework:main Apr 19, 2023
25 of 26 checks passed
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.

None yet

5 participants