Surface water quality#
solver.surface2d.quality exposes 2D land-use coverage, initial buildup and
curb-length tables. Acquire it after solver.open() and edit before
initialization. The view retains its solver and becomes stale after structural
or lifecycle changes; reacquire it after adding land uses or pollutants.
CellScope selects GLOBAL, TAG or CELL. More specific rows override broader
ones at runtime. Cell indices are zero-based for both triangles and quads.
from openswmm.engine import CellScope
quality = solver.surface2d.quality
quality.set_coverage(CellScope.GLOBAL, {'URBAN': 100})
quality.set_loading(CellScope.GLOBAL, 'TSS', 10)
quality.set_loading(CellScope.TAG, 'TSS', 20, tag='PAN')
quality.set_curb_length(CellScope.GLOBAL, 25)
set_coverage replaces the entire land-use mapping at a scope. Values are
percentages; names must identify existing land uses and the engine validates
the total. Use remove_coverage(index) to clear a row. The coverages,
loadings and curb_lengths properties are immutable snapshots. Removing
a row shifts subsequent indices.
Initial loading and runtime buildup(species) use project pollutant mass per
acre/hectare. Curb length uses project length units. buildup requires an
active surface-quality kernel and returns an owned float64 array in cell order.
Changing the returned array never changes the model. The native buildup and
washoff configuration determines whether the kernel is active.
- class SurfaceCoverage(scope, tag, cell, landuses)#
Bases:
objectA whole land-use coverage set at one scope; pairs carry percentages.
- scope: CellScope#
- class SurfaceCurbLength(scope, tag, cell, length)#
Bases:
objectAuthored curb length in project length units.
- scope: CellScope#
- class SurfaceLoading(scope, tag, cell, species, value)#
Bases:
objectInitial species buildup in project mass per acre/hectare.
- scope: CellScope#
- class SurfaceQuality(owner)#
Bases:
object- Parameters:
owner (Any)
- property coverages: tuple[SurfaceCoverage, ...]#
- property curb_lengths: tuple[SurfaceCurbLength, ...]#
- property loadings: tuple[SurfaceLoading, ...]#
- set_coverage(scope, landuses, *, tag=Ellipsis, cell=Ellipsis)#
- set_curb_length(scope, length, *, tag=Ellipsis, cell=Ellipsis)#