Skip to content

Add inlet/outlet BCs for the 2D-SWE#91

Merged
andrewwinters5000 merged 24 commits intotrixi-framework:mainfrom
patrickersing:geostrophic_adjustment
May 6, 2025
Merged

Add inlet/outlet BCs for the 2D-SWE#91
andrewwinters5000 merged 24 commits intotrixi-framework:mainfrom
patrickersing:geostrophic_adjustment

Conversation

@patrickersing
Copy link
Copy Markdown
Member

@patrickersing patrickersing commented Apr 28, 2025

This PR implements inlet/outlet boundary conditions for the ShallowWaterEquationsWetDry2D.
The new boundary conditions BoundaryConditionWaterHeight and BoundaryConditionMomentum specify the water height or the momentum on the boundary and extrapolate the remaining quantity from the Riemann Invariant.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 28, 2025

Codecov Report

Attention: Patch coverage is 98.04688% with 5 lines in your changes missing coverage. Please review.

Project coverage is 99.23%. Comparing base (009d14e) to head (d3fd8ff).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...dgsem/elixir_shallowwater_moving_water_subsonic.jl 88.00% 3 Missing ⚠️
...1d_dgsem/elixir_shallowwater_moving_water_shock.jl 97.06% 1 Missing ⚠️
...gsem/elixir_shallowwater_moving_water_transonic.jl 96.67% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #91      +/-   ##
==========================================
- Coverage   99.33%   99.23%   -0.10%     
==========================================
  Files          66       71       +5     
  Lines        3115     3370     +255     
==========================================
+ Hits         3094     3344     +250     
- Misses         21       26       +5     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@patrickersing patrickersing changed the title [WIP] Add inlet/outlet BCs with a fixed momentum or water height [WIP] Add inlet/outlet BCs for the 2D-SWE Apr 28, 2025
@patrickersing patrickersing changed the title [WIP] Add inlet/outlet BCs for the 2D-SWE Add inlet/outlet BCs for the 2D-SWE Apr 29, 2025
@patrickersing patrickersing marked this pull request as ready for review April 29, 2025 09:01
Copy link
Copy Markdown
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 for adding this flexible boundary condition capability! It should work directly in 1D, right? It would be good to add an example elixir on TreeMesh if that is the case.

@patrickersing
Copy link
Copy Markdown
Member Author

Thanks for adding this flexible boundary condition capability! It should work directly in 1D, right? It would be good to add an example elixir on TreeMesh if that is the case.

@andrewwinters5000 Yes, this should directly carry over to the 1D case. I only need to implement the boundary condition functions in ShallowWaterEquationsWetDry1D. I was planning to split this off into a separate PR, but I can of course also add this directly here.

@patrickersing patrickersing added the enhancement New feature or request label Apr 29, 2025
@patrickersing
Copy link
Copy Markdown
Member Author

There are some uncovered lines from the inverse_transform functions included in the elixirs. I would either keep it as it is and accept the uncovered lines, since they only occur in the elixir, or move the inverse_transform function to the shallow_water_equations_wet_dry.1d and add proper tests. However, since the function will only be used for these steady-state setups I am not sure if it makes sense to add the function to the code.

Copy link
Copy Markdown
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.

Looks very nice, I just left some comments mainly regarding coding style.

Copy link
Copy Markdown
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!

@andrewwinters5000
Copy link
Copy Markdown
Member

There are some uncovered lines from the inverse_transform functions included in the elixirs. I would either keep it as it is and accept the uncovered lines, since they only occur in the elixir, or move the inverse_transform function to the shallow_water_equations_wet_dry.1d and add proper tests. However, since the function will only be used for these steady-state setups I am not sure if it makes sense to add the function to the code.

I agree that it makes more sense to leave the function definition of inverse_transform in the elixirs where it is needed for these special test case setups. Also, losing the (very) small coverage percentage is warranted in this case.

@andrewwinters5000 andrewwinters5000 merged commit 464ac24 into trixi-framework:main May 6, 2025
18 of 21 checks passed
@patrickersing patrickersing deleted the geostrophic_adjustment branch May 6, 2025 08:20
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