Equations and Discretization
This page presents a simple example of Shallow-Water equations implementation using Tolosa-lib as a tutorial for model development.
Shallow-Water Equations
Section titled “Shallow-Water Equations”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.)
Spatial Discretization
Section titled “Spatial Discretization”The equations are discretized on unstructured meshes using a finite volume approach.
Cell-centered variables
Section titled “Cell-centered variables”- Water depth
at cell center - Velocities
at cell center
Edge-based fluxes
Section titled “Edge-based fluxes”Fluxes are computed at cell edges using numerical schemes:
where
Temporal Discretization
Section titled “Temporal Discretization”Explicit time stepping
Section titled “Explicit time stepping”Runge-Kutta schemes for time integration:
CFL Condition
Section titled “CFL Condition”Implementation Structure
Section titled “Implementation Structure”The Tolosa-lib example implements:
- Data structures using
type(msh)for mesh - Field arrays for
, , - Flux computation on edges
- Time integration with RK schemes
- Boundary conditions handling
Source Terms
Section titled “Source Terms”Bottom friction
Section titled “Bottom friction”Manning friction:
where
Coriolis force
Section titled “Coriolis force”where
Numerical Schemes Available
Section titled “Numerical Schemes Available”- Upwind schemes: First-order, robust
- MUSCL schemes: Second-order, less diffusive
- HLL solver: Riemann solver for fluxes
- Roe solver: Approximate Riemann solver
Next Steps
Section titled “Next Steps”See the following pages for implementation details:
- Initialization - Setup and data allocation
- Computation Loop - Main time-stepping loop
- Finalization - Cleanup and output