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

Add support for source terms #65

Merged
merged 17 commits into from
Nov 20, 2023
Merged

Add support for source terms #65

merged 17 commits into from
Nov 20, 2023

Conversation

JoshuaLampert
Copy link
Owner

@JoshuaLampert JoshuaLampert commented Nov 13, 2023

TODO:
BBM-BBM equations with variable bathymetry

  • fix manufactured solution
  • add test
  • proper convergence analysis

Svärd-Kalisch equations with constant baythemtry

  • add manufactured solution
  • add test
  • proper convergence analysis

@JoshuaLampert
Copy link
Owner Author

Convergence test for manufactured solution for the BBM-BBM equations with variable bathymetry:

p = 2:
julia> convergence_test("examples/bbm_bbm_variable_bathymetry_1d/bbm_bbm_variable_bathymetry_1d_manufactured.jl", 3, N = 32, accuracy_order = 2)
[...]
l2
η                        v                        D                        
N    error     EOC       N    error     EOC       N    error     EOC       
32   1.32e-02  -         32   9.64e-03  -         32   0.00e+00  -         
64   3.27e-03  2.01      64   2.40e-03  2.01      64   0.00e+00  NaN       
128  8.16e-04  2.00      128  5.99e-04  2.00      128  0.00e+00  NaN       

mean      2.01      mean      2.00      mean      NaN       
----------------------------------------------------------------------------------------------------
linf
η                        v                        D                        
N    error     EOC       N    error     EOC       N    error     EOC       
32   2.42e-02  -         32   1.61e-02  -         32   0.00e+00  -         
64   5.98e-03  2.02      64   4.01e-03  2.01      64   0.00e+00  NaN       
128  1.49e-03  2.00      128  1.00e-03  2.00      128  0.00e+00  NaN       

mean      2.01      mean      2.00      mean      NaN       
----------------------------------------------------------------------------------------------------
p = 4:
julia> convergence_test("examples/bbm_bbm_variable_bathymetry_1d/bbm_bbm_variable_bathymetry_1d_manufactured.jl", 3, N = 32, accuracy_order = 4)
[...]
l2
η                        v                        D                        
N    error     EOC       N    error     EOC       N    error     EOC       
32   1.92e-04  -         32   2.20e-04  -         32   0.00e+00  -         
64   1.21e-05  3.98      64   1.39e-05  3.99      64   0.00e+00  NaN       
128  7.60e-07  3.99      128  8.70e-07  4.00      128  0.00e+00  NaN       

mean      3.99      mean      3.99      mean      NaN       
----------------------------------------------------------------------------------------------------
linf
η                        v                        D                        
N    error     EOC       N    error     EOC       N    error     EOC       
32   2.91e-04  -         32   3.67e-04  -         32   0.00e+00  -         
64   1.87e-05  3.96      64   2.32e-05  3.98      64   0.00e+00  NaN       
128  1.17e-06  4.00      128  1.45e-06  4.00      128  0.00e+00  NaN       

mean      3.98      mean      3.99      mean      NaN       
----------------------------------------------------------------------------------------------------
p = 6:
julia> convergence_test("examples/bbm_bbm_variable_bathymetry_1d/bbm_bbm_variable_bathymetry_1d_manufactured.jl", 3, N = 16, accuracy_order = 6)
[...]
l2
η                        v                        D                        
N    error     EOC       N    error     EOC       N    error     EOC       
16   3.96e-04  -         16   3.86e-04  -         16   0.00e+00  -         
32   6.75e-06  5.87      32   6.77e-06  5.83      32   0.00e+00  NaN       
64   1.11e-07  5.93      64   1.09e-07  5.95      64   0.00e+00  NaN       

mean      5.90      mean      5.89      mean      NaN       
----------------------------------------------------------------------------------------------------
linf
η                        v                        D                        
N    error     EOC       N    error     EOC       N    error     EOC       
16   6.32e-04  -         16   7.15e-04  -         16   0.00e+00  -         
32   1.10e-05  5.84      32   1.23e-05  5.86      32   0.00e+00  NaN       
64   1.78e-07  5.95      64   2.01e-07  5.94      64   0.00e+00  NaN       

mean      5.90      mean      5.90      mean      NaN       
----------------------------------------------------------------------------------------------------

@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (68e64f4) 96.28% compared to head (617a98f) 95.21%.

Files Patch % Lines
src/equations/bbm_bbm_1d.jl 83.33% 5 Missing ⚠️
src/equations/bbm_bbm_variable_bathymetry_1d.jl 97.14% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #65      +/-   ##
==========================================
- Coverage   96.28%   95.21%   -1.07%     
==========================================
  Files          13       13              
  Lines         968     1045      +77     
==========================================
+ Hits          932      995      +63     
- Misses         36       50      +14     

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

src/equations/bbm_bbm_1d.jl Outdated Show resolved Hide resolved
src/equations/bbm_bbm_1d.jl Outdated Show resolved Hide resolved
src/equations/bbm_bbm_variable_bathymetry_1d.jl Outdated Show resolved Hide resolved
src/equations/bbm_bbm_variable_bathymetry_1d.jl Outdated Show resolved Hide resolved
@JoshuaLampert
Copy link
Owner Author

Convergence test for Svärd-Kalisch equations with constant bathymetry:

p = 2
julia> convergence_test("examples/svaerd_kalisch_1d/svaerd_kalisch_1d_manufactured.jl", 5, N = 16, accuracy_order = 2, tspan = (0.0, 0.1))
[...]
l2
η                        v                        D                        
N    error     EOC       N    error     EOC       N    error     EOC       
16   5.71e-02  -         16   3.49e-03  -         16   0.00e+00  -         
32   1.46e-02  1.97      32   8.47e-04  2.04      32   0.00e+00  NaN       
64   3.66e-03  1.99      64   2.10e-04  2.01      64   0.00e+00  NaN       
128  9.16e-04  2.00      128  5.24e-05  2.00      128  0.00e+00  NaN       
256  2.87e-04  1.68      256  1.31e-05  2.00      256  0.00e+00  NaN       

mean      1.91      mean      2.01      mean      NaN       
----------------------------------------------------------------------------------------------------
linf
η                        v                        D                        
N    error     EOC       N    error     EOC       N    error     EOC       
16   1.08e-01  -         16   5.91e-03  -         16   0.00e+00  -         
32   2.65e-02  2.03      32   1.44e-03  2.04      32   0.00e+00  NaN       
64   6.56e-03  2.01      64   3.58e-04  2.01      64   0.00e+00  NaN       
128  1.72e-03  1.93      128  8.93e-05  2.00      128  0.00e+00  NaN       
256  7.87e-04  1.13      256  2.23e-05  2.00      256  0.00e+00  NaN       

mean      1.78      mean      2.01      mean      NaN       
----------------------------------------------------------------------------------------------------
p = 4
julia> convergence_test("examples/svaerd_kalisch_1d/svaerd_kalisch_1d_manufactured.jl", 3, N = 16, accuracy_order = 4, tspan = (0.0, 0.1))
l2
η                        v                        D                        
N    error     EOC       N    error     EOC       N    error     EOC       
16   5.52e-03  -         16   1.11e-04  -         16   0.00e+00  -         
32   3.65e-04  3.92      32   7.08e-06  3.98      32   0.00e+00  NaN       
64   2.77e-05  3.72      64   4.44e-07  3.99      64   0.00e+00  NaN       

mean      3.82      mean      3.98      mean      NaN       
----------------------------------------------------------------------------------------------------
linf
η                        v                        D                        
N    error     EOC       N    error     EOC       N    error     EOC       
16   8.34e-03  -         16   1.65e-04  -         16   0.00e+00  -         
32   5.66e-04  3.88      32   1.09e-05  3.91      32   0.00e+00  NaN       
64   5.39e-05  3.39      64   6.93e-07  3.98      64   0.00e+00  NaN       

mean      3.64      mean      3.95      mean      NaN       
----------------------------------------------------------------------------------------------------
p = 6
julia> convergence_test("examples/svaerd_kalisch_1d/svaerd_kalisch_1d_manufactured.jl", 2, N = 16, accuracy_order = 6, tspan = (0.0, 0.1))
l2
η                        v                        D                        
N    error     EOC       N    error     EOC       N    error     EOC       
16   6.94e-04  -         16   9.23e-06  -         16   0.00e+00  -         
32   1.26e-05  5.79      32   1.59e-07  5.86      32   0.00e+00  NaN       

mean      5.79      mean      5.86      mean      NaN       
----------------------------------------------------------------------------------------------------
linf
η                        v                        D                        
N    error     EOC       N    error     EOC       N    error     EOC       
16   1.17e-03  -         16   1.60e-05  -         16   0.00e+00  -         
32   2.28e-05  5.68      32   2.77e-07  5.85      32   0.00e+00  NaN       

mean      5.68      mean      5.85      mean      NaN       
----------------------------------------------------------------------------------------------------

With increasing mesh refinement, the convergence order is not recovered, probably due to higher errors in the time integration. The time step restriction also seems to be really strict (adaptive time stepping chooses quite quite small time steps ~3e-4 for p = 4 and N = 64). I'll investigate time step restrictions later in a bit more detail. In principle, the manufactured solution seems to work for the Svärd-Kalisch equations with constant bathymetry. Unfortunately, I haven't been able to reconstruct a manufactured solution for the Svärd-Kalisch equations with variable bathymetry yet. I try to add a convergence test for the Svärd-Kalisch equations with variable bathymetry in a subsequent PR.

@JoshuaLampert JoshuaLampert marked this pull request as ready for review November 19, 2023 13:47
Copy link
Collaborator

@ranocha ranocha left a comment

Choose a reason for hiding this comment

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

This looks great 👍 (I didn't check the exact form of the source terms - but your results are convincing 🙂)

@JoshuaLampert JoshuaLampert merged commit a7dcc23 into main Nov 20, 2023
11 checks passed
@JoshuaLampert JoshuaLampert deleted the source-terms branch November 20, 2023 11:46
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.

3 participants