JoshuaLampert / DispersiveShallowWater.jl

Structure-preserving numerical methods for dispersive shallow water models
https://joshualampert.github.io/DispersiveShallowWater.jl/
MIT License
15 stars 3 forks source link

Add reflecting boundary conditions for `BBMBBMVariableEquations1D` #109

Closed JoshuaLampert closed 4 months ago

JoshuaLampert commented 4 months ago

This continues the work of #104 and generalizes the semidiscretization of the BBM-BBM equations to the variable bathymetry case for both central and upwind operators. Convergence with respect to the manufactured solution looks fine (although I'm a bit wondering about the convergence of eta for p=6, where it seems like first it is of order 4 and then of order 5 while we would expect $6/2 + 1 = 4$).

p = 2: ```julia julia> convergence_test("examples/bbm_bbm_variable_bathymetry_1d/bbm_bbm_variable_bathymetry_1d_basic_reflecting.jl", 4, N = 16, accuracy_order = 2) [...] #################################################################################################### l2 η v D N error EOC N error EOC N error EOC 16 1.16e-01 - 16 2.83e-02 - 16 0.00e+00 - 32 2.65e-02 2.13 32 6.37e-03 2.15 32 0.00e+00 NaN 64 6.38e-03 2.05 64 1.53e-03 2.06 64 0.00e+00 NaN 128 1.57e-03 2.02 128 3.75e-04 2.03 128 0.00e+00 NaN mean 2.07 mean 2.08 mean NaN ---------------------------------------------------------------------------------------------------- linf η v D N error EOC N error EOC N error EOC 16 1.96e-01 - 16 6.36e-02 - 16 0.00e+00 - 32 4.62e-02 2.08 32 1.43e-02 2.15 32 0.00e+00 NaN 64 1.12e-02 2.04 64 3.46e-03 2.05 64 0.00e+00 NaN 128 2.76e-03 2.02 128 8.50e-04 2.02 128 0.00e+00 NaN mean 2.05 mean 2.07 mean NaN ---------------------------------------------------------------------------------------------------- ```
p = 4: ```julia julia> convergence_test("examples/bbm_bbm_variable_bathymetry_1d/bbm_bbm_variable_bathymetry_1d_basic_reflecting.jl", 4, N = 16, accuracy_order = 4) [...] #################################################################################################### l2 η v D N error EOC N error EOC N error EOC 16 6.03e+00 - 16 2.59e-03 - 16 0.00e+00 - 32 9.00e-01 2.74 32 1.24e-04 4.39 32 0.00e+00 NaN 64 1.15e-01 2.96 64 7.33e-06 4.08 64 0.00e+00 NaN 128 1.44e-02 3.01 128 4.47e-07 4.04 128 0.00e+00 NaN mean 2.90 mean 4.17 mean NaN ---------------------------------------------------------------------------------------------------- linf η v D N error EOC N error EOC N error EOC 16 7.71e+00 - 16 5.24e-03 - 16 0.00e+00 - 32 1.17e+00 2.72 32 2.50e-04 4.39 32 0.00e+00 NaN 64 1.52e-01 2.95 64 1.44e-05 4.12 64 0.00e+00 NaN 128 1.90e-02 3.00 128 8.46e-07 4.09 128 0.00e+00 NaN mean 2.89 mean 4.20 mean NaN ---------------------------------------------------------------------------------------------------- ```
p = 6: ```julia julia> convergence_test("examples/bbm_bbm_variable_bathymetry_1d/bbm_bbm_variable_bathymetry_1d_basic_reflecting.jl", 4, N = 16, accuracy_order = 6) [...] #################################################################################################### l2 η v D N error EOC N error EOC N error EOC 16 1.94e+01 - 16 3.69e-03 - 16 0.00e+00 - 32 1.23e+00 3.98 32 3.68e-05 6.65 32 0.00e+00 NaN 64 4.32e-02 4.83 64 5.26e-07 6.13 64 0.00e+00 NaN 128 1.35e-03 5.00 128 1.44e-08 5.20 128 0.00e+00 NaN mean 4.60 mean 5.99 mean NaN ---------------------------------------------------------------------------------------------------- linf η v D N error EOC N error EOC N error EOC 16 3.85e+01 - 16 7.61e-03 - 16 0.00e+00 - 32 2.54e+00 3.92 32 8.09e-05 6.56 32 0.00e+00 NaN 64 9.15e-02 4.80 64 2.72e-06 4.90 64 0.00e+00 NaN 128 2.89e-03 4.98 128 9.26e-08 4.88 128 0.00e+00 NaN mean 4.57 mean 5.44 mean NaN ---------------------------------------------------------------------------------------------------- ```
JoshuaLampert commented 4 months ago

Looks like we need a tolerance of 1e-7, which seems really high :confused:.

codecov[bot] commented 4 months ago

Codecov Report

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

Project coverage is 96.72%. Comparing base (338f8f8) to head (eb91b22).

Files Patch % Lines
src/equations/bbm_bbm_variable_bathymetry_1d.jl 96.96% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #109 +/- ## ========================================== + Coverage 96.71% 96.72% +0.01% ========================================== Files 17 17 Lines 1126 1192 +66 ========================================== + Hits 1089 1153 +64 - Misses 37 39 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

JoshuaLampert commented 4 months ago

GitHub Actions is doing very strange things here...Looks like the jobs didn't start, but already ran through? https://www.githubstatus.com/ is reporting no incident though.

ranocha commented 4 months ago

Weird... maybe close and re-open the PR?

JoshuaLampert commented 4 months ago

It's still not running as usually...

JoshuaLampert commented 4 months ago

No, there is a known incident with a partial outage of GitHub Actions on https://www.githubstatus.com/.

JoshuaLampert commented 4 months ago

Looks like it suddenly worked. What do you think of the following @ranocha?

Looks like we need a tolerance of 1e-7, which seems really high 😕.

ranocha commented 4 months ago

We have seen something similar in Trixi.jl for error-based step size control in OrdinaryDiffEq.jl, so I wouldn't worry too much here

JoshuaLampert commented 4 months ago

Ok, but usually tolerances like 1e-12 or 1e-11 are fine here, also with error-based step size control. So I was wondering why this test case is more vulnerable. But if you think it's fine, I'm going to merge this.