The $0 stack for terrace hydraulics
Everything you need to go from this browser toy to a serious model of a terrace cascade. Every tool here is free and used in research, consulting or water agencies.
Python + NumPy / SciPy / Matplotlib
The lumped model behind this lab (five tanks + broad-crested weirs) is a small ODE system: write A·dh/dt = Q_in − Q_out − A(E+q) per paddy and integrate it with scipy.integrate.solve_ivp.
QGIS
Open-source GIS. Digitise terrace outlines from drone or satellite imagery, get paddy areas and terrace elevations from a DEM.
qgis.orgHEC-RAS
1-D / 2-D open-channel hydraulics with weirs, culverts and storage areas. Model the canal, the tembuku split and each paddy as a storage area linked by weirs.
hec.usace.army.milEPA SWMM
Link-node network model with storage units, weirs, orifices, evaporation and infiltration. A natural fit for a whole subak network with many terraces.
epa.gov/swmmANUGA
Open-source 2-D shallow-water solver in Python. Resolve the flow inside paddies and what happens when a bund overtops or breaches.
GitHub repoOpenFOAM
For one notch in detail: interFoam (VOF free surface) on a 2-D slice of the bund to check the weir coefficient and the velocity over the crest.
FreeCAD + Gmsh
Parametric geometry of a bund and notch (crest 5 cm, bund 15 cm), then a scriptable mesh for the CFD case.
freecad.orggmsh.infoParaView
Visualise the 2-D / 3-D results: free surface over the notch, velocity on the crest, depth maps over the terraces.
paraview.orgFrom this website to a "real" model of a subak
- Survey: QGIS on a drone orthophoto / DEM → paddy areas A, terrace drops, notch positions. Measure a few notch widths b and crest heights by hand.
- Lumped model: Python + SciPy, one ODE per paddy with the weir law
Q = C b √g H^1.5. Calibrate C against a bucket-and-stopwatch flow measurement. - Network: the same paddies as storage units + weirs in EPA SWMM or HEC-RAS, with the canal and tembuku splits upstream.
- Failures: ANUGA (2-D shallow water) for overtopping and breaches; OpenFOAM
interFoamon a single notch for crest velocities and erosion risk. - Post: ParaView or Matplotlib for h(t) curves, depth maps and velocity on the crest.