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

Davis wave speed estimate for shallow water equations #1601

Merged
merged 3 commits into from
Aug 11, 2023

Conversation

JoshuaLampert
Copy link
Member

@JoshuaLampert JoshuaLampert commented Aug 9, 2023

There are two different things I noticed related to the Davis wave speed estimate for the shallow water equations that were introduced in #1561. First, I think there is a typo for the one-dimensional SWE. The second one is a question. The PR #1561 introduced min_max_speed_davis and #1501 introduced min_max_speed_chen_noelle for the SWE, which are basically the same functions (in 1d and in 2d) except that min_max_speed_chen_noelle also has zero(eltype(u_ll)) in the min and max. Is this known and is it intended to have (almost) the same function twice or does it suffice to keep just one? If both are necessary maybe a comment would be helpful for people looking at the source and wonder about these two functions.

cc @DanielDoehring

@ranocha
Copy link
Member

ranocha commented Aug 10, 2023

Thanks for noticing this!

The PR #1561 introduced min_max_speed_davis and #1501 introduced min_max_speed_chen_noelle for the SWE, which are basically the same functions (in 1d and in 2d) except that min_max_speed_chen_noelle also has zero(eltype(u_ll)) in the min and max. Is this known and is it intended to have (almost) the same function twice or does it suffice to keep just one? If both are necessary maybe a comment would be helpful for people looking at the source and wonder about these two functions.

@DanielDoehring @andrewwinters5000?

@ranocha
Copy link
Member

ranocha commented Aug 10, 2023

I'll close and reopen this since CI fails for some weird reasons

@ranocha ranocha closed this Aug 10, 2023
@ranocha ranocha reopened this Aug 10, 2023
@andrewwinters5000
Copy link
Member

The additional zero(eltype(u)) in the min_max_speed_chen_noelle is necessary to ensure that their HLL flux is a positive Riemann solver and avoids any mass flux from a point that is deemed "dry".

In the separation of Trixi and TrixiShallowWater the routine min_max_speed_chen_noelle is planned to move, so it makes sense to keep both it and min_max_speed_davis. As with the compressible Euler equations, there is a whole cottage industry of wave speed estimates for the shallow water eqautions. A fairly good study is given by J. P. Vila.

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.

Good catch on the typo! Once the tests run we will see if any reference values need updated. But for now I will approve this.

@ranocha ranocha enabled auto-merge (squash) August 10, 2023 06:35
@codecov
Copy link

codecov bot commented Aug 10, 2023

Codecov Report

Merging #1601 (f65bd5d) into main (ce81702) will increase coverage by 3.23%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1601      +/-   ##
==========================================
+ Coverage   92.90%   96.13%   +3.23%     
==========================================
  Files         402      402              
  Lines       33034    33091      +57     
==========================================
+ Hits        30690    31812    +1122     
+ Misses       2344     1279    -1065     
Flag Coverage Δ
unittests 96.13% <100.00%> (+3.23%) ⬆️

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

Files Changed Coverage Δ
src/equations/shallow_water_1d.jl 100.00% <100.00%> (ø)

... and 40 files with indirect coverage changes

@DanielDoehring
Copy link
Contributor

DanielDoehring commented Aug 10, 2023

There are two different things I noticed related to the Davis wave speed estimate for the shallow water equations that were introduced in #1561. First, I think there is a typo for the one-dimensional SWE.

Absolutely correct, sorry for that - I thought I double checked everything.

The second one is a question. The PR #1561 introduced min_max_speed_davis and #1501 introduced min_max_speed_chen_noelle for the SWE, which are basically the same functions (in 1d and in 2d) except that min_max_speed_chen_noelle also has zero(eltype(u_ll)) in the min and max. Is this known and is it intended to have (almost) the same function twice or does it suffice to keep just one? If both are necessary maybe a comment would be helpful for people looking at the source and wonder about these two functions.

I just had a very brief look at the paper - from that, it appears to me that their numerical flux is equivalent to HLL-Davis.

The standard HLL flux with checking directionality of the speeds is given by

$$ \boldsymbol F = \begin{cases} \boldsymbol f(\boldsymbol u_-) & s_- \geq 0 \\ \boldsymbol f^\star(\boldsymbol u_-, \boldsymbol u_+) & s_- < 0 < s_+ \\ \boldsymbol f(\boldsymbol u_+) & s_+ \leq 0 \end{cases}$$

where the intermediate flux $\boldsymbol f^\star(\boldsymbol u_-, \boldsymbol u_+)$ is given by

$$ \boldsymbol f^\star(\boldsymbol u_-, \boldsymbol u_+) = \frac{s_+ \boldsymbol f(\boldsymbol u_-) - s_- \boldsymbol f(\boldsymbol u_+) + s_+s_i \left(\boldsymbol u_+ - \boldsymbol u_-\right)}{s_+ - s_i} $$

By enhancing the usual definition of the wavespeeds as done by Chen & Noelle, you can basically spare yourself from the case computation and always use $\boldsymbol f^\star$.

@ranocha ranocha disabled auto-merge August 11, 2023 07:44
@ranocha ranocha merged commit 68df09d into trixi-framework:main Aug 11, 2023
4 checks passed
@JoshuaLampert JoshuaLampert deleted the wave-speed-estimate-swe branch August 11, 2023 07:54
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.

None yet

4 participants