Skip to content

Equations and Discretization

This page presents a simple example of Shallow-Water equations implementation using Tolosa-lib as a tutorial for model development.

The 2D Shallow-Water equations in non-conservative form:

where:

  • is the water depth
  • is the velocity vector
  • is the gravitational acceleration
  • represents source terms (friction, Coriolis, etc.)

The equations are discretized on unstructured meshes using a finite volume approach.

  • Water depth at cell center
  • Velocities at cell center

Fluxes are computed at cell edges using numerical schemes:

where is the maximum wave speed.

Runge-Kutta schemes for time integration:

The Tolosa-lib example implements:

  1. Data structures using type(msh) for mesh
  2. Field arrays for , ,
  3. Flux computation on edges
  4. Time integration with RK schemes
  5. Boundary conditions handling

Manning friction:

where is the Manning coefficient.

where is the Coriolis parameter.

  • Upwind schemes: First-order, robust
  • MUSCL schemes: Second-order, less diffusive
  • HLL solver: Riemann solver for fluxes
  • Roe solver: Approximate Riemann solver

See the following pages for implementation details: