Skip to content

trixi-framework/TrixiShallowWater.jl

Repository files navigation

TrixiShallowWater.jl

Stable Dev Slack Build Status Coverage Coverage License: MIT DOI

TrixiShallowWater.jl is a numerical simulation package focused on solving shallow water equations with the discontinuous Galerkin method and written in Julia. The package builds on the numerical simulation framework for conservation laws Trixi.jl and provides several specialized models and features specific for shallow water applications. Below is a short summary of the available features:

  • 1D and 2D simulations on line/quad meshes
    • Cartesian and curvilinear meshes
    • Conforming and non-conforming meshes
    • Hierarchical quadtree meshes with adaptive mesh refinement
  • High-order accuracy in space and time
  • Shallow water capabilities
    • Wetting and drying
    • Multi-layer flows
    • Sediment transport via an Exner model

Installation

If you have not yet installed Julia, please follow the instructions for your operating system. TrixiShallowWater.jl works with Julia v1.10 and newer. We recommend using the latest stable release of Julia.

For users

TrixiShallowWater.jl and its related tools are registered Julia packages. Hence, you can install TrixiShallowWater.jl, the numerical solver framework Trixi.jl, visualization tools Trixi2Vtk.jl, and Plots.jl as well as relevant time integration sub-packages of OrdinaryDiffEq.jl, by executing the following commands in the Julia REPL:

julia> using Pkg

julia> Pkg.add(["TrixiShallowWater", "Trixi", "Trixi2Vtk", "Plots",
                "OrdinaryDiffEqLowStorageRK", "OrdinaryDiffEqSSPRK"])

You can copy and paste all commands to the REPL including the leading julia> prompts - they will automatically be stripped away by Julia. The package OrdinaryDiffEq.jl and its sub-packages provide time integration schemes used by TrixiShallowWater.jl, while Plots.jl can be used to directly visualize TrixiShallowWater.jl's results from the REPL.

For developers

If you plan on editing TrixiShallowWater.jl itself, you can download TrixiShallowWater.jl locally and use the code from the cloned directory:

git clone [email protected]:trixi-framework/TrixiShallowWater.jl.git
cd TrixiShallowWater.jl
mkdir run
cd run
julia --project=. -e 'using Pkg; Pkg.develop(PackageSpec(path=".."))' # Install local TrixiShallowWater.jl clone
julia --project=. -e 'using Pkg; Pkg.add(["Trixi", "OrdinaryDiffEqLowStorageRK", "OrdinaryDiffEqSSPRK", "Trixi2Vtk", "Plots"])' # Install additional packages

Note that the postprocessing tools Trixi2Vtk.jl and Plots.jl are optional and can be omitted.

If you installed TrixiShallowWater.jl this way, you always have to start Julia with the --project flag set to your run directory, e.g.,

julia --project=.

if already inside the run directory. Further details, of how to develop TrixiShallowWater.jl together with a local clone Trixi.jl, can be found in the Development section of the documentation.

Authors

TrixiShallowWater.jl is maintained by the Trixi authors. Its principal developers are Andrew Winters (Linköping University, Sweden) and Patrick Ersing (Linköping University, Sweden). The full list of contributors can be found in AUTHORS.md.

License and contributing

TrixiShallowWater.jl is licensed under the MIT license (see LICENSE.md). Since TrixiShallowWater.jl is an open-source project, we are very happy to accept contributions from the community. To get in touch with the developers, join us on Slack or create an issue.

Acknowledgments

This project has benefited from funding from Vetenskapsrådet (VR, Swedish Research Council), Sweden through the VR Starting Grant "Shallow water flows including sediment transport and morphodynamics", VR grant agreement 2020-03642 VR.