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.

replaces MATLAB

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.

python.orgnumpyscipymatplotlib
replaces ArcGIS

QGIS

Open-source GIS. Digitise terrace outlines from drone or satellite imagery, get paddy areas and terrace elevations from a DEM.

qgis.org
free (US Army Corps of Engineers)

HEC-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.mil
free (US EPA)

EPA 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/swmm
replaces commercial 2-D flood models

ANUGA

Open-source 2-D shallow-water solver in Python. Resolve the flow inside paddies and what happens when a bund overtops or breaches.

GitHub repo
replaces Fluent / CFX

OpenFOAM

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.

openfoam.com (ESI)openfoam.org (Foundation)
replaces SolidWorks / ANSYS Meshing

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.info
replaces CFD-Post / Tecplot

ParaView

Visualise the 2-D / 3-D results: free surface over the notch, velocity on the crest, depth maps over the terraces.

paraview.org

From this website to a "real" model of a subak

  1. 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.
  2. 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.
  3. Network: the same paddies as storage units + weirs in EPA SWMM or HEC-RAS, with the canal and tembuku splits upstream.
  4. Failures: ANUGA (2-D shallow water) for overtopping and breaches; OpenFOAM interFoam on a single notch for crest velocities and erosion risk.
  5. Post: ParaView or Matplotlib for h(t) curves, depth maps and velocity on the crest.
Licence note: HEC-RAS and SWMM are free public-domain software from US agencies; the rest are open source. The point isn't that commercial tools are bad. It's that you can learn, and do serious work, without paying for them.