amerta: A Python Library for 1D Idealized Saint-Venant Dam-Break Simulation
Model
The Saint-Venant (shallow water) equations in conservative form on a horizontal, frictionless bed:
Mass conservation: ∂ₜh + ∂ₓ(hu) = 0
Momentum conservation: ∂ₜ(hu) + ∂ₓ(hu² + ½gh²) = 0
Canonical Riemann Problems
| Case | State | Wave Structure |
|---|---|---|
| 1. Stoker | Wet–wet | Left rarefaction + right shock |
| 2. Ritter | Wet–dry | Single rarefaction, dry front |
| 3. Double Rarefaction | Diverging | Two rarefactions |
| 4. Double Shock | Converging | Two shocks |
Numerical Method
- MUSCL reconstruction (minmod slope limiter, 2nd-order spatial)
- HLLC approximate Riemann solver (Roe-averaged wave speeds)
- SSP-RK2 strong-stability-preserving time integration (Shu & Osher 1988)
- Adaptive CFL-limited time step with positivity preservation
- Numba JIT acceleration with parallel
prangesweeps
Installation
pip install amerta
Quick Start
CLI:
amerta case1 # Stoker wet dam break
amerta case2 # Ritter dry dam break
amerta case3 # Double rarefaction
amerta case4 # Double shock
amerta --all # Run all four cases
Python API:
from amerta_sv import SaintVenantSolver, get_case
from amerta_sv.io import ConfigManager, DataHandler
from amerta_sv.core.analytical import compute_analytical, fill_error_norms
cfg = ConfigManager.validate_config({
**get_case('stoker'),
'nx': 500, 'cfl': 0.9, 'g': 9.81, 't_final': 80.0,
'h_left': 10.0, 'h_right': 2.0, 'L': 2000.0,
'scenario_name': 'stoker', 'case_type': 'stoker'
})
solver = SaintVenantSolver(nthreads=8, verbose=True)
result = solver.solve(cfg)
an = compute_analytical('stoker', cfg, result['x'], result['t_all'])
fill_error_norms(an, result['h_all'], result['u_all'], result['dx'],
q_num=result['q_all']) # pass q_all for best accuracy
print(f"L1(h) at t_final = {an['l1_h'][-1]:.4e} m")
print(f"L1(q) at t_final = {an['l1_q'][-1]:.4e} m2/s")
print(f"L1(u_wet) at t_final = {an['l1_u_wet'][-1]:.4e} m/s")
Output Files
For each case, amerta generates:
<case>.nc— CF-1.8 NetCDF4, full trajectory at every timestep including all error norms<case>_metrics.csv— scalar diagnosticscomparison_metrics.csv— side-by-side comparison across all runs<case>_time_evolution.png,<case>_physical.png,<case>_numerical.png<case>.gif— animated evolution
Dependencies
numpy ≥ 1.20, scipy ≥ 1.7, matplotlib ≥ 3.3, netCDF4 ≥ 1.5, numba ≥ 0.53, pandas ≥ 1.3, pillow ≥ 8.0, tqdm ≥ 4.60
License
MIT 2026 © Dasapta E. Irawan, Sandy H. S. Herho, Iwan P. Anwar, Faruq Khadami, Astyka Pamumpuni, Rendy D. Kartiko, Edi Riawan, Rusmawan Suwarman, and Deny J. Puradimaja
Citation
@software{irawanEtAl2026_amerta,
title = {{\texttt{amerta}: A Python library for 1D idealized Saint-Venant dam-break simulation}},
author = {Irawan, Dasapta E. and Herho, Sandy H. S. and Anwar, Iwan P. and
Khadami, Faruq and Pamumpuni, Astyka and Kartiko, Rendy D. and
Riawan, Edi and Suwarman, Rusmawan and Puradimaja, Deny J.},
year = {2026},
version = {0.0.3},
url = {https://github.com/sandyherho/amerta}
}
Metadata
Release files for amerta 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| amerta-0.0.3.tar.gz | 21.2 kB | Without provenance | Details for amerta-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| amerta-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for amerta-0.0.3-py3-none-any.whl |
Total release size: 45.6 kB
Release files / amerta-0.0.3.tar.gz
| Download URL | amerta-0.0.3.tar.gz |
|---|---|
| Size | 21.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
172a0c424d25cd3749a1697c4f0236408a9d6e9373023e0960576437aa0cc1a3
|
|
BLAKE2b-256 checksum How to use checksums |
64104541b5cfaca9269ee41ca01cac657bfa2ccfa6a105d6c3a8fbbba962a2e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.2 CPython/3.11.7 Linux/5.15.0-173-generic
|
Release files / amerta-0.0.3-py3-none-any.whl
| Download URL | amerta-0.0.3-py3-none-any.whl |
|---|---|
| Size | 24.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b6c6b733d8547ad5a8870f4d8740b9dfa3b14f862e83943899bf311b1fd2253e
|
|
BLAKE2b-256 checksum How to use checksums |
7ec028afba0324f95547c689ee8c66ef2e930fcd2a9ec361dc0423d59804df1b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.2 CPython/3.11.7 Linux/5.15.0-173-generic
|
Security for amerta 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.