diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index cbd7a725..35196740 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.7","generation_timestamp":"2024-12-11T19:23:53","documenter_version":"1.8.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.7","generation_timestamp":"2024-12-11T19:31:46","documenter_version":"1.8.0"}} \ No newline at end of file diff --git a/dev/changelog/index.html b/dev/changelog/index.html index eecefed7..e2cbb479 100644 --- a/dev/changelog/index.html +++ b/dev/changelog/index.html @@ -1,2 +1,2 @@ -Changelog · DispersiveShallowWater.jl

Changelog

DispersiveShallowWater.jl follows the interpretation of semantic versioning (semver) used in the Julia ecosystem. Notable changes will be documented in this file for human readability.

Changes in the v0.5 lifecycle

Added

  • Reflecting boundary conditions are added for the Svärd-Kalisch equations with alpha = gamma = 0 (#166).
  • Fix a bug in the upwind discretization of the SvärdKalischEquations1D.
  • Use OrdinaryDiffEqTsit5.jl and OrdinaryDiffEqLowStorageRK.jl instead of OrdinaryDiffEq.jl in all examples to reduce latency (#163).
  • Allow Fourier and periodic rational derivative operators for BBMBBMEquations1D and SvärdKalischEquations1D (#154).
  • Add BBMEquation1D (#150).

Changes when updating to v0.5 from v0.4.x

Changed

  • The BBMBBMVariableEquations1D were removed and BBMBBMEquations1D now supports a bathymetry_type to choose between a flat and a variable bathymetry (#147).
  • The default of bathymetry_type for the SerreGreenNaghdiEquations1D changed from bathymetry_flat to bathymetry_variable (#147).
  • bathymetry_type is now a keyword argument for all equations instead of a positional argument (#147).
  • The initial_condition_dingemans for the SerreGreenNaghdiEquations1D and HyperbolicSerreGreenNaghdiEquations1D was changed a bit to be more consistent with the other equations (#147).

Changes in the v0.4 lifecycle

Added

  • The SerreGreenNaghdiEquations1D were added for different types of bathymetry (#127, #135).
  • The HyperbolicSerreGreenNaghdiEquations1D were added for different types of bathymetry (#139).
  • The abstract interface AbstractShallowWaterEquations was added to unify several systems such as the SerreGreenNaghdiEquations1D, the BBMBBMEquations1D, and the SvärdKalischEquations1D (#127).
  • A new conversion function prim2phys was introduced, defaulting to prim2prim. prim2phys is the default conversion function for plotting.

Changes when updating to v0.4 from v0.3.x

Changed

  • Use ArrayPartition from RecursiveArrayTools.jl to store the solution of the ODEProblem (#118).

Changes in the v0.3 lifecycle

Added

  • Add possibility to pass vector of Ns to convergence_test (#113).
  • Performance improvements by using factorized matrices for linear systems solves (#108, #112, #114).
  • Reflecting boundary conditions are added for the BBM-BBM equations (#104, #109).
  • Fix for the BBMBBMVariableEquations1D, where the still water surface was neglected leading to a bug in the Dingemans setup (#91).

Changes when updating to v0.3 from v0.2.x

Changed

  • Add keyword argument start_from when plotting AnalysisCallback (#87).
  • Manufactured solution for Svärd-Kalisch equations uses a variable bathymetry (#84).

Changes in the v0.2 lifecycle

Added

  • Add SummaryCallback (#75).

Changes when updating to v0.2 from v0.1.x

Changed

  • The code from the master thesis of Joshua Lampert was separated (#69).
  • Add support for source terms (#65).
  • A higher order interpolation is used when plotting the solution at a value x outside the grid (#64).
+Changelog · DispersiveShallowWater.jl

Changelog

DispersiveShallowWater.jl follows the interpretation of semantic versioning (semver) used in the Julia ecosystem. Notable changes will be documented in this file for human readability.

Changes in the v0.5 lifecycle

Added

  • Reflecting boundary conditions are added for the Svärd-Kalisch equations with alpha = gamma = 0 (#166).
  • Fix a bug in the upwind discretization of the SvärdKalischEquations1D.
  • Use OrdinaryDiffEqTsit5.jl and OrdinaryDiffEqLowStorageRK.jl instead of OrdinaryDiffEq.jl in all examples to reduce latency (#163).
  • Allow Fourier and periodic rational derivative operators for BBMBBMEquations1D and SvärdKalischEquations1D (#154).
  • Add BBMEquation1D (#150).

Changes when updating to v0.5 from v0.4.x

Changed

  • The BBMBBMVariableEquations1D were removed and BBMBBMEquations1D now supports a bathymetry_type to choose between a flat and a variable bathymetry (#147).
  • The default of bathymetry_type for the SerreGreenNaghdiEquations1D changed from bathymetry_flat to bathymetry_variable (#147).
  • bathymetry_type is now a keyword argument for all equations instead of a positional argument (#147).
  • The initial_condition_dingemans for the SerreGreenNaghdiEquations1D and HyperbolicSerreGreenNaghdiEquations1D was changed a bit to be more consistent with the other equations (#147).

Changes in the v0.4 lifecycle

Added

  • The SerreGreenNaghdiEquations1D were added for different types of bathymetry (#127, #135).
  • The HyperbolicSerreGreenNaghdiEquations1D were added for different types of bathymetry (#139).
  • The abstract interface AbstractShallowWaterEquations was added to unify several systems such as the SerreGreenNaghdiEquations1D, the BBMBBMEquations1D, and the SvärdKalischEquations1D (#127).
  • A new conversion function prim2phys was introduced, defaulting to prim2prim. prim2phys is the default conversion function for plotting.

Changes when updating to v0.4 from v0.3.x

Changed

  • Use ArrayPartition from RecursiveArrayTools.jl to store the solution of the ODEProblem (#118).

Changes in the v0.3 lifecycle

Added

  • Add possibility to pass vector of Ns to convergence_test (#113).
  • Performance improvements by using factorized matrices for linear systems solves (#108, #112, #114).
  • Reflecting boundary conditions are added for the BBM-BBM equations (#104, #109).
  • Fix for the BBMBBMVariableEquations1D, where the still water surface was neglected leading to a bug in the Dingemans setup (#91).

Changes when updating to v0.3 from v0.2.x

Changed

  • Add keyword argument start_from when plotting AnalysisCallback (#87).
  • Manufactured solution for Svärd-Kalisch equations uses a variable bathymetry (#84).

Changes in the v0.2 lifecycle

Added

  • Add SummaryCallback (#75).

Changes when updating to v0.2 from v0.1.x

Changed

  • The code from the master thesis of Joshua Lampert was separated (#69).
  • Add support for source terms (#65).
  • A higher order interpolation is used when plotting the solution at a value x outside the grid (#64).
diff --git a/dev/changelog_tmp/index.html b/dev/changelog_tmp/index.html index e9573e86..f198ae27 100644 --- a/dev/changelog_tmp/index.html +++ b/dev/changelog_tmp/index.html @@ -1,2 +1,2 @@ -Changelog · DispersiveShallowWater.jl

Changelog

DispersiveShallowWater.jl follows the interpretation of semantic versioning (semver) used in the Julia ecosystem. Notable changes will be documented in this file for human readability.

Changes in the v0.5 lifecycle

Added

  • Reflecting boundary conditions are added for the Svärd-Kalisch equations with alpha = gamma = 0 (#166).
  • Fix a bug in the upwind discretization of the SvärdKalischEquations1D.
  • Use OrdinaryDiffEqTsit5.jl and OrdinaryDiffEqLowStorageRK.jl instead of OrdinaryDiffEq.jl in all examples to reduce latency (#163).
  • Allow Fourier and periodic rational derivative operators for BBMBBMEquations1D and SvärdKalischEquations1D (#154).
  • Add BBMEquation1D (#150).

Changes when updating to v0.5 from v0.4.x

Changed

  • The BBMBBMVariableEquations1D were removed and BBMBBMEquations1D now supports a bathymetry_type to choose between a flat and a variable bathymetry (#147).
  • The default of bathymetry_type for the SerreGreenNaghdiEquations1D changed from bathymetry_flat to bathymetry_variable (#147).
  • bathymetry_type is now a keyword argument for all equations instead of a positional argument (#147).
  • The initial_condition_dingemans for the SerreGreenNaghdiEquations1D and HyperbolicSerreGreenNaghdiEquations1D was changed a bit to be more consistent with the other equations (#147).

Changes in the v0.4 lifecycle

Added

  • The SerreGreenNaghdiEquations1D were added for different types of bathymetry (#127, #135).
  • The HyperbolicSerreGreenNaghdiEquations1D were added for different types of bathymetry (#139).
  • The abstract interface AbstractShallowWaterEquations was added to unify several systems such as the SerreGreenNaghdiEquations1D, the BBMBBMEquations1D, and the SvärdKalischEquations1D (#127).
  • A new conversion function prim2phys was introduced, defaulting to prim2prim. prim2phys is the default conversion function for plotting.

Changes when updating to v0.4 from v0.3.x

Changed

  • Use ArrayPartition from RecursiveArrayTools.jl to store the solution of the ODEProblem (#118).

Changes in the v0.3 lifecycle

Added

  • Add possibility to pass vector of Ns to convergence_test (#113).
  • Performance improvements by using factorized matrices for linear systems solves (#108, #112, #114).
  • Reflecting boundary conditions are added for the BBM-BBM equations (#104, #109).
  • Fix for the BBMBBMVariableEquations1D, where the still water surface was neglected leading to a bug in the Dingemans setup (#91).

Changes when updating to v0.3 from v0.2.x

Changed

  • Add keyword argument start_from when plotting AnalysisCallback (#87).
  • Manufactured solution for Svärd-Kalisch equations uses a variable bathymetry (#84).

Changes in the v0.2 lifecycle

Added

  • Add SummaryCallback (#75).

Changes when updating to v0.2 from v0.1.x

Changed

  • The code from the master thesis of Joshua Lampert was separated (#69).
  • Add support for source terms (#65).
  • A higher order interpolation is used when plotting the solution at a value x outside the grid (#64).
+Changelog · DispersiveShallowWater.jl

Changelog

DispersiveShallowWater.jl follows the interpretation of semantic versioning (semver) used in the Julia ecosystem. Notable changes will be documented in this file for human readability.

Changes in the v0.5 lifecycle

Added

  • Reflecting boundary conditions are added for the Svärd-Kalisch equations with alpha = gamma = 0 (#166).
  • Fix a bug in the upwind discretization of the SvärdKalischEquations1D.
  • Use OrdinaryDiffEqTsit5.jl and OrdinaryDiffEqLowStorageRK.jl instead of OrdinaryDiffEq.jl in all examples to reduce latency (#163).
  • Allow Fourier and periodic rational derivative operators for BBMBBMEquations1D and SvärdKalischEquations1D (#154).
  • Add BBMEquation1D (#150).

Changes when updating to v0.5 from v0.4.x

Changed

  • The BBMBBMVariableEquations1D were removed and BBMBBMEquations1D now supports a bathymetry_type to choose between a flat and a variable bathymetry (#147).
  • The default of bathymetry_type for the SerreGreenNaghdiEquations1D changed from bathymetry_flat to bathymetry_variable (#147).
  • bathymetry_type is now a keyword argument for all equations instead of a positional argument (#147).
  • The initial_condition_dingemans for the SerreGreenNaghdiEquations1D and HyperbolicSerreGreenNaghdiEquations1D was changed a bit to be more consistent with the other equations (#147).

Changes in the v0.4 lifecycle

Added

  • The SerreGreenNaghdiEquations1D were added for different types of bathymetry (#127, #135).
  • The HyperbolicSerreGreenNaghdiEquations1D were added for different types of bathymetry (#139).
  • The abstract interface AbstractShallowWaterEquations was added to unify several systems such as the SerreGreenNaghdiEquations1D, the BBMBBMEquations1D, and the SvärdKalischEquations1D (#127).
  • A new conversion function prim2phys was introduced, defaulting to prim2prim. prim2phys is the default conversion function for plotting.

Changes when updating to v0.4 from v0.3.x

Changed

  • Use ArrayPartition from RecursiveArrayTools.jl to store the solution of the ODEProblem (#118).

Changes in the v0.3 lifecycle

Added

  • Add possibility to pass vector of Ns to convergence_test (#113).
  • Performance improvements by using factorized matrices for linear systems solves (#108, #112, #114).
  • Reflecting boundary conditions are added for the BBM-BBM equations (#104, #109).
  • Fix for the BBMBBMVariableEquations1D, where the still water surface was neglected leading to a bug in the Dingemans setup (#91).

Changes when updating to v0.3 from v0.2.x

Changed

  • Add keyword argument start_from when plotting AnalysisCallback (#87).
  • Manufactured solution for Svärd-Kalisch equations uses a variable bathymetry (#84).

Changes in the v0.2 lifecycle

Added

  • Add SummaryCallback (#75).

Changes when updating to v0.2 from v0.1.x

Changed

  • The code from the master thesis of Joshua Lampert was separated (#69).
  • Add support for source terms (#65).
  • A higher order interpolation is used when plotting the solution at a value x outside the grid (#64).
diff --git a/dev/code_of_conduct/index.html b/dev/code_of_conduct/index.html index 6ff1d372..6a01d182 100644 --- a/dev/code_of_conduct/index.html +++ b/dev/code_of_conduct/index.html @@ -1,2 +1,2 @@ -Code of Conduct · DispersiveShallowWater.jl

Code of Conduct

Contributor Covenant Code of Conduct

Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

Our Standards

Examples of behavior that contributes to a positive environment for our community include:

  • Demonstrating empathy and kindness toward other people
  • Being respectful of differing opinions, viewpoints, and experiences
  • Giving and gracefully accepting constructive feedback
  • Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
  • Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

  • The use of sexualized language or imagery, and sexual attention or advances of any kind
  • Trolling, insulting or derogatory comments, and personal or political attacks
  • Public or private harassment
  • Publishing others' private information, such as a physical or email address, without their explicit permission
  • Other conduct which could reasonably be considered inappropriate in a professional setting

Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to Joshua Lampert or Hendrik Ranocha. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

1. Correction

Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

2. Warning

Community Impact: A violation through a single incident or series of actions.

Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

3. Temporary Ban

Community Impact: A serious violation of community standards, including sustained inappropriate behavior.

Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

4. Permanent Ban

Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

Consequence: A permanent ban from any sort of public interaction within the community.

Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0.

Community Impact Guidelines were inspired by Mozilla's code of conduct enforcement ladder.

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ. Translations are also available there.

+Code of Conduct · DispersiveShallowWater.jl

Code of Conduct

Contributor Covenant Code of Conduct

Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

Our Standards

Examples of behavior that contributes to a positive environment for our community include:

  • Demonstrating empathy and kindness toward other people
  • Being respectful of differing opinions, viewpoints, and experiences
  • Giving and gracefully accepting constructive feedback
  • Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
  • Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

  • The use of sexualized language or imagery, and sexual attention or advances of any kind
  • Trolling, insulting or derogatory comments, and personal or political attacks
  • Public or private harassment
  • Publishing others' private information, such as a physical or email address, without their explicit permission
  • Other conduct which could reasonably be considered inappropriate in a professional setting

Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to Joshua Lampert or Hendrik Ranocha. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

1. Correction

Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

2. Warning

Community Impact: A violation through a single incident or series of actions.

Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

3. Temporary Ban

Community Impact: A serious violation of community standards, including sustained inappropriate behavior.

Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

4. Permanent Ban

Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

Consequence: A permanent ban from any sort of public interaction within the community.

Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0.

Community Impact Guidelines were inspired by Mozilla's code of conduct enforcement ladder.

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ. Translations are also available there.

diff --git a/dev/contributing/index.html b/dev/contributing/index.html index ae0798fd..4a729882 100644 --- a/dev/contributing/index.html +++ b/dev/contributing/index.html @@ -35,4 +35,4 @@ are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. + this project or the open source license(s) involved. diff --git a/dev/development/index.html b/dev/development/index.html index ec5d6e3a..f5b18db3 100644 --- a/dev/development/index.html +++ b/dev/development/index.html @@ -4,4 +4,4 @@ mkdir run cd run julia --project=. -e 'using Pkg; Pkg.develop(PackageSpec(path=".."))' # Install local DispersiveShallowWater.jl clone -julia --project=. -e 'using Pkg; Pkg.add(["OrdinaryDiffEqTsit5", "Plots", "SummationByPartsOperators"])' # Install additional packages

If you use other packages for executing DispersiveShallowWater.jl, you can add them to the project in the run directory in an analogous way as above. To use the Julia project within run, be sure to start the Julia REPL by

julia --project=.

if already inside the the run directory or julia --project=run if in the main directory of the repo.

Preview of the documentation

If you want to build the documentation locally, you can run

julia --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'

once from the DispersiveShallowWater.jl main directory to tell Documenter.jl to build the documentation of your local clone. To build the documentation, run

julia --project=docs --color=yes docs/make.jl

The resulting .html files can then be found in docs/build/ and you can look at them by opening them in a browser. For pull requests from the main repository (i.e. not from a fork), the documentation is automatically built and can be previewed under https://joshualampert.github.io/DispersiveShallowWater.jl/previews/PRXXX/ where XXX is the number of the pull request.

+julia --project=. -e 'using Pkg; Pkg.add(["OrdinaryDiffEqTsit5", "Plots", "SummationByPartsOperators"])' # Install additional packages

If you use other packages for executing DispersiveShallowWater.jl, you can add them to the project in the run directory in an analogous way as above. To use the Julia project within run, be sure to start the Julia REPL by

julia --project=.

if already inside the the run directory or julia --project=run if in the main directory of the repo.

Preview of the documentation

If you want to build the documentation locally, you can run

julia --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'

once from the DispersiveShallowWater.jl main directory to tell Documenter.jl to build the documentation of your local clone. To build the documentation, run

julia --project=docs --color=yes docs/make.jl

The resulting .html files can then be found in docs/build/ and you can look at them by opening them in a browser. For pull requests from the main repository (i.e. not from a fork), the documentation is automatically built and can be previewed under https://joshualampert.github.io/DispersiveShallowWater.jl/previews/PRXXX/ where XXX is the number of the pull request.

diff --git a/dev/index.html b/dev/index.html index fb75711a..d95f316b 100644 --- a/dev/index.html +++ b/dev/index.html @@ -10,4 +10,4 @@ month={10}, howpublished={\url{https://github.com/JoshuaLampert/DispersiveShallowWater.jl}}, doi={10.5281/zenodo.10034636} -}

Authors

The package is developed and maintained by Joshua Lampert (University of Hamburg) with contributions from Hendrik Ranocha (Johannes Gutenberg University Mainz). Some parts of this repository are based on parts of Dispersive-wave-schemes-notebooks. A Broad Class of Conservative Numerical Methods for Dispersive Wave Equations by Hendrik Ranocha, Dimitrios Mitsotakis and David Ketcheson. The code structure is inspired by Trixi.jl.

License and contributing

DispersiveShallowWater.jl is published under the MIT license (see License). We are pleased to accept contributions from everyone, preferably in the form of a PR.

+}

Authors

The package is developed and maintained by Joshua Lampert (University of Hamburg) with contributions from Hendrik Ranocha (Johannes Gutenberg University Mainz). Some parts of this repository are based on parts of Dispersive-wave-schemes-notebooks. A Broad Class of Conservative Numerical Methods for Dispersive Wave Equations by Hendrik Ranocha, Dimitrios Mitsotakis and David Ketcheson. The code structure is inspired by Trixi.jl.

License and contributing

DispersiveShallowWater.jl is published under the MIT license (see License). We are pleased to accept contributions from everyone, preferably in the form of a PR.

diff --git a/dev/license/index.html b/dev/license/index.html index 1ab5d00b..89848aa8 100644 --- a/dev/license/index.html +++ b/dev/license/index.html @@ -1,2 +1,2 @@ -License · DispersiveShallowWater.jl

License

MIT License

Copyright (c) 2023-present Joshua Lampert <joshua.lampert@uni-hamburg.de> and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+License · DispersiveShallowWater.jl

License

MIT License

Copyright (c) 2023-present Joshua Lampert <joshua.lampert@uni-hamburg.de> and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/dev/objects.inv b/dev/objects.inv index 0fbfd730..ee182d1e 100644 Binary files a/dev/objects.inv and b/dev/objects.inv differ diff --git a/dev/overview/index.html b/dev/overview/index.html index 1fc57d4a..a4152d82 100644 --- a/dev/overview/index.html +++ b/dev/overview/index.html @@ -187,4 +187,4 @@ anim = @animate for step in 1:length(sol.u) plot(semi => sol, plot_initial = true, conversion = waterheight_total, step = step, xlim = (-50, 20), ylims = (-0.8, 0.1)) end -gif(anim, "shoaling_solution_dg.gif", fps = 25)
[ Info: Saved animation to /home/runner/work/DispersiveShallowWater.jl/DispersiveShallowWater.jl/docs/build/shoaling_solution_dg.gif

shoaling solution DG

For more details see also the documentation of SummationByPartsOperators.jl

Additional resources

Some more examples sorted by the simulated equations can be found in the examples/ subdirectory. Especially, in examples/svaerd_kalisch_1d/ you can find Julia scripts that solve the SvaerdKalischEquations1D that were not covered in this tutorial. The same steps as described above, however, apply in the same way to these equations. Attention must be paid for these equations because they do not conserve the classical total entropy $\mathcal E$, but a modified entropy $\hat{\mathcal E}$, available as entropy_modified.

More examples, especially focussing on plotting, can be found in the scripts create_figures.jl and plot_examples.jl from the reproducibility repository of the master thesis of Joshua Lampert.

References

+gif(anim, "shoaling_solution_dg.gif", fps = 25)
[ Info: Saved animation to /home/runner/work/DispersiveShallowWater.jl/DispersiveShallowWater.jl/docs/build/shoaling_solution_dg.gif

shoaling solution DG

For more details see also the documentation of SummationByPartsOperators.jl

Additional resources

Some more examples sorted by the simulated equations can be found in the examples/ subdirectory. Especially, in examples/svaerd_kalisch_1d/ you can find Julia scripts that solve the SvaerdKalischEquations1D that were not covered in this tutorial. The same steps as described above, however, apply in the same way to these equations. Attention must be paid for these equations because they do not conserve the classical total entropy $\mathcal E$, but a modified entropy $\hat{\mathcal E}$, available as entropy_modified.

More examples, especially focussing on plotting, can be found in the scripts create_figures.jl and plot_examples.jl from the reproducibility repository of the master thesis of Joshua Lampert.

References

diff --git a/dev/ref-trixibase/index.html b/dev/ref-trixibase/index.html index 93c19208..97bd8328 100644 --- a/dev/ref-trixibase/index.html +++ b/dev/ref-trixibase/index.html @@ -7,4 +7,4 @@ sol.t[end] end [ Info: You just called `trixi_include`. Julia may now compile the code, please be patient. -0.1source
TrixiBase.@trixi_timeitMacro
@trixi_timeit timer() "some label" expression

Basically the same as a special case of @timeit_debug from TimerOutputs.jl, but without try ... finally ... end block. Thus, it's not exception-safe, but it also avoids some related performance problems. Since we do not use exception handling in Trixi.jl, that's not really an issue.

All @trixi_timeit timings can be disabled with disable_debug_timings. The timings should then be optimized away, allowing for truly zero-overhead.

See also disable_debug_timings, enable_debug_timings.

source
+0.1source
TrixiBase.@trixi_timeitMacro
@trixi_timeit timer() "some label" expression

Basically the same as a special case of @timeit_debug from TimerOutputs.jl, but without try ... finally ... end block. Thus, it's not exception-safe, but it also avoids some related performance problems. Since we do not use exception handling in Trixi.jl, that's not really an issue.

All @trixi_timeit timings can be disabled with disable_debug_timings. The timings should then be optimized away, allowing for truly zero-overhead.

See also disable_debug_timings, enable_debug_timings.

source
diff --git a/dev/ref/index.html b/dev/ref/index.html index 80e18f71..b1753000 100644 --- a/dev/ref/index.html +++ b/dev/ref/index.html @@ -1,18 +1,18 @@ -DispersiveShallowWater · DispersiveShallowWater.jl

DispersiveShallowWater.jl API

DispersiveShallowWater.DispersiveShallowWaterModule
DispersiveShallowWater

DispersiveShallowWater.jl is a Julia package that implements structure-preserving numerical methods for dispersive shallow water models. It provides provably conservative, entropy-conserving, and well-balanced numerical schemes for some dispersive shallow water models.

The semidiscretizations are based on summation-by-parts (SBP) operators, which are implemented in SummationByPartsOperators.jl. To obtain fully discrete schemes, the time integration methods from OrdinaryDiffEq.jl are used to solve the resulting ordinary differential equations. Fully discrete entropy-conservative methods can be obtained by using the relaxation method provided by DispersiveShallowWater.jl.

See also: DispersiveShallowWater.jl

source

Equations

DispersiveShallowWater.BBMEquation1DType
BBMEquation1D(; gravity_constant, D = 1.0, eta0 = 0.0, split_form = true)

BBM (Benjamin–Bona–Mahony) equation in one spatial dimension. The equation is given by

\[\begin{aligned} +DispersiveShallowWater · DispersiveShallowWater.jl

DispersiveShallowWater.jl API

DispersiveShallowWater.DispersiveShallowWaterModule
DispersiveShallowWater

DispersiveShallowWater.jl is a Julia package that implements structure-preserving numerical methods for dispersive shallow water models. It provides provably conservative, entropy-conserving, and well-balanced numerical schemes for some dispersive shallow water models.

The semidiscretizations are based on summation-by-parts (SBP) operators, which are implemented in SummationByPartsOperators.jl. To obtain fully discrete schemes, the time integration methods from OrdinaryDiffEq.jl are used to solve the resulting ordinary differential equations. Fully discrete entropy-conservative methods can be obtained by using the relaxation method provided by DispersiveShallowWater.jl.

See also: DispersiveShallowWater.jl

source

Equations

DispersiveShallowWater.BBMEquation1DType
BBMEquation1D(; gravity_constant, D = 1.0, eta0 = 0.0, split_form = true)

BBM (Benjamin–Bona–Mahony) equation in one spatial dimension. The equation is given by

\[\begin{aligned} \eta_t + \sqrt{gD}\eta_x + \frac{3}{2}\sqrt{\frac{g}{D}}\eta\eta_x - \frac{1}{6}D^2\eta_{xxt} &= 0. -\end{aligned}\]

The unknown quantity of the BBM equation is the total water height $\eta$. The gravitational constant is denoted by g and the constant bottom topography (bathymetry) $b = \eta_0 - D$, where $\eta_0$ is the constant still-water surface and $D$ the still-water depth. The water height above the bathymetry is therefore given by $h = \eta - \eta_0 + D$. The BBM equation is only implemented for $\eta_0 = 0$.

The equations only support a flat bathymetry.

The BBM equation is first described in Benjamin, Bona, and Mahony (1972). The semidiscretization implemented here is developed in Ranocha, Mitsotakis, and Ketcheson (2020) for split_form = true and in Linders, Ranocha, and Birken (2023) for split_form = false. If split_form is true, a split form in the semidiscretization is used, which conserves

  • the total water mass (integral of $h$) as a linear invariant
  • a quadratic invariant (integral of $1/2\eta(\eta - 1/6D^2\eta_{xx})$ or for periodic boundary conditions equivalently $1/2(\eta^2 + 1/6D^2\eta_x^2)$), which is called here energy_total_modified (and entropy_modified) because it contains derivatives of the solution

for periodic boundary conditions. If split_form is false the semidiscretization conserves

  • the total water mass (integral of $h$) as a linear invariant
  • the Hamiltonian (integral of $1/4\sqrt{g/D}\eta^3 + 1/2\sqrt{gD}\eta^2$) (see hamiltonian)

for periodic boundary conditions.

  • Thomas B. Benjamin, Jerry L. Bona and John J. Mahony (1972) Model equations for long waves in nonlinear dispersive systems DOI: 10.1098/rsta.1972.0032
  • Hendrik Ranocha, Dimitrios Mitsotakis and David I. Ketcheson (2020) A Broad Class of Conservative Numerical Methods for Dispersive Wave Equations DOI: 10.4208/cicp.OA-2020-0119
  • Viktor Linders, Hendrik Ranocha and Philipp Birken (2023) Resolving entropy growth from iterative methods DOI: 10.1007/s10543-023-00992-w
source
DispersiveShallowWater.energy_total_modified!Method
energy_total_modified!(e, q_global, equations::BBMEquation1D, cache)

Return the modified total energy e of the primitive variables q_global for the BBMEquation1D. The energy_total_modified is a conserved quantity (for periodic boundary conditions).

It is given by

\[\frac{1}{2} \eta(\eta - \frac{1}{6}D^2\eta_{xx}).\]

q_global is a vector of the primitive variables at ALL nodes. cache needs to hold the SBP operators used by the solver.

See also energy_total_modified.

source
DispersiveShallowWater.hamiltonian!Method
hamiltonian!(H, q_global, equations::BBMEquation1D, cache)

Return the Hamiltonian H of the primitive variables q_global for the BBMEquation1D. The Hamiltonian is given by

\[\frac{1}{4}\sqrt{\frac{g}{D}}\eta^3 + \frac{1}{2}\sqrt{gD}\eta^2.\]

q_global is a vector of the primitive variables at ALL nodes.

See also hamiltonian.

source
DispersiveShallowWater.initial_condition_convergence_testMethod
initial_condition_convergence_test(x, t, equations::BBMEquation1D, mesh)

A travelling-wave solution used for convergence tests in a periodic domain, here generalized for dimensional variables.

See section 4.1.3 in (there is an error in paper: it should be sech^2 instead of cosh):

  • Hendrik Ranocha, Dimitrios Mitsotakis and David I. Ketcheson (2020) A Broad Class of Conservative Numerical Methods for Dispersive Wave Equations DOI: 10.4208/cicp.OA-2020-0119
source
DispersiveShallowWater.BBMBBMEquations1DType
BBMBBMEquations1D(; bathymetry_type = bathymetry_variable,
+\end{aligned}\]

The unknown quantity of the BBM equation is the total water height $\eta$. The gravitational constant is denoted by g and the constant bottom topography (bathymetry) $b = \eta_0 - D$, where $\eta_0$ is the constant still-water surface and $D$ the still-water depth. The water height above the bathymetry is therefore given by $h = \eta - \eta_0 + D$. The BBM equation is only implemented for $\eta_0 = 0$.

The equations only support a flat bathymetry.

The BBM equation is first described in Benjamin, Bona, and Mahony (1972). The semidiscretization implemented here is developed in Ranocha, Mitsotakis, and Ketcheson (2020) for split_form = true and in Linders, Ranocha, and Birken (2023) for split_form = false. If split_form is true, a split form in the semidiscretization is used, which conserves

  • the total water mass (integral of $h$) as a linear invariant
  • a quadratic invariant (integral of $1/2\eta(\eta - 1/6D^2\eta_{xx})$ or for periodic boundary conditions equivalently $1/2(\eta^2 + 1/6D^2\eta_x^2)$), which is called here energy_total_modified (and entropy_modified) because it contains derivatives of the solution

for periodic boundary conditions. If split_form is false the semidiscretization conserves

  • the total water mass (integral of $h$) as a linear invariant
  • the Hamiltonian (integral of $1/4\sqrt{g/D}\eta^3 + 1/2\sqrt{gD}\eta^2$) (see hamiltonian)

for periodic boundary conditions.

  • Thomas B. Benjamin, Jerry L. Bona and John J. Mahony (1972) Model equations for long waves in nonlinear dispersive systems DOI: 10.1098/rsta.1972.0032
  • Hendrik Ranocha, Dimitrios Mitsotakis and David I. Ketcheson (2020) A Broad Class of Conservative Numerical Methods for Dispersive Wave Equations DOI: 10.4208/cicp.OA-2020-0119
  • Viktor Linders, Hendrik Ranocha and Philipp Birken (2023) Resolving entropy growth from iterative methods DOI: 10.1007/s10543-023-00992-w
source
DispersiveShallowWater.energy_total_modified!Method
energy_total_modified!(e, q_global, equations::BBMEquation1D, cache)

Return the modified total energy e of the primitive variables q_global for the BBMEquation1D. The energy_total_modified is a conserved quantity (for periodic boundary conditions).

It is given by

\[\frac{1}{2} \eta(\eta - \frac{1}{6}D^2\eta_{xx}).\]

q_global is a vector of the primitive variables at ALL nodes. cache needs to hold the SBP operators used by the solver.

See also energy_total_modified.

source
DispersiveShallowWater.hamiltonian!Method
hamiltonian!(H, q_global, equations::BBMEquation1D, cache)

Return the Hamiltonian H of the primitive variables q_global for the BBMEquation1D. The Hamiltonian is given by

\[\frac{1}{4}\sqrt{\frac{g}{D}}\eta^3 + \frac{1}{2}\sqrt{gD}\eta^2.\]

q_global is a vector of the primitive variables at ALL nodes.

See also hamiltonian.

source
DispersiveShallowWater.initial_condition_convergence_testMethod
initial_condition_convergence_test(x, t, equations::BBMEquation1D, mesh)

A travelling-wave solution used for convergence tests in a periodic domain, here generalized for dimensional variables.

See section 4.1.3 in (there is an error in paper: it should be sech^2 instead of cosh):

  • Hendrik Ranocha, Dimitrios Mitsotakis and David I. Ketcheson (2020) A Broad Class of Conservative Numerical Methods for Dispersive Wave Equations DOI: 10.4208/cicp.OA-2020-0119
source
DispersiveShallowWater.BBMBBMEquations1DType
BBMBBMEquations1D(; bathymetry_type = bathymetry_variable,
                   gravity_constant, eta0 = 0.0)

BBM-BBM (Benjamin–Bona–Mahony) system in one spatial dimension. The equations for flat bathymetry are given by

\[\begin{aligned} \eta_t + ((\eta + D)v)_x - \frac{1}{6}D^2\eta_{xxt} &= 0,\\ v_t + g\eta_x + \left(\frac{1}{2}v^2\right)_x - \frac{1}{6}D^2v_{xxt} &= 0. \end{aligned}\]

The unknown quantities of the BBM-BBM equations are the total water height $\eta$ and the velocity $v$. The gravitational constant is denoted by g and the constant bottom topography (bathymetry) $b = \eta_0 - D$. The water height above the bathymetry is therefore given by $h = \eta - \eta_0 + D$. The BBM-BBM equations are only implemented for $\eta_0 = 0$.

Two types of bathymetry_type are supported:

For the general case of variable vathymetry the BBM-BBM equations are

\[\begin{aligned} \eta_t + ((\eta + D)v)_x - \frac{1}{6}(D^2\eta_{xt})_x &= 0,\\ v_t + g\eta_x + \left(\frac{1}{2}v^2\right)_x - \frac{1}{6}(D^2v_t)_{xx} &= 0. -\end{aligned}\]

One reference for the BBM-BBM system can be found in Bona et al. (1998). The semidiscretization implemented here was developed for flat bathymetry in Ranocha et al. (2020) and generalized for a variable bathymetry in Lampert and Ranocha (2024). It conserves

  • the total water mass (integral of $h$) as a linear invariant
  • the total velocity (integral of $v$) as a linear invariant for flat bathymetry
  • the total energy

for periodic boundary conditions (see Lampert, Ranocha). For reflecting boundary conditions, the semidiscretization conserves

  • the total water (integral of $h$) as a linear invariant
  • the total energy.

Additionally, it is well-balanced for the lake-at-rest stationary solution, see Lampert and Ranocha (2024).

  • Jerry L. Bona, Min Chen (1998) A Boussinesq system for two-way propagation of nonlinear dispersive waves DOI: 10.1016/S0167-2789(97)00249-2
  • Hendrik Ranocha, Dimitrios Mitsotakis, David I. Ketcheson (2020) A Broad Class of Conservative Numerical Methods for Dispersive Wave Equations DOI: 10.4208/cicp.OA-2020-0119
  • Joshua Lampert, Hendrik Ranocha (2024) Structure-Preserving Numerical Methods for Two Nonlinear Systems of Dispersive Wave Equations DOI: 10.48550/arXiv.2402.16669
source
DispersiveShallowWater.initial_condition_dingemansMethod
initial_condition_dingemans(x, t, equations::BBMBBMEquations1D, mesh)

The initial condition that uses the dispersion relation of the Euler equations to approximate waves generated by a wave maker as it is done by experiments of Dingemans. The topography is a trapezoidal.

Translation of water height

The initial condition for the water height is translated to be around 0, which is needed for the simulation because the BBMBBMEquations1D are only implemented for $\eta_0 = 0$.

References:

  • Magnus Svärd, Henrik Kalisch (2023) A novel energy-bounded Boussinesq model and a well-balanced and stable numerical discretization arXiv: 2302.09924
  • Maarten W. Dingemans (1994) Comparison of computations with Boussinesq-like models and laboratory measurements link
source
DispersiveShallowWater.AbstractShallowWaterEquationsType
AbstractShallowWaterEquations{NDIMS, NVARS}

An abstract supertype of all equation system that contain the classical shallow water equations as a subsystem, e.g., the BBMBBMEquations1D, the SvaerdKalischEquations1D, and the SerreGreenNaghdiEquations1D. In 1D, the shallow water equations with flat bathymetry are given by

\[\begin{aligned} +\end{aligned}\]

One reference for the BBM-BBM system can be found in Bona et al. (1998). The semidiscretization implemented here was developed for flat bathymetry in Ranocha et al. (2020) and generalized for a variable bathymetry in Lampert and Ranocha (2024). It conserves

  • the total water mass (integral of $h$) as a linear invariant
  • the total velocity (integral of $v$) as a linear invariant for flat bathymetry
  • the total energy

for periodic boundary conditions (see Lampert, Ranocha). For reflecting boundary conditions, the semidiscretization conserves

  • the total water (integral of $h$) as a linear invariant
  • the total energy.

Additionally, it is well-balanced for the lake-at-rest stationary solution, see Lampert and Ranocha (2024).

  • Jerry L. Bona, Min Chen (1998) A Boussinesq system for two-way propagation of nonlinear dispersive waves DOI: 10.1016/S0167-2789(97)00249-2
  • Hendrik Ranocha, Dimitrios Mitsotakis, David I. Ketcheson (2020) A Broad Class of Conservative Numerical Methods for Dispersive Wave Equations DOI: 10.4208/cicp.OA-2020-0119
  • Joshua Lampert, Hendrik Ranocha (2024) Structure-Preserving Numerical Methods for Two Nonlinear Systems of Dispersive Wave Equations DOI: 10.48550/arXiv.2402.16669
source
DispersiveShallowWater.initial_condition_dingemansMethod
initial_condition_dingemans(x, t, equations::BBMBBMEquations1D, mesh)

The initial condition that uses the dispersion relation of the Euler equations to approximate waves generated by a wave maker as it is done by experiments of Dingemans. The topography is a trapezoidal.

Translation of water height

The initial condition for the water height is translated to be around 0, which is needed for the simulation because the BBMBBMEquations1D are only implemented for $\eta_0 = 0$.

References:

  • Magnus Svärd, Henrik Kalisch (2023) A novel energy-bounded Boussinesq model and a well-balanced and stable numerical discretization arXiv: 2302.09924
  • Maarten W. Dingemans (1994) Comparison of computations with Boussinesq-like models and laboratory measurements link
source
DispersiveShallowWater.AbstractShallowWaterEquationsType
AbstractShallowWaterEquations{NDIMS, NVARS}

An abstract supertype of all equation system that contain the classical shallow water equations as a subsystem, e.g., the BBMBBMEquations1D, the SvaerdKalischEquations1D, and the SerreGreenNaghdiEquations1D. In 1D, the shallow water equations with flat bathymetry are given by

\[\begin{aligned} h_t + (h v)_x &= 0,\\ h v_t + \frac{1}{2} g (h^2)_x + \frac{1}{2} h (v^2)_x &= 0, -\end{aligned}\]

where $h$ is the waterheight, $v$ the velocity, and $g$ the gravity_constant.

source
DispersiveShallowWater.bathymetryMethod
bathymetry(q, equations)

Return the bathymetry of the primitive variables q for a given set of equations.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
DispersiveShallowWater.cons2primMethod
cons2prim(u, equations)

Convert the conserved variables u to the primitive variables for a given set of equations. u is a vector type of the correct length nvariables(equations). Notice the function doesn't include any error checks for the purpose of efficiency, so please make sure your input is correct. The inverse conversion is performed by prim2cons.

source
DispersiveShallowWater.eachvariableMethod
eachvariable(equations::AbstractEquations)

Return an iterator over the indices that specify the location in relevant data structures for the variables in equations. In particular, not the variables themselves are returned.

source
DispersiveShallowWater.energy_totalMethod
energy_total(q, equations)

Return the total energy of the primitive variables q for a given set of equations. For all AbstractShallowWaterEquations, the total energy is given by the sum of the kinetic and potential energy of the shallow water subsystem, i.e.,

\[\frac{1}{2} h v^2 + \frac{1}{2} g \eta^2\]

in 1D, where $h$ is the waterheight, $\eta = h + b$ the waterheight_total, $v$ the velocity, and $g$ the gravity_constant.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
DispersiveShallowWater.energy_total_modifiedMethod
energy_total_modified(q_global, equations, cache)

Return the modified total energy of the primitive variables q_global for the equations. This modified total energy is a conserved quantity and can contain additional terms compared to the usual energy_total. For example, for the SvaerdKalischEquations1D and the SerreGreenNaghdiEquations1D, it contains additional terms depending on the derivative of the velocity $v_x$ modeling non-hydrostatic contributions. For equations which are not AbstractShallowWaterEquations, the modified total energy does not have to be an extension of the usual energy_total and does not have to be related to a physical energy. However, it is still a conserved quantity for appropriate boundary conditions and may contain derivatives of the solution.

q_global is a vector of the primitive variables at ALL nodes. cache needs to hold the SBP operators used by the solver if non-hydrostatic terms are present.

Internally, this function allocates a vector for the output and calls DispersiveShallowWater.energy_total_modified!.

source
DispersiveShallowWater.get_nameMethod
get_name(equations::AbstractEquations)

Return the canonical, human-readable name for the given system of equations.

Examples

julia> DispersiveShallowWater.get_name(BBMBBMEquations1D(gravity_constant=1.0))
-"BBMBBMEquations1D-BathymetryVariable"
source
DispersiveShallowWater.hamiltonianMethod
hamiltonian(q_global, equations, cache)

Return the Hamiltonian of the primitive variables q_global for the equations. The Hamiltonian is a conserved quantity and may contain derivatives of the solution.

q_global is a vector of the primitive variables at ALL nodes. cache needs to hold the SBP operators used by the solver if non-hydrostatic terms are present.

Internally, this function allocates a vector for the output and calls DispersiveShallowWater.hamiltonian!.

Note

This function is not necessarily implemented for all equations. See DispersiveShallowWater.hamiltonian! for further details of equations supporting it.

source
DispersiveShallowWater.hyperbolic_approximation_limitMethod
DispersiveShallowWater.hyperbolic_approximation_limit(equations)

If the equations are a hyperbolic approximation of another set of equations, return the equations of the limit system. Otherwise, return the input equations.

See also is_hyperbolic_appproximation and prim2phys.

Implementation details

This function is mostly used for some internal dispatch. For example, it allows to return a reduced set of variables from initial conditions for hyperbolic approximations.

source
DispersiveShallowWater.initial_condition_dingemansMethod
initial_condition_dingemans(x, t, equations::AbstractShallowWaterEquations, mesh)

The initial condition that uses the dispersion relation of the Euler equations to approximate waves generated by a wave maker as it is done by experiments of Dingemans. The topography is a trapezoidal. It is assumed that equations.eta0 = 0.8.

References:

  • Magnus Svärd, Henrik Kalisch (2023) A novel energy-bounded Boussinesq model and a well-balanced and stable numerical discretization arXiv: 2302.09924
  • Maarten W. Dingemans (1994) Comparison of computations with Boussinesq-like models and laboratory measurements link
source
DispersiveShallowWater.initial_condition_discontinuous_well_balancednessMethod
initial_condition_discontinuous_well_balancedness(x, t, equations::AbstractShallowWaterEquations, mesh)

Setup a truly discontinuous bottom topography function for this academic lake-at-rest test case of well-balancedness, i.e. eta is constant and v is zero everywhere. The error for this lake-at-rest test case ∫|η-η₀| should be around machine roundoff.

source
DispersiveShallowWater.is_hyperbolic_appproximationMethod
DispersiveShallowWater.is_hyperbolic_appproximation(equations)

Returns Val{true}() if the equations are a hyperbolic approximation of another set of equations and Val{false}() otherwise (default). For example, the HyperbolicSerreGreenNaghdiEquations1D are a hyperbolic approximation of the SerreGreenNaghdiEquations1D.

See also hyperbolic_approximation_limit and prim2phys.

Implementation details

This function is mostly used for some internal dispatch. For example, it allows to return a reduced set of variables from initial conditions for hyperbolic approximations.

source
DispersiveShallowWater.momentumMethod
momentum(q, equations)

Return the momentum/discharge of the primitive variables q for a given set of equations, i.e., the waterheight times the velocity.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
DispersiveShallowWater.prim2consMethod
prim2cons(q, equations)

Convert the primitive variables q to the conserved variables for a given set of equations. q is a vector type of the correct length nvariables(equations). Notice the function doesn't include any error checks for the purpose of efficiency, so please make sure your input is correct. The inverse conversion is performed by cons2prim.

source
DispersiveShallowWater.prim2physMethod
prim2phys(q, equations)

Convert the primitive variables q to the physically meaningful variables for a given set of equations. By default, this is the same as prim2prim for most equations. However, some equations like the HyperbolicSerreGreenNaghdiEquations1D return a reduced set of variables since they are a hyperbolic approximation of another set of equations (in this case the SerreGreenNaghdiEquations1D).

See also is_hyperbolic_appproximation and hyperbolic_approximation_limit.

q is a vector type of the correct length nvariables(equations). Notice the function doesn't include any error checks for the purpose of efficiency, so please make sure your input is correct.

source
DispersiveShallowWater.velocityMethod
velocity(q, equations)

Return the velocity of the primitive variables q for a given set of equations.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
DispersiveShallowWater.waterheightMethod
waterheight(q, equations)

Return the waterheight of the primitive variables q for a given set of equations, i.e., the waterheight $h$ above the bathymetry $b$.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

See also waterheight_total, bathymetry.

source
DispersiveShallowWater.waterheight_totalMethod
waterheight_total(q, equations)

Return the total waterheight of the primitive variables q for a given set of equations, i.e., the waterheight $h$ plus the bathymetry $b$.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
DispersiveShallowWater.bathymetryMethod
bathymetry(q, equations)

Return the bathymetry of the primitive variables q for a given set of equations.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
DispersiveShallowWater.cons2primMethod
cons2prim(u, equations)

Convert the conserved variables u to the primitive variables for a given set of equations. u is a vector type of the correct length nvariables(equations). Notice the function doesn't include any error checks for the purpose of efficiency, so please make sure your input is correct. The inverse conversion is performed by prim2cons.

source
DispersiveShallowWater.eachvariableMethod
eachvariable(equations::AbstractEquations)

Return an iterator over the indices that specify the location in relevant data structures for the variables in equations. In particular, not the variables themselves are returned.

source
DispersiveShallowWater.energy_totalMethod
energy_total(q, equations)

Return the total energy of the primitive variables q for a given set of equations. For all AbstractShallowWaterEquations, the total energy is given by the sum of the kinetic and potential energy of the shallow water subsystem, i.e.,

\[\frac{1}{2} h v^2 + \frac{1}{2} g \eta^2\]

in 1D, where $h$ is the waterheight, $\eta = h + b$ the waterheight_total, $v$ the velocity, and $g$ the gravity_constant.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
DispersiveShallowWater.energy_total_modifiedMethod
energy_total_modified(q_global, equations, cache)

Return the modified total energy of the primitive variables q_global for the equations. This modified total energy is a conserved quantity and can contain additional terms compared to the usual energy_total. For example, for the SvaerdKalischEquations1D and the SerreGreenNaghdiEquations1D, it contains additional terms depending on the derivative of the velocity $v_x$ modeling non-hydrostatic contributions. For equations which are not AbstractShallowWaterEquations, the modified total energy does not have to be an extension of the usual energy_total and does not have to be related to a physical energy. However, it is still a conserved quantity for appropriate boundary conditions and may contain derivatives of the solution.

q_global is a vector of the primitive variables at ALL nodes. cache needs to hold the SBP operators used by the solver if non-hydrostatic terms are present.

Internally, this function allocates a vector for the output and calls DispersiveShallowWater.energy_total_modified!.

source
DispersiveShallowWater.get_nameMethod
get_name(equations::AbstractEquations)

Return the canonical, human-readable name for the given system of equations.

Examples

julia> DispersiveShallowWater.get_name(BBMBBMEquations1D(gravity_constant=1.0))
+"BBMBBMEquations1D-BathymetryVariable"
source
DispersiveShallowWater.hamiltonianMethod
hamiltonian(q_global, equations, cache)

Return the Hamiltonian of the primitive variables q_global for the equations. The Hamiltonian is a conserved quantity and may contain derivatives of the solution.

q_global is a vector of the primitive variables at ALL nodes. cache needs to hold the SBP operators used by the solver if non-hydrostatic terms are present.

Internally, this function allocates a vector for the output and calls DispersiveShallowWater.hamiltonian!.

Note

This function is not necessarily implemented for all equations. See DispersiveShallowWater.hamiltonian! for further details of equations supporting it.

source
DispersiveShallowWater.hyperbolic_approximation_limitMethod
DispersiveShallowWater.hyperbolic_approximation_limit(equations)

If the equations are a hyperbolic approximation of another set of equations, return the equations of the limit system. Otherwise, return the input equations.

See also is_hyperbolic_appproximation and prim2phys.

Implementation details

This function is mostly used for some internal dispatch. For example, it allows to return a reduced set of variables from initial conditions for hyperbolic approximations.

source
DispersiveShallowWater.initial_condition_dingemansMethod
initial_condition_dingemans(x, t, equations::AbstractShallowWaterEquations, mesh)

The initial condition that uses the dispersion relation of the Euler equations to approximate waves generated by a wave maker as it is done by experiments of Dingemans. The topography is a trapezoidal. It is assumed that equations.eta0 = 0.8.

References:

  • Magnus Svärd, Henrik Kalisch (2023) A novel energy-bounded Boussinesq model and a well-balanced and stable numerical discretization arXiv: 2302.09924
  • Maarten W. Dingemans (1994) Comparison of computations with Boussinesq-like models and laboratory measurements link
source
DispersiveShallowWater.initial_condition_discontinuous_well_balancednessMethod
initial_condition_discontinuous_well_balancedness(x, t, equations::AbstractShallowWaterEquations, mesh)

Setup a truly discontinuous bottom topography function for this academic lake-at-rest test case of well-balancedness, i.e. eta is constant and v is zero everywhere. The error for this lake-at-rest test case ∫|η-η₀| should be around machine roundoff.

source
DispersiveShallowWater.is_hyperbolic_appproximationMethod
DispersiveShallowWater.is_hyperbolic_appproximation(equations)

Returns Val{true}() if the equations are a hyperbolic approximation of another set of equations and Val{false}() otherwise (default). For example, the HyperbolicSerreGreenNaghdiEquations1D are a hyperbolic approximation of the SerreGreenNaghdiEquations1D.

See also hyperbolic_approximation_limit and prim2phys.

Implementation details

This function is mostly used for some internal dispatch. For example, it allows to return a reduced set of variables from initial conditions for hyperbolic approximations.

source
DispersiveShallowWater.momentumMethod
momentum(q, equations)

Return the momentum/discharge of the primitive variables q for a given set of equations, i.e., the waterheight times the velocity.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
DispersiveShallowWater.prim2consMethod
prim2cons(q, equations)

Convert the primitive variables q to the conserved variables for a given set of equations. q is a vector type of the correct length nvariables(equations). Notice the function doesn't include any error checks for the purpose of efficiency, so please make sure your input is correct. The inverse conversion is performed by cons2prim.

source
DispersiveShallowWater.prim2physMethod
prim2phys(q, equations)

Convert the primitive variables q to the physically meaningful variables for a given set of equations. By default, this is the same as prim2prim for most equations. However, some equations like the HyperbolicSerreGreenNaghdiEquations1D return a reduced set of variables since they are a hyperbolic approximation of another set of equations (in this case the SerreGreenNaghdiEquations1D).

See also is_hyperbolic_appproximation and hyperbolic_approximation_limit.

q is a vector type of the correct length nvariables(equations). Notice the function doesn't include any error checks for the purpose of efficiency, so please make sure your input is correct.

source
DispersiveShallowWater.velocityMethod
velocity(q, equations)

Return the velocity of the primitive variables q for a given set of equations.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
DispersiveShallowWater.waterheightMethod
waterheight(q, equations)

Return the waterheight of the primitive variables q for a given set of equations, i.e., the waterheight $h$ above the bathymetry $b$.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

See also waterheight_total, bathymetry.

source
DispersiveShallowWater.waterheight_totalMethod
waterheight_total(q, equations)

Return the total waterheight of the primitive variables q for a given set of equations, i.e., the waterheight $h$ plus the bathymetry $b$.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
DispersiveShallowWater.HyperbolicSerreGreenNaghdiEquations1DType
HyperbolicSerreGreenNaghdiEquations1D(; bathymetry_type = bathymetry_mild_slope,
                                       gravity_constant,
                                       eta0 = 0.0,
                                       lambda)

Hyperbolic approximation of the Serre-Green-Naghdi system in one spatial dimension. The equations for flat bathymetry are given by

\[\begin{aligned} @@ -28,8 +28,8 @@ + \biggl( g h + \frac{\lambda}{2} (1 - H / h) \biggr) b_x &= 0,\\ h w_t + h v w_x &= \lambda (1 - H / h),\\ H_t + H_x u + \frac{3}{2} b_x v &= w. -\end{aligned}\]

References for the hyperbolized Serre-Green-Naghdi system can be found in

  • Favrie and Gavrilyuk. A rapid numerical method for solving Serre-Green-Naghdi equations describing long free surface gravity waves DOI: 10.1088/1361-6544/aa712d
  • Busto, Dumbser, Escalante, Favrie, and Gavrilyuk. On High Order ADER Discontinuous Galerkin Schemes for First Order Hyperbolic Reformulations of Nonlinear Dispersive Systems DOI: 10.1007/s10915-021-01429-8

The semidiscretization implemented here conserves

  • the total water mass (integral of $h$) as a linear invariant
  • the total modified energy

for periodic boundary conditions (see Ranocha and Ricchiuto (2024)). Additionally, it is well-balanced for the lake-at-rest stationary solution, see

  • Hendrik Ranocha and Mario Ricchiuto (2024) Structure-preserving approximations of the Serre-Green-Naghdi equations in standard and hyperbolic form arXiv: 2408.02665
source
DispersiveShallowWater.energy_total_modified!Method
DispersiveShallowWater.energy_total_modified!(e, q_global, equations::HyperbolicSerreGreenNaghdiEquations1D, cache)

Return the modified total energy e of the primitive variables q_global for the HyperbolicSerreGreenNaghdiEquations1D. It contains additional terms compared to the usual energy_total modeling non-hydrostatic contributions. The energy_total_modified is a conserved quantity (for periodic boundary conditions).

For a bathymetry_mild_slope (and a bathymetry_flat), the total modified energy is given by

\[\frac{1}{2} g \eta^2 + \frac{1}{2} h v^2 + -\frac{1}{6} h w^2 + \frac{\lambda}{6} h (1 - \eta / h)^2.\]

q_global is a vector of the primitive variables at ALL nodes.

See also energy_total_modified.

source
DispersiveShallowWater.initial_condition_solitonMethod
initial_condition_soliton(x, t, equations::HyperbolicSerreGreenNaghdiEquations1D, mesh)

A soliton solution of the SerreGreenNaghdiEquations1D used for convergence tests in a periodic domain. This is physically the same as initial_condition_convergence_test for the SerreGreenNaghdiEquations1D. Please note that this is not an exact solution of the HyperbolicSerreGreenNaghdiEquations1D (only in the limit of the relaxation parameter $\lambda \to \infty$).

See also initial_condition_convergence_test.

source
DispersiveShallowWater.SerreGreenNaghdiEquations1DType
SerreGreenNaghdiEquations1D(; bathymetry_type = bathymetry_variable,
+\end{aligned}\]

References for the hyperbolized Serre-Green-Naghdi system can be found in

  • Favrie and Gavrilyuk. A rapid numerical method for solving Serre-Green-Naghdi equations describing long free surface gravity waves DOI: 10.1088/1361-6544/aa712d
  • Busto, Dumbser, Escalante, Favrie, and Gavrilyuk. On High Order ADER Discontinuous Galerkin Schemes for First Order Hyperbolic Reformulations of Nonlinear Dispersive Systems DOI: 10.1007/s10915-021-01429-8

The semidiscretization implemented here conserves

  • the total water mass (integral of $h$) as a linear invariant
  • the total modified energy

for periodic boundary conditions (see Ranocha and Ricchiuto (2024)). Additionally, it is well-balanced for the lake-at-rest stationary solution, see

  • Hendrik Ranocha and Mario Ricchiuto (2024) Structure-preserving approximations of the Serre-Green-Naghdi equations in standard and hyperbolic form arXiv: 2408.02665
source
DispersiveShallowWater.energy_total_modified!Method
DispersiveShallowWater.energy_total_modified!(e, q_global, equations::HyperbolicSerreGreenNaghdiEquations1D, cache)

Return the modified total energy e of the primitive variables q_global for the HyperbolicSerreGreenNaghdiEquations1D. It contains additional terms compared to the usual energy_total modeling non-hydrostatic contributions. The energy_total_modified is a conserved quantity (for periodic boundary conditions).

For a bathymetry_mild_slope (and a bathymetry_flat), the total modified energy is given by

\[\frac{1}{2} g \eta^2 + \frac{1}{2} h v^2 + +\frac{1}{6} h w^2 + \frac{\lambda}{6} h (1 - \eta / h)^2.\]

q_global is a vector of the primitive variables at ALL nodes.

See also energy_total_modified.

source
DispersiveShallowWater.initial_condition_solitonMethod
initial_condition_soliton(x, t, equations::HyperbolicSerreGreenNaghdiEquations1D, mesh)

A soliton solution of the SerreGreenNaghdiEquations1D used for convergence tests in a periodic domain. This is physically the same as initial_condition_convergence_test for the SerreGreenNaghdiEquations1D. Please note that this is not an exact solution of the HyperbolicSerreGreenNaghdiEquations1D (only in the limit of the relaxation parameter $\lambda \to \infty$).

See also initial_condition_convergence_test.

source
DispersiveShallowWater.SerreGreenNaghdiEquations1DType
SerreGreenNaghdiEquations1D(; bathymetry_type = bathymetry_variable,
                             gravity_constant, eta0 = 0.0)

Serre-Green-Naghdi system in one spatial dimension. The equations for flat bathymetry are given by

\[\begin{aligned} h_t + (h v)_x &= 0,\\ h v_t - \frac{1}{3} (h^3 v_{tx})_x + \frac{1}{2} g (h^2)_x + \frac{1}{2} h (v^2)_x + p_x &= 0,\\ @@ -49,7 +49,7 @@ p &= \frac{1}{3} h^3 v_{x}^2 - \frac{1}{3} h^3 v v_{xx} + \frac{1}{2} h^2 v (b_x v)_x,\\ \psi &= \frac{1}{4} h v (b_x v)_x. -\end{aligned}\]

References for the Serre-Green-Naghdi system can be found in

The semidiscretization implemented here conserves

  • the total water mass (integral of $h$) as a linear invariant
  • the total momentum (integral of $h v$) as a nonlinear invariant if the bathymetry is constant
  • the total modified energy

for periodic boundary conditions (see Ranocha and Ricchiuto (2024)). Additionally, it is well-balanced for the lake-at-rest stationary solution, see

  • Hendrik Ranocha and Mario Ricchiuto (2024) Structure-preserving approximations of the Serre-Green-Naghdi equations in standard and hyperbolic form arXiv: 2408.02665
source
DispersiveShallowWater.energy_total_modified!Method
DispersiveShallowWater.energy_total_modified!(e, q_global, equations::SerreGreenNaghdiEquations1D, cache)

Return the modified total energy e of the primitive variables q_global for the SerreGreenNaghdiEquations1D. It contains an additional term containing a derivative compared to the usual energy_total modeling non-hydrostatic contributions. The energy_total_modified is a conserved quantity (for periodic boundary conditions).

For a bathymetry_flat the total modified energy is given by

\[\frac{1}{2} g \eta^2 + \frac{1}{2} h v^2 + \frac{1}{6} h^3 v_x^2.\]

For a bathymetry_mild_slope the total modified energy is given by

\[\frac{1}{2} g \eta^2 + \frac{1}{2} h v^2 + \frac{1}{6} h (-h v_x + 1.5 v b_x)^2.\]

For a bathymetry_variable the total modified energy has the additional term

\[+ \frac{1}{8} h (v b_x)^2.\]

q_global is a vector of the primitive variables at ALL nodes. cache needs to hold the SBP operators used by the solver.

See also energy_total_modified.

source
DispersiveShallowWater.SvaerdKalischEquations1DType
SvaerdKalischEquations1D(; bathymetry_type = bathymetry_variable,
+\end{aligned}\]

References for the Serre-Green-Naghdi system can be found in

The semidiscretization implemented here conserves

  • the total water mass (integral of $h$) as a linear invariant
  • the total momentum (integral of $h v$) as a nonlinear invariant if the bathymetry is constant
  • the total modified energy

for periodic boundary conditions (see Ranocha and Ricchiuto (2024)). Additionally, it is well-balanced for the lake-at-rest stationary solution, see

  • Hendrik Ranocha and Mario Ricchiuto (2024) Structure-preserving approximations of the Serre-Green-Naghdi equations in standard and hyperbolic form arXiv: 2408.02665
source
DispersiveShallowWater.energy_total_modified!Method
DispersiveShallowWater.energy_total_modified!(e, q_global, equations::SerreGreenNaghdiEquations1D, cache)

Return the modified total energy e of the primitive variables q_global for the SerreGreenNaghdiEquations1D. It contains an additional term containing a derivative compared to the usual energy_total modeling non-hydrostatic contributions. The energy_total_modified is a conserved quantity (for periodic boundary conditions).

For a bathymetry_flat the total modified energy is given by

\[\frac{1}{2} g \eta^2 + \frac{1}{2} h v^2 + \frac{1}{6} h^3 v_x^2.\]

For a bathymetry_mild_slope the total modified energy is given by

\[\frac{1}{2} g \eta^2 + \frac{1}{2} h v^2 + \frac{1}{6} h (-h v_x + 1.5 v b_x)^2.\]

For a bathymetry_variable the total modified energy has the additional term

\[+ \frac{1}{8} h (v b_x)^2.\]

q_global is a vector of the primitive variables at ALL nodes. cache needs to hold the SBP operators used by the solver.

See also energy_total_modified.

source
DispersiveShallowWater.SvaerdKalischEquations1DType
SvaerdKalischEquations1D(; bathymetry_type = bathymetry_variable,
                          gravity_constant, eta0 = 0.0, alpha = 0.0,
                          beta = 0.2308939393939394, gamma = 0.04034343434343434)

Dispersive system by Svärd and Kalisch (2023) in one spatial dimension. The equations for variable bathymetry are given in conservative variables by

\[\begin{aligned} h_t + (hv)_x &= (\hat\alpha(\hat\alpha(h + b)_x)_x)_x,\\ @@ -57,14 +57,14 @@ \end{aligned}\]

where $\hat\alpha^2 = \alpha\sqrt{gD}D^2$, $\hat\beta = \beta D^3$, $\hat\gamma = \gamma\sqrt{gD}D^3$. The coefficients $\alpha$, $\beta$ and $\gamma$ are provided in dimensionless form and $D = \eta_0 - b$ is the still-water depth and eta0 is the still-water surface (lake-at-rest). The equations can be rewritten in primitive variables as

\[\begin{aligned} \eta_t + ((\eta + D)v)_x &= (\hat\alpha(\hat\alpha\eta_x)_x)_x,\\ v_t(\eta + D) - v((\eta + D)v)_x + ((\eta + D)v^2)_x + g(\eta + D)\eta_x &= (\hat\alpha v(\hat\alpha\eta_x)_x)_x - v(\hat\alpha(\hat\alpha\eta_x)_x)_x + (\hat\beta v_x)_{xt} + \frac{1}{2}(\hat\gamma v_x)_{xx} + \frac{1}{2}(\hat\gamma v_{xx})_x. -\end{aligned}\]

The unknown quantities of the Svärd-Kalisch equations are the total water height $\eta$ and the velocity $v$. The gravitational constant is denoted by g and the bottom topography (bathymetry) $b = \eta_0 - D$. The water height above the bathymetry is therefore given by $h = \eta - \eta_0 + D$.

Currently, the equations only support a general variable bathymetry, see bathymetry_variable.

SvärdKalischEquations1D is an alias for SvaerdKalischEquations1D.

The equations by Svärd and Kalisch are presented and analyzed in Svärd and Kalisch (2023). The semidiscretization implemented here conserves

  • the total water mass (integral of $h$) as a linear invariant
  • the total momentum (integral of $h v$) as a nonlinear invariant for flat bathymetry
  • the total modified energy

for periodic boundary conditions (see Lampert, Ranocha). Additionally, it is well-balanced for the lake-at-rest stationary solution, see Lampert and Ranocha (2024).

  • Magnus Svärd, Henrik Kalisch (2023) A novel energy-bounded Boussinesq model and a well-balanced and stable numerical discretization arXiv: 2302.09924
  • Joshua Lampert, Hendrik Ranocha (2024) Structure-Preserving Numerical Methods for Two Nonlinear Systems of Dispersive Wave Equations DOI: 10.48550/arXiv.2402.16669
source
DispersiveShallowWater.energy_total_modified!Method
DispersiveShallowWater.energy_total_modified!(e, q_global, equations::SvaerdKalischEquations1D, cache)

Return the modified total energy e of the primitive variables q_global for the SvaerdKalischEquations1D. It contains an additional term containing a derivative compared to the usual energy_total modeling non-hydrostatic contributions. The energy_total_modified is a conserved quantity (for periodic boundary conditions).

It is given by

\[\frac{1}{2} g \eta^2 + \frac{1}{2} h v^2 + \frac{1}{2} \hat\beta v_x^2.\]

q_global is a vector of the primitive variables at ALL nodes. cache needs to hold the SBP operators used by the solver.

See also energy_total_modified.

source

Mesh

Boundary conditions

Solver

DispersiveShallowWater.SolverMethod
Solver(mesh, accuracy_order)

Create a solver, where the summation-by-parts (SBP) operators are of order accuracy_order and associated to the mesh.

source
DispersiveShallowWater.SolverMethod
Solver(D1, D2)

Create a solver, where D1 is an AbstractDerivativeOperator from SummationByPartsOperators.jl of first derivative_order and D2 is an AbstractDerivativeOperator of second derivative_order or an AbstractMatrix. It can also be nothing if no second derivative is used by the discretization. Both summation-by-parts operators should be associated with the same grid.

source

Semidiscretization

DispersiveShallowWater.SemidiscretizationMethod
Semidiscretization(mesh, equations, initial_condition, solver;
+\end{aligned}\]

The unknown quantities of the Svärd-Kalisch equations are the total water height $\eta$ and the velocity $v$. The gravitational constant is denoted by g and the bottom topography (bathymetry) $b = \eta_0 - D$. The water height above the bathymetry is therefore given by $h = \eta - \eta_0 + D$.

Currently, the equations only support a general variable bathymetry, see bathymetry_variable.

SvärdKalischEquations1D is an alias for SvaerdKalischEquations1D.

The equations by Svärd and Kalisch are presented and analyzed in Svärd and Kalisch (2023). The semidiscretization implemented here conserves

  • the total water mass (integral of $h$) as a linear invariant
  • the total momentum (integral of $h v$) as a nonlinear invariant for flat bathymetry
  • the total modified energy

for periodic boundary conditions (see Lampert, Ranocha). Additionally, it is well-balanced for the lake-at-rest stationary solution, see Lampert and Ranocha (2024).

  • Magnus Svärd, Henrik Kalisch (2023) A novel energy-bounded Boussinesq model and a well-balanced and stable numerical discretization arXiv: 2302.09924
  • Joshua Lampert, Hendrik Ranocha (2024) Structure-Preserving Numerical Methods for Two Nonlinear Systems of Dispersive Wave Equations DOI: 10.48550/arXiv.2402.16669
source
DispersiveShallowWater.energy_total_modified!Method
DispersiveShallowWater.energy_total_modified!(e, q_global, equations::SvaerdKalischEquations1D, cache)

Return the modified total energy e of the primitive variables q_global for the SvaerdKalischEquations1D. It contains an additional term containing a derivative compared to the usual energy_total modeling non-hydrostatic contributions. The energy_total_modified is a conserved quantity (for periodic boundary conditions).

It is given by

\[\frac{1}{2} g \eta^2 + \frac{1}{2} h v^2 + \frac{1}{2} \hat\beta v_x^2.\]

q_global is a vector of the primitive variables at ALL nodes. cache needs to hold the SBP operators used by the solver.

See also energy_total_modified.

source

Mesh

Boundary conditions

Solver

DispersiveShallowWater.SolverMethod
Solver(mesh, accuracy_order)

Create a solver, where the summation-by-parts (SBP) operators are of order accuracy_order and associated to the mesh.

source
DispersiveShallowWater.SolverMethod
Solver(D1, D2)

Create a solver, where D1 is an AbstractDerivativeOperator from SummationByPartsOperators.jl of first derivative_order and D2 is an AbstractDerivativeOperator of second derivative_order or an AbstractMatrix. It can also be nothing if no second derivative is used by the discretization. Both summation-by-parts operators should be associated with the same grid.

source

Semidiscretization

DispersiveShallowWater.SemidiscretizationMethod
Semidiscretization(mesh, equations, initial_condition, solver;
                    source_terms=nothing,
                    boundary_conditions=boundary_condition_periodic,
                    RealT=real(solver),
                    uEltype=RealT,
-                   initial_cache=(tmp1 = Array{RealT}(undef, nnodes(mesh)),))

Construct a semidiscretization of a PDE.

source

Callbacks

Callbacks

DispersiveShallowWater.AnalysisCallbackType
AnalysisCallback(semi; interval=0,
                        extra_analysis_errors=Symbol[],
                        extra_analysis_integrals=(),
-                       io=stdout)

Analyze a numerical solution every interval time steps. The L2- and the L∞-norm for each component are computed by default. Additional errors can be computed, e.g. by passing extra_analysis_errors = (:conservation_error,).

Further scalar functions func in extra_analysis_integrals are applied to the numerical solution and integrated over the computational domain. Some examples for this are entropy, and energy_total. You can also write your own function with the same signature as the examples listed above and pass it via extra_analysis_integrals. The computed errors and intergrals are saved for each timestep and can be obtained by calling errors and integrals.

During the Simulation, the AnalysisCallback will print information to io.

source
DispersiveShallowWater.errorsMethod
errors(analysis_callback)

Return the computed errors for each timestep as a named tuple. The shape of each entry is (nvariables, ntimesteps).

source
DispersiveShallowWater.RelaxationCallbackType
RelaxationCallback(invariant)

Use a relaxation method in time in order to exactly preserve the (nonlinear) invariant for a conservative semidiscretization. A possible choice for invariant is invariant = entropy.

Reference

  • Hendrik Ranocha, Mohammed Sayyari, Lisandro Dalcin, Matteo Parsani, David I. Ketcheson (2020) Relaxation Runge–Kutta Methods: Fully-Discrete Explicit Entropy-Stable Schemes for the Compressible Euler and Navier–Stokes Equations DOI: 10.1137/19M1263480
source
DispersiveShallowWater.SummaryCallbackType
SummaryCallback(io::IO = stdout)

Create and return a callback that resets the timer at the beginning of a simulation and prints the timer values at the end of the simulation.

source

Utilities

DispersiveShallowWater.convergence_testMethod
convergence_test([mod::Module=Main,] example::AbstractString, iterations; io::IO = stdout, kwargs...)
-convergence_test([mod::Module=Main,] example::AbstractString, Ns::AbstractVector; io::IO = stdout, kwargs...)

Run multiple simulations using the setup given in example and compute the experimental order of convergence (EOC) in the $L^2$ and $L^\infty$ norm. If iterations is passed as integer, in each iteration, the resolution of the respective mesh will be doubled. If Ns is passed as vector, the simulations will be run for each value of Ns. Additional keyword arguments kwargs... and the optional module mod are passed directly to trixi_include.

Adjusted from Trixi.jl.

source
DispersiveShallowWater.examples_dirMethod
examples_dir()

Return the directory where the example files provided with DispersiveShallowWater.jl are located. If DispersiveShallowWater is installed as a regular package (with ]add DispersiveShallowWater), these files are read-only and should not be modified. To find out which files are available, use, e.g., readdir.

Copied from Trixi.jl.

Examples

readdir(examples_dir())
source
DispersiveShallowWater.@autoinfiltrateMacro
@autoinfiltrate
-@autoinfiltrate condition::Bool

Invoke the @infiltrate macro of the package Infiltrator.jl to create a breakpoint for ad-hoc interactive debugging in the REPL. If the optional argument condition is given, the breakpoint is only enabled if condition evaluates to true.

As opposed to using Infiltrator.@infiltrate directly, this macro does not require Infiltrator.jl to be added as a dependency to DispersiveShallowWater.jl. As a bonus, the macro will also attempt to load the Infiltrator module if it has not yet been loaded manually.

Note: For this macro to work, the Infiltrator.jl package needs to be installed in your current Julia environment stack.

See also: Infiltrator.jl

Internal use only

Please note that this macro is intended for internal use only. It is not part of the public API of DispersiveShallowWater.jl, and it thus can altered (or be removed) at any time without it being considered a breaking change.

source
+ io=stdout)

Analyze a numerical solution every interval time steps. The L2- and the L∞-norm for each component are computed by default. Additional errors can be computed, e.g. by passing extra_analysis_errors = (:conservation_error,).

Further scalar functions func in extra_analysis_integrals are applied to the numerical solution and integrated over the computational domain. Some examples for this are entropy, and energy_total. You can also write your own function with the same signature as the examples listed above and pass it via extra_analysis_integrals. The computed errors and intergrals are saved for each timestep and can be obtained by calling errors and integrals.

During the Simulation, the AnalysisCallback will print information to io.

source
DispersiveShallowWater.errorsMethod
errors(analysis_callback)

Return the computed errors for each timestep as a named tuple. The shape of each entry is (nvariables, ntimesteps).

source
DispersiveShallowWater.RelaxationCallbackType
RelaxationCallback(invariant)

Use a relaxation method in time in order to exactly preserve the (nonlinear) invariant for a conservative semidiscretization. A possible choice for invariant is invariant = entropy.

Reference

  • Hendrik Ranocha, Mohammed Sayyari, Lisandro Dalcin, Matteo Parsani, David I. Ketcheson (2020) Relaxation Runge–Kutta Methods: Fully-Discrete Explicit Entropy-Stable Schemes for the Compressible Euler and Navier–Stokes Equations DOI: 10.1137/19M1263480
source
DispersiveShallowWater.SummaryCallbackType
SummaryCallback(io::IO = stdout)

Create and return a callback that resets the timer at the beginning of a simulation and prints the timer values at the end of the simulation.

source

Utilities

DispersiveShallowWater.convergence_testMethod
convergence_test([mod::Module=Main,] example::AbstractString, iterations; io::IO = stdout, kwargs...)
+convergence_test([mod::Module=Main,] example::AbstractString, Ns::AbstractVector; io::IO = stdout, kwargs...)

Run multiple simulations using the setup given in example and compute the experimental order of convergence (EOC) in the $L^2$ and $L^\infty$ norm. If iterations is passed as integer, in each iteration, the resolution of the respective mesh will be doubled. If Ns is passed as vector, the simulations will be run for each value of Ns. Additional keyword arguments kwargs... and the optional module mod are passed directly to trixi_include.

Adjusted from Trixi.jl.

source
DispersiveShallowWater.examples_dirMethod
examples_dir()

Return the directory where the example files provided with DispersiveShallowWater.jl are located. If DispersiveShallowWater is installed as a regular package (with ]add DispersiveShallowWater), these files are read-only and should not be modified. To find out which files are available, use, e.g., readdir.

Copied from Trixi.jl.

Examples

readdir(examples_dir())
source
DispersiveShallowWater.@autoinfiltrateMacro
@autoinfiltrate
+@autoinfiltrate condition::Bool

Invoke the @infiltrate macro of the package Infiltrator.jl to create a breakpoint for ad-hoc interactive debugging in the REPL. If the optional argument condition is given, the breakpoint is only enabled if condition evaluates to true.

As opposed to using Infiltrator.@infiltrate directly, this macro does not require Infiltrator.jl to be added as a dependency to DispersiveShallowWater.jl. As a bonus, the macro will also attempt to load the Infiltrator module if it has not yet been loaded manually.

Note: For this macro to work, the Infiltrator.jl package needs to be installed in your current Julia environment stack.

See also: Infiltrator.jl

Internal use only

Please note that this macro is intended for internal use only. It is not part of the public API of DispersiveShallowWater.jl, and it thus can altered (or be removed) at any time without it being considered a breaking change.

source