Git Product home page Git Product logo

dispersiveshallowwater.jl's Introduction

DispersiveShallowWater.jl

Docs-stable Docs-dev Build Status codecov Coveralls Aqua QA License: MIT DOI

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

The semidiscretizations are based on summation by parts (SBP) operators, which are implemented in SummationByPartsOperators.jl. In order 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. A more detailed documentation can be found online.

Installation

If you have not yet installed Julia, then you first need to download Julia. Please follow the instructions for your operating system. DispersiveShallowWater.jl works with Julia v1.9 and newer. DispersiveShallowWater.jl is a registered Julia package. Therefore, you can install it by executing the following commands from the Julia REPL

julia> using Pkg

julia> Pkg.add(["DispersiveShallowWater", "OrdinaryDiffEq", "Plots"])

In addition, this installs the packages OrdinaryDiffEq.jl used for time-integration and Plots.jl to visualize the results. If you want to use other SBP operators than the default operators that DispersiveShallowWater.jl uses, then you also need SummationByPartsOperators.jl, which can be installed running

julia> Pkg.add("SummationByPartsOperators")

Usage

In the Julia REPL, first load the package DispersiveShallowWater.jl

julia> using DispersiveShallowWater

You can run a basic simulation that solves the BBM-BBM equations by executing

julia> include(default_example());

The result can be visualized by using the package Plots.jl

julia> using Plots
julia> plot(semi => sol)

The command plot expects a Pair consisting of a Semidiscretization and an ODESolution. The visualization can also be customized, see the documentation for more details. Other examples can be found in the subdirectory examples/. A list of all examples is returned by running get_examples(). You can pass the filename of one of the examples or your own simulation file to include in order to run it, e.g., include(joinpath(examples_dir(), "svaerd_kalisch_1d", "svaerd_kalisch_1d_dingemans_relaxation.jl")).

Referencing

You can directly refer to DispersiveShallowWater.jl as

@misc{lampert2023dispersive,
  title={{D}ispersive{S}hallow{W}ater.jl: {S}tructure-preserving numerical
         methods for dispersive shallow water models},
  author={Lampert, Joshua},
  year={2023},
  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). 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.

dispersiveshallowwater.jl's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar joshualampert avatar ranocha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ranocha josbert1

dispersiveshallowwater.jl's Issues

Semidiscretization for BBM-BBM equations with SBP variable coefficient operator

In Summation by Parts Operators for Finite Difference Approximations of Second-Derivatives with Variable Coefficients (2012) by K. Mattsson, SBP operators for second derivatives with variable coefficients have been introduced. These could be used here to use narrow-stencil SBP operators for the semidiscretization for the BBM-BBM equations with variable bathymetry. In SummationByPartsOperators.jl they are accessible by var_coef_derivative_operator and source Mattsson2012().

EDIT: SummationByPartsOperators.jl does not implement variable coefficient second-derivative SBP operators for periodic boundary conditions yet.

EDIT2: See ranocha/SummationByPartsOperators.jl#258

Why `RK4()`

I just wonder a bit why you use RK4(). It's of course fine since many people would pick it as default with fixed step size, but at least for adaptive time stepping some thing like Tsit5() should often be more efficient.

Minor bikeshedding

I found it helpful to return NamedTuples instead of separating values and names. For example, you could return a NamedTuple from integrals(analysis_callback), e.g.,

integrals(analysis_callback) = (waterheight_total = first_vector, velocity = second_vector, entropy=  third_vector)

Then, you can iterate over the pairs(integrals(analysis_callback)) for plotting

It's just an idea - your current setup works fine of course

Add `SummaryCallback`

It would be nice to have a SummaryCallback similarly to Trixi.jl that uses TimerOutputs.jl to check some timings and allocations.

Support other models

It would be nice to support other dispersive wave equations. These include especially the equations in H. Ranocha, D. Mitsotakis, D. Ketcheson, A Broad Class of Conservative Numerical Methods for Dispersive Wave Equations (2021) and the corresponding discretizations using SBP operators developed there. These include the following scalar equations with constant bottom:

  • BBM
  • Fornberg-Whitham
  • Camassa-Holm
  • Degasperis-Procesi
  • Holm-Hone

Of course the classical

  • Korteweg-de Vries (KdV) equation

would be of interest, too. Implementing these semidiscretizations should be pretty straightforward within DispersiveShallowWater.jl. Other interesting models to look at (requiring to develop energy preserving semidiscretizations using SBP operators first) would be the

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.