Link
Source-generated reference for link configuration, controls, results, and statistics. See Configure a model, Runtime forcings, and Collect results for workflows.
Link
Owner-bound link from simulation.links.get(id). No public subtype subclasses.
Reads are detached; configuration is available in healthy states. Wrong-kind
operations reject without changing the model. Statistics require an active run.
Properties
id
Canonical configured link ID.
Methods
results()
Read hydraulics in running, complete, or ended.
Returns
Promise<LinkResults>
Detached current link results.
configuration()
Read common and kind-specific declarations in any healthy owner state.
Returns
Promise<LinkConfiguration>
Detached configuration, including cross-section and optional inlet.
configure()
Atomically update declarations in open or ended; accepted writes return ended to open.
Parameters
| Parameter | Type | Description |
|---|---|---|
patch |
LinkPatch |
Sparse common/subtype fields; invalid fields or a wrong-kind subtype reject the whole patch. |
Returns
Promise<void>
Resolves after all fields are accepted.
setTargetSetting()
Change the target opening or pump speed in running; native control rules may change it later.
Parameters
| Parameter | Type | Description |
|---|---|---|
setting |
number |
Finite dimensionless factor. Non-pumps clamp to [0, 1]; pumps clamp at zero and may exceed one. |
Returns
Promise<void>
Resolves after setting the target.
setFlowLimit()
Set a persistent flow limit in open, running, or ended.
Parameters
| Parameter | Type | Description |
|---|---|---|
flowLimit |
number |
Limit in project flow units. |
Returns
Promise<void>
Resolves after the forcing is updated.
quality()
Read quality in running, complete, or ended.
Returns
Promise<LinkQuality>
Detached pollutant-aligned concentrations and transported loads.
overridePollutantConcentrations()
Queue sparse overrides for the next quality step in running; they expire after that step.
Parameters
| Parameter | Type | Description |
|---|---|---|
values |
Record<string, number> |
Pollutant-ID concentration map in configured concentration units. |
Returns
Promise<void>
Resolves after valid IDs and concentrations are queued.
externalPollutantMassFlux()
Read persistent pollutant mass fluxes in open, running, or ended.
Returns
Promise<Record<string, number>>
Pollutant-ID map in configured mass-flux units.
externalPollutantMassFluxValue()
Read one persistent mass flux in open, running, or ended.
Parameters
| Parameter | Type | Description |
|---|---|---|
pollutantId |
string |
Configured pollutant ID. |
Returns
Promise<number>
Value in configured pollutant mass-flux units; unknown IDs reject.
updateExternalPollutantMassFlux()
Update persistent mass fluxes in open, running, or ended.
Nonzero flux requires a non-dummy conduit; other kinds accept only an all-zero clear.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
values |
Record<string, number> |
undefined |
Pollutant-ID map in configured mass-flux units. |
replace |
boolean |
false |
Defaults to false: merge. True replaces the whole map, resetting omitted IDs to zero. |
Returns
Promise<void>
Resolves after the atomic update.
statistics()
Read cumulative statistics in running or complete, before ending the run.
Returns
Promise<LinkStatistics>
Detached link statistics.
pumpStatistics()
Read pump-only cumulative statistics in running or complete.
Returns
Promise<PumpStatistics>
Detached pump statistics; non-pump calls reject.
inlet()
Read the inlet placement in any healthy owner state.
Returns
Promise<InletConfiguration | null>
Detached inlet configuration, or null when absent.
inletResults()
Read inlet results in running, complete, or ended.
Returns
Promise<InletResults | null>
Detached current inlet values, or null when no inlet is configured.
updateInlet()
Update persistent inlet controls in open, running, or ended.
Parameters
| Parameter | Type | Description |
|---|---|---|
patch |
InletPatch |
Sparse clogging percentage and/or flow limit; omission retains a value. |
Returns
Promise<void>
Resolves after the update is accepted.
FunctionalOutletRating
Power-law outlet rating in native project head/flow units.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
kind |
readonly |
"functional" |
Power-law rating discriminator. |
coefficient |
readonly |
number |
Discharge coefficient in the rating's native units. |
exponent |
readonly |
number |
Head/depth exponent. |
headBasis |
readonly |
OutletHeadBasis |
Whether the rating uses depth or head difference. |
TabularOutletRating
Curve-based outlet rating using a configured curve identity.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
kind |
readonly |
"tabular" |
Curve-based rating discriminator. |
curve |
readonly |
string |
Canonical rating-curve ID. |
headBasis |
readonly |
OutletHeadBasis |
Whether the rating uses depth or head difference. |
CircularCrossSection
Circular conduit section.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
kind |
readonly |
"circular" |
Circular section discriminator. |
diameter |
readonly |
number |
Diameter in project length units (ft or m). |
StandardCrossSection
Standard SWMM section; geometry interpretation depends on the shape.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
kind |
readonly |
"standard" |
Standard section discriminator. |
shape |
readonly |
StandardCrossSectionShape |
Native standard shape name. |
geometry |
readonly |
readonly [number, number, number, number] |
Four native geometry parameters; dimensional entries use project length units. |
culvertCode |
readonly |
number |
Native culvert inlet-control code. |
CustomCrossSection
Custom section backed by a configured shape.
Properties
IrregularCrossSection
Irregular section backed by a configured transect.
Properties
StreetCrossSection
Street section backed by a configured street definition.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
kind |
readonly |
"street" |
Street section discriminator. |
street |
readonly |
string |
Canonical street ID. |
culvertCode |
readonly |
number |
Native culvert inlet-control code. |
InletConfiguration
Detached inlet placement; link.inlet() returns null when none is configured.
Properties
InletPatch
Sparse persistent inlet-control update; omission retains a value.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
percentClogged? |
readonly |
number |
Clogging percentage. |
flowLimit? |
readonly |
number |
Inlet flow limit in project flow units. |
InletResults
Detached current inlet results.
Properties
ConduitConfiguration
Conduit-specific declarations.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
kind |
readonly |
"conduit" |
Conduit subtype discriminator. |
length |
readonly |
number |
Conduit length in ft or m. |
roughness |
readonly |
number |
Conduit roughness in native solver units. |
barrels |
readonly |
number |
Number of parallel barrels. |
crossSection |
readonly |
CrossSection | null |
Cross-section declaration, or null. |
PumpConfiguration
Pump-specific declarations.
Properties
OrificeConfiguration
Orifice-specific declarations.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
kind |
readonly |
"orifice" |
Orifice subtype discriminator. |
orificeKind |
readonly |
OrificeKind |
Side or bottom opening. |
dischargeCoefficient |
readonly |
number |
Native orifice discharge coefficient. |
openingTimeHours |
readonly |
number |
Full opening time in hours. |
WeirConfiguration
Weir-specific declarations.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
kind |
readonly |
"weir" |
Weir subtype discriminator. |
weirKind |
readonly |
WeirKind |
Weir geometry. |
dischargeCoefficient |
readonly |
number |
Native weir discharge coefficient. |
endDischargeCoefficient |
readonly |
number |
Native end-discharge coefficient. |
endContractions |
readonly |
number |
Number of end contractions. |
canSurcharge |
readonly |
boolean |
Whether the weir may surcharge. |
roadwayWidth |
readonly |
number |
Roadway width in ft or m. |
roadwaySurface |
readonly |
RoadSurface |
Roadway surface classification. |
coefficientCurve |
readonly |
string | null |
Canonical coefficient-curve ID, or null. |
OutletConfiguration
Outlet-specific declarations.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
kind |
readonly |
"outlet" |
Outlet subtype discriminator. |
rating |
readonly |
OutletRating |
Functional or tabular rating. |
LinkConfiguration
Detached read-only common, subtype, cross-section, and inlet declarations.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
kind |
readonly |
LinkKind |
Configured link family. |
tag |
readonly |
string |
Object tag. |
inletNode |
readonly |
string |
Canonical configured inlet-node ID. |
outletNode |
readonly |
string |
Canonical configured outlet-node ID. |
flowDirection |
readonly |
number |
Solver direction relative to configured orientation. |
length |
readonly |
number | null |
Conduit length in ft or m; null for other kinds. |
slope |
readonly |
number | null |
Conduit slope ratio; null for other kinds. |
fullDepth |
readonly |
number |
Full hydraulic depth in ft or m. |
fullFlow |
readonly |
number |
Full-flow capacity in project flow units. |
includedInReport |
readonly |
boolean |
Selection for detailed reporting. |
inletOffset |
readonly |
number |
Inlet offset in project length units. |
outletOffset |
readonly |
number |
Outlet offset in project length units. |
initialFlow |
readonly |
number |
Initial flow in project flow units. |
flowLimit |
readonly |
number |
Persistent flow limit in project flow units; set with Link.setFlowLimit. |
inletLossCoefficient |
readonly |
number |
Dimensionless inlet loss coefficient. |
outletLossCoefficient |
readonly |
number |
Dimensionless outlet loss coefficient. |
averageLossCoefficient |
readonly |
number |
Dimensionless average loss coefficient. |
seepageRate |
readonly |
number |
Seepage rate in in/h or mm/h. |
hasFlapGate |
readonly |
boolean |
Flap-gate flag. |
subtype |
readonly |
LinkSubtypeConfiguration |
Kind-tagged subtype record. |
crossSection |
readonly |
CrossSection | null |
Convenience alias for conduit declarations; null for other link families. |
inlet |
readonly |
InletConfiguration | null |
Inlet placement, or null when absent. |
ConduitPatch
Sparse conduit update; omitted fields retain their values.
Properties
PumpPatch
Sparse pump update; omission retains a field.
Properties
OrificePatch
Sparse orifice update; omission retains a field.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
orificeKind? |
readonly |
OrificeKind |
Side or bottom opening. |
dischargeCoefficient? |
readonly |
number |
Native orifice discharge coefficient. |
openingTimeHours? |
readonly |
number |
Full opening time in hours. |
WeirPatch
Sparse weir update; omission retains a field.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
weirKind? |
readonly |
WeirKind |
Weir geometry. |
dischargeCoefficient? |
readonly |
number |
Native weir discharge coefficient. |
endDischargeCoefficient? |
readonly |
number |
Native end-discharge coefficient. |
endContractions? |
readonly |
number |
Number of end contractions. |
canSurcharge? |
readonly |
boolean |
Whether the weir may surcharge. |
roadwayWidth? |
readonly |
number |
Roadway width in ft or m. |
roadwaySurface? |
readonly |
RoadSurface |
Roadway surface classification. |
coefficientCurve? |
readonly |
string | null |
Omit to preserve; null clears the optional coefficient curve. |
OutletPatch
Sparse outlet update; omission retains its rating.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
rating? |
readonly |
OutletRatingPatch |
Replacement rating declaration. |
LinkPatch
Sparse atomic link declaration update. Omitted fields retain their values; derived fields are not writable.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
tag? |
readonly |
string |
Object tag. |
inletNode? |
readonly |
string |
Canonical configured inlet-node ID. |
outletNode? |
readonly |
string |
Canonical configured outlet-node ID. |
inletOffset? |
readonly |
number |
Inlet offset in project length units. |
outletOffset? |
readonly |
number |
Outlet offset in project length units. |
includedInReport? |
readonly |
boolean |
Selection for detailed reporting. |
initialFlow? |
readonly |
number |
Initial flow in project flow units. |
inletLossCoefficient? |
readonly |
number |
Dimensionless inlet loss coefficient. |
outletLossCoefficient? |
readonly |
number |
Dimensionless outlet loss coefficient. |
averageLossCoefficient? |
readonly |
number |
Dimensionless average loss coefficient. |
seepageRate? |
readonly |
number |
Seepage rate in in/h or mm/h. |
hasFlapGate? |
readonly |
boolean |
Flap-gate flag. |
crossSection? |
readonly |
CrossSectionPatch |
Replacement conduit cross-section. |
subtype? |
readonly |
LinkSubtypePatch |
Sparse kind-tagged subtype update; cannot change link family. |
LinkQuality
Detached quality arrays in pollutant-ID order, using configured concentration/load units.
Properties
LinkQualitySnapshot
Detached pollutant-major quality matrices: [pollutantIndex][objectIndex], in configured units.
Properties
LinkStatistics
Detached cumulative link statistics for the current run.
Properties
PumpStatistics
Detached pump-only cumulative statistics.
Properties
LinkStatisticsSnapshot
Detached cumulative columns in object-ID order; units match LinkStatistics.
Properties
LinkResults
Detached current link hydraulics from link.results(), not a historical series.
Properties
OutletRating
Functional or tabular outlet rating, discriminated by kind.
OutletRatingPatch
type OutletRatingPatch =
| {
kind: "functional";
coefficient: number;
exponent: number;
headBasis?: OutletHeadBasis;
}
| {
kind: "tabular";
curve: string;
headBasis?: OutletHeadBasis;
};
Replacement outlet rating; omitted head basis defaults to depth, not the previous declaration's value.
Union Members
Type Literal
kind
Power-law rating discriminator.
coefficient
Discharge coefficient in the rating's native units.
exponent
Head/depth exponent.
headBasis?
Depth or head-difference basis; defaults to depth.
Type Literal
kind
Curve-based rating discriminator.
curve
Canonical rating-curve ID.
headBasis?
Depth or head-difference basis; defaults to depth.
CrossSection
type CrossSection =
| CircularCrossSection
| StandardCrossSection
| CustomCrossSection
| IrregularCrossSection
| StreetCrossSection;
Detached conduit section selected by kind; absent sections are represented by null on the containing record.
CrossSectionPatch
type CrossSectionPatch =
| Omit<CircularCrossSection, "culvertCode">
| Omit<StandardCrossSection, "culvertCode"> & object
| Omit<CustomCrossSection, "culvertCode"> & object
| Omit<IrregularCrossSection, "culvertCode"> & object
| Omit<StreetCrossSection, "culvertCode"> & object;
Replacement cross-section declaration. Non-circular variants accept an optional culvert code.
LinkSubtypeConfiguration
type LinkSubtypeConfiguration =
| ConduitConfiguration
| PumpConfiguration
| OrificeConfiguration
| WeirConfiguration
| OutletConfiguration;
Kind-tagged link declarations; configuring a subtype cannot change the link's family.
LinkSubtypePatch
type LinkSubtypePatch =
| object & ConduitPatch
| object & PumpPatch
| object & OrificePatch
| object & WeirPatch
| object & OutletPatch;
Select the existing link family and patch only its writable subtype fields.