@swmmrs/swmmrs 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,199 +1,199 @@
1
- /**
2
- * Detached current node hydraulics returned by `node.results()`.
3
- * Values are frozen copies, not live worker views or report-period time series.
4
- */
5
- export interface NodeResults {
6
- /** Water depth above the invert in project length units (ft or m). */
7
- readonly depth: number;
8
- /** Hydraulic head in project elevation units (ft or m). */
9
- readonly head: number;
10
- /** Stored water volume in project volume units (ft³ or m³). */
11
- readonly volume: number;
12
- /** Current lateral inflow in project flow units. */
13
- readonly lateralInflow: number;
14
- /** Current total inflow in project flow units. */
15
- readonly totalInflow: number;
16
- /** Current total outflow in project flow units. */
17
- readonly totalOutflow: number;
18
- /** Current loss rate in project flow units. */
19
- readonly losses: number;
20
- /** Current flooding rate in project flow units. */
21
- readonly flooding: number;
22
- /** Storage-node hydraulic retention time in seconds; `null` for other node kinds. */
23
- readonly hydraulicRetentionSeconds: number | null;
24
- }
25
-
26
- /** Detached current link hydraulics from `link.results()`, not a historical series. */
27
- export interface LinkResults {
28
- /** Current opening or pump-speed factor. */
29
- readonly setting: number;
30
- /** Target opening or pump-speed factor; native control rules may change it. */
31
- readonly targetSetting: number;
32
- /** Open duration in seconds. */
33
- readonly timeOpenSeconds: number;
34
- /** Closed duration in seconds. */
35
- readonly timeClosedSeconds: number;
36
- /** Signed flow in configured orientation, in project flow units. */
37
- readonly flow: number;
38
- /** Water depth in ft or m. */
39
- readonly depth: number;
40
- /** Velocity magnitude in ft/s or m/s. */
41
- readonly velocity: number;
42
- /** Conduit surface width in ft or m; null for other link kinds. */
43
- readonly topWidth: number | null;
44
- /** Stored water volume in ft³ or m³. */
45
- readonly volume: number;
46
- /** Conduit capacity ratio, or non-conduit setting. */
47
- readonly capacity: number;
48
- /** Upstream surface area in ft² or m². */
49
- readonly upstreamSurfaceArea: number;
50
- /** Downstream surface area in ft² or m². */
51
- readonly downstreamSurfaceArea: number;
52
- /** Dimensionless Froude number. */
53
- readonly froudeNumber: number;
54
- }
55
-
56
- /** Detached current subcatchment runoff values, available while results exist. */
57
- export interface SubcatchmentResults {
58
- /** Rainfall rate in in/h or mm/h. */
59
- readonly rainfall: number;
60
- /** Evaporation rate in in/day or mm/day. */
61
- readonly evaporation: number;
62
- /** Infiltration rate in in/h or mm/h. */
63
- readonly infiltration: number;
64
- /** Runon in project flow units. */
65
- readonly runon: number;
66
- /** Runoff in project flow units. */
67
- readonly runoff: number;
68
- /** Snow depth in inches or millimetres. */
69
- readonly snowDepth: number;
70
- }
71
-
72
- /** Detached current rain-gage rates in in/h or mm/h, not accumulated depths. */
73
- export interface RainGageResults {
74
- /** Total current precipitation rate. */
75
- readonly totalPrecip: number;
76
- /** Current rainfall rate. */
77
- readonly rainfall: number;
78
- /** Current snowfall rate. */
79
- readonly snowfall: number;
80
- /** Selected persistent API source rate, or null when not selected. */
81
- readonly externalPrecipitationRate: number | null;
82
- /** Highest-priority rainfall override rate, or null when cleared. */
83
- readonly rainfallOverride: number | null;
84
- }
85
-
86
- /**
87
- * Detached, timestamp-free columns with one value per canonical object ID.
88
- * Requested selection order is preserved; an empty selection yields empty columns.
89
- * @typeParam T - Per-object result record defining each column's values and units.
90
- */
91
- export type Snapshot<T> = {
92
- /** Canonical object IDs defining every column's order. */
93
- readonly objectIds: readonly string[]
94
- } & {
95
- readonly [K in keyof T]: readonly T[K][];
96
- };
97
- /** Aligned node hydraulic columns; keep the observation time separately. */
98
- export type NodeSnapshot = Snapshot<NodeResults>;
99
- /** Aligned link hydraulic columns; keep the observation time separately. */
100
- export type LinkSnapshot = Snapshot<LinkResults>;
101
- /** Aligned subcatchment runoff columns; keep the observation time separately. */
102
- export type SubcatchmentSnapshot = Snapshot<SubcatchmentResults>;
103
-
104
- /** Cumulative routing volumes in project volume units; continuity error is percent. */
105
- export interface RoutingTotals {
106
- /** Dry-weather inflow volume. */
107
- readonly dryWeatherInflow: number;
108
- /** Wet-weather inflow volume. */
109
- readonly wetWeatherInflow: number;
110
- /** Groundwater inflow volume. */
111
- readonly groundwaterInflow: number;
112
- /** RDII inflow volume. */
113
- readonly rdiiInflow: number;
114
- /** External inflow volume. */
115
- readonly externalInflow: number;
116
- /** Flooding volume. */
117
- readonly flooding: number;
118
- /** Outfall discharge volume. */
119
- readonly outflow: number;
120
- /** Evaporation loss volume. */
121
- readonly evaporationLoss: number;
122
- /** Seepage loss volume. */
123
- readonly seepageLoss: number;
124
- /** Reaction loss in the native routing balance. */
125
- readonly reactionLoss: number;
126
- /** Initial system storage volume. */
127
- readonly initialStorage: number;
128
- /** Final system storage volume. */
129
- readonly finalStorage: number;
130
- /** Routing continuity error in percent. */
131
- readonly continuityError: number;
132
- }
133
-
134
- /** Cumulative runoff water-balance depths in inches or millimetres, except percent continuity error. */
135
- export interface RunoffTotals {
136
- /** Rainfall depth. */
137
- readonly rainfall: number;
138
- /** Evaporation loss depth. */
139
- readonly evaporationLoss: number;
140
- /** Infiltration loss depth. */
141
- readonly infiltrationLoss: number;
142
- /** Runoff depth. */
143
- readonly runoff: number;
144
- /** LID drainage depth. */
145
- readonly lidDrainage: number;
146
- /** Outfall runon depth. */
147
- readonly outfallRunon: number;
148
- /** Initial surface-storage depth. */
149
- readonly initialSurfaceStorage: number;
150
- /** Final surface-storage depth. */
151
- readonly finalSurfaceStorage: number;
152
- /** Initial snow-cover depth. */
153
- readonly initialSnowCover: number;
154
- /** Final snow-cover depth. */
155
- readonly finalSnowCover: number;
156
- /** Removed snow depth. */
157
- readonly snowRemoved: number;
158
- /** Runoff continuity error in percent. */
159
- readonly continuityError: number;
160
- }
161
-
162
- /** Detached time-step and convergence diagnostics for the current run. */
163
- export interface RoutingDiagnostics {
164
- /** Average routing step in seconds. */
165
- readonly averageTimeStepSeconds: number;
166
- /** Minimum routing step in seconds. */
167
- readonly minimumTimeStepSeconds: number;
168
- /** Maximum routing step in seconds. */
169
- readonly maximumTimeStepSeconds: number;
170
- /** Number of routing steps. */
171
- readonly stepCount: number;
172
- /** Number of nonconverged steps. */
173
- readonly nonconvergedStepCount: number;
174
- /** Nonconverged steps as a percentage of all steps. */
175
- readonly nonconvergedStepPercentage: number;
176
- /** Average trial iterations per routing step. */
177
- readonly averageIterations: number;
178
- }
179
-
180
- /** Cumulative system records from `simulation.statistics()` in `running` or `complete`, before ending. */
181
- export interface SimulationStatistics {
182
- /** Routing-volume continuity balance. */
183
- readonly routingTotals: RoutingTotals;
184
- /** Runoff-depth continuity balance. */
185
- readonly runoffTotals: RunoffTotals;
186
- /** Groundwater continuity error in percent. */
187
- readonly groundwaterContinuityError: number;
188
- /** System quality continuity error in percent. */
189
- readonly qualityContinuityError: number;
190
- /** Routing time-step and convergence data. */
191
- readonly routingDiagnostics: RoutingDiagnostics;
192
- /** Pollutant-ID balances; seepage follows native report units, including safe log10 units for counts. */
193
- readonly qualityBalances: Readonly<Record<string, {
194
- /** Pollutant continuity error in percent. */
195
- readonly continuityError: number;
196
- /** Pollutant seepage loss in native report units. */
197
- readonly seepageLoss: number;
198
- }>>;
199
- }
1
+ /**
2
+ * Detached current node hydraulics returned by `node.results()`.
3
+ * Values are frozen copies, not live worker views or report-period time series.
4
+ */
5
+ export interface NodeResults {
6
+ /** Water depth above the invert in project length units (ft or m). */
7
+ readonly depth: number;
8
+ /** Hydraulic head in project elevation units (ft or m). */
9
+ readonly head: number;
10
+ /** Stored water volume in project volume units (ft³ or m³). */
11
+ readonly volume: number;
12
+ /** Current lateral inflow in project flow units. */
13
+ readonly lateralInflow: number;
14
+ /** Current total inflow in project flow units. */
15
+ readonly totalInflow: number;
16
+ /** Current total outflow in project flow units. */
17
+ readonly totalOutflow: number;
18
+ /** Current loss rate in project flow units. */
19
+ readonly losses: number;
20
+ /** Current flooding rate in project flow units. */
21
+ readonly flooding: number;
22
+ /** Storage-node hydraulic retention time in seconds; `null` for other node kinds. */
23
+ readonly hydraulicRetentionSeconds: number | null;
24
+ }
25
+
26
+ /** Detached current link hydraulics from `link.results()`, not a historical series. */
27
+ export interface LinkResults {
28
+ /** Current opening or pump-speed factor. */
29
+ readonly setting: number;
30
+ /** Target opening or pump-speed factor; native control rules may change it. */
31
+ readonly targetSetting: number;
32
+ /** Open duration in seconds. */
33
+ readonly timeOpenSeconds: number;
34
+ /** Closed duration in seconds. */
35
+ readonly timeClosedSeconds: number;
36
+ /** Signed flow in configured orientation, in project flow units. */
37
+ readonly flow: number;
38
+ /** Water depth in ft or m. */
39
+ readonly depth: number;
40
+ /** Velocity magnitude in ft/s or m/s. */
41
+ readonly velocity: number;
42
+ /** Conduit surface width in ft or m; null for other link kinds. */
43
+ readonly topWidth: number | null;
44
+ /** Stored water volume in ft³ or m³. */
45
+ readonly volume: number;
46
+ /** Conduit capacity ratio, or non-conduit setting. */
47
+ readonly capacity: number;
48
+ /** Upstream surface area in ft² or m². */
49
+ readonly upstreamSurfaceArea: number;
50
+ /** Downstream surface area in ft² or m². */
51
+ readonly downstreamSurfaceArea: number;
52
+ /** Dimensionless Froude number. */
53
+ readonly froudeNumber: number;
54
+ }
55
+
56
+ /** Detached current subcatchment runoff values, available while results exist. */
57
+ export interface SubcatchmentResults {
58
+ /** Rainfall rate in in/h or mm/h. */
59
+ readonly rainfall: number;
60
+ /** Evaporation rate in in/day or mm/day. */
61
+ readonly evaporation: number;
62
+ /** Infiltration rate in in/h or mm/h. */
63
+ readonly infiltration: number;
64
+ /** Runon in project flow units. */
65
+ readonly runon: number;
66
+ /** Runoff in project flow units. */
67
+ readonly runoff: number;
68
+ /** Snow depth in inches or millimetres. */
69
+ readonly snowDepth: number;
70
+ }
71
+
72
+ /** Detached current rain-gage rates in in/h or mm/h, not accumulated depths. */
73
+ export interface RainGageResults {
74
+ /** Total current precipitation rate. */
75
+ readonly totalPrecip: number;
76
+ /** Current rainfall rate. */
77
+ readonly rainfall: number;
78
+ /** Current snowfall rate. */
79
+ readonly snowfall: number;
80
+ /** Selected persistent API source rate, or null when not selected. */
81
+ readonly externalPrecipitationRate: number | null;
82
+ /** Highest-priority rainfall override rate, or null when cleared. */
83
+ readonly rainfallOverride: number | null;
84
+ }
85
+
86
+ /**
87
+ * Detached, timestamp-free columns with one value per canonical object ID.
88
+ * Requested selection order is preserved; an empty selection yields empty columns.
89
+ * @typeParam T - Per-object result record defining each column's values and units.
90
+ */
91
+ export type Snapshot<T> = {
92
+ /** Canonical object IDs defining every column's order. */
93
+ readonly objectIds: readonly string[]
94
+ } & {
95
+ readonly [K in keyof T]: readonly T[K][];
96
+ };
97
+ /** Aligned node hydraulic columns; keep the observation time separately. */
98
+ export type NodeSnapshot = Snapshot<NodeResults>;
99
+ /** Aligned link hydraulic columns; keep the observation time separately. */
100
+ export type LinkSnapshot = Snapshot<LinkResults>;
101
+ /** Aligned subcatchment runoff columns; keep the observation time separately. */
102
+ export type SubcatchmentSnapshot = Snapshot<SubcatchmentResults>;
103
+
104
+ /** Cumulative routing volumes in project volume units; continuity error is percent. */
105
+ export interface RoutingTotals {
106
+ /** Dry-weather inflow volume. */
107
+ readonly dryWeatherInflow: number;
108
+ /** Wet-weather inflow volume. */
109
+ readonly wetWeatherInflow: number;
110
+ /** Groundwater inflow volume. */
111
+ readonly groundwaterInflow: number;
112
+ /** RDII inflow volume. */
113
+ readonly rdiiInflow: number;
114
+ /** External inflow volume. */
115
+ readonly externalInflow: number;
116
+ /** Flooding volume. */
117
+ readonly flooding: number;
118
+ /** Outfall discharge volume. */
119
+ readonly outflow: number;
120
+ /** Evaporation loss volume. */
121
+ readonly evaporationLoss: number;
122
+ /** Seepage loss volume. */
123
+ readonly seepageLoss: number;
124
+ /** Reaction loss in the native routing balance. */
125
+ readonly reactionLoss: number;
126
+ /** Initial system storage volume. */
127
+ readonly initialStorage: number;
128
+ /** Final system storage volume. */
129
+ readonly finalStorage: number;
130
+ /** Routing continuity error in percent. */
131
+ readonly continuityError: number;
132
+ }
133
+
134
+ /** Cumulative runoff water-balance depths in inches or millimetres, except percent continuity error. */
135
+ export interface RunoffTotals {
136
+ /** Rainfall depth. */
137
+ readonly rainfall: number;
138
+ /** Evaporation loss depth. */
139
+ readonly evaporationLoss: number;
140
+ /** Infiltration loss depth. */
141
+ readonly infiltrationLoss: number;
142
+ /** Runoff depth. */
143
+ readonly runoff: number;
144
+ /** LID drainage depth. */
145
+ readonly lidDrainage: number;
146
+ /** Outfall runon depth. */
147
+ readonly outfallRunon: number;
148
+ /** Initial surface-storage depth. */
149
+ readonly initialSurfaceStorage: number;
150
+ /** Final surface-storage depth. */
151
+ readonly finalSurfaceStorage: number;
152
+ /** Initial snow-cover depth. */
153
+ readonly initialSnowCover: number;
154
+ /** Final snow-cover depth. */
155
+ readonly finalSnowCover: number;
156
+ /** Removed snow depth. */
157
+ readonly snowRemoved: number;
158
+ /** Runoff continuity error in percent. */
159
+ readonly continuityError: number;
160
+ }
161
+
162
+ /** Detached time-step and convergence diagnostics for the current run. */
163
+ export interface RoutingDiagnostics {
164
+ /** Average routing step in seconds. */
165
+ readonly averageTimeStepSeconds: number;
166
+ /** Minimum routing step in seconds. */
167
+ readonly minimumTimeStepSeconds: number;
168
+ /** Maximum routing step in seconds. */
169
+ readonly maximumTimeStepSeconds: number;
170
+ /** Number of routing steps. */
171
+ readonly stepCount: number;
172
+ /** Number of nonconverged steps. */
173
+ readonly nonconvergedStepCount: number;
174
+ /** Nonconverged steps as a percentage of all steps. */
175
+ readonly nonconvergedStepPercentage: number;
176
+ /** Average trial iterations per routing step. */
177
+ readonly averageIterations: number;
178
+ }
179
+
180
+ /** Cumulative system records from `simulation.statistics()` in `running` or `complete`, before ending. */
181
+ export interface SimulationStatistics {
182
+ /** Routing-volume continuity balance. */
183
+ readonly routingTotals: RoutingTotals;
184
+ /** Runoff-depth continuity balance. */
185
+ readonly runoffTotals: RunoffTotals;
186
+ /** Groundwater continuity error in percent. */
187
+ readonly groundwaterContinuityError: number;
188
+ /** System quality continuity error in percent. */
189
+ readonly qualityContinuityError: number;
190
+ /** Routing time-step and convergence data. */
191
+ readonly routingDiagnostics: RoutingDiagnostics;
192
+ /** Pollutant-ID balances; seepage follows native report units, including safe log10 units for counts. */
193
+ readonly qualityBalances: Readonly<Record<string, {
194
+ /** Pollutant continuity error in percent. */
195
+ readonly continuityError: number;
196
+ /** Pollutant seepage loss in native report units. */
197
+ readonly seepageLoss: number;
198
+ }>>;
199
+ }