Skip to content

Simulation options

Source-generated reference for model declarations and schedule patches. See Inspect and configure a model for workflows and Types and enums for worker/runtime options.

SimulationOptionsView

Stable model options. Updates are atomic and require an open or ended run.

Methods

read()

read(): Promise<ModelOptions>;

Read the complete option record in a healthy owner state.

Returns

Promise<ModelOptions>

Detached ModelOptions, including read-only solver tolerances.

update()

update(patch: ModelOptionsPatch): Promise<void>;

Atomically update model options in open or ended; accepted edits return ended to open.

Parameters
Parameter Type Description
patch ModelOptionsPatch Sparse option values. Unknown keys, invalid types/enums, and solver-invalid values reject the whole patch.
Returns

Promise<void>

Resolves after all supplied fields are accepted.

Example
import type { Simulation } from "@swmmrs/swmmrs";
declare const simulation: Simulation;
await simulation.options.update({ routingStepSeconds: 30, reportStepSeconds: 300, qualityEnabled: true });

maximumRoutingStepSeconds()

maximumRoutingStepSeconds(): Promise<number>;

Read the maximum routing interval allowed by current configuration.

Returns

Promise<number>

Maximum routing interval in seconds.


ModelOptionsPatch

Sparse model-option update. Omitted fields retain their values; tolerances are not writable.

Properties

Property Type Description
routingStepSeconds? number Nominal routing step in seconds. Resets Courant factor to zero unless both are supplied.
reportStepSeconds? number Binary report interval in whole seconds, independent of iterator observation cadence.
detailedReportingEnabled? boolean Enable detailed report tables; object selection still uses includedInReport.
customEllipseModel? CustomEllipseModel Ellipse cross-section interpretation.
surchargeMethod? SurchargeMethod Surcharge treatment.
allowPonding? boolean Allow configured nodal surface ponding.
inertiaDamping? InertiaDamping Dynamic Wave inertia-damping rule.
normalFlowLimit? NormalFlowLimit Normal-flow limiting rule.
skipSteadyState? boolean Allow steady-state routing skips.
rainfallEnabled? boolean Process rainfall; does not create missing definitions.
rdiiEnabled? boolean Process rainfall-dependent infiltration/inflow.
snowmeltEnabled? boolean Process snowmelt.
groundwaterEnabled? boolean Process groundwater.
routingEnabled? boolean Route hydraulic flow.
qualityEnabled? boolean Process water quality.
ruleStepSeconds? number Control-rule interval in whole seconds.
sweepStart? SweepDay First month/day for seasonal sweeping.
sweepEnd? SweepDay Last month/day for seasonal sweeping.
maximumTrials? number Maximum Dynamic Wave trial iterations.
requestedThreads? number Model-requested solver threads, distinct from the worker capacity in SimulationOptions.threads.
minimumRoutingStepSeconds? number Lower bound for variable routing steps in seconds.
lengtheningStepSeconds? number Conduit-lengthening time step in seconds.
antecedentDrySeconds? number Antecedent dry period in seconds.
courantFactor? number Variable-step adjustment factor. Explicit writes must be positive; reads may contain the disabled value zero.
minimumSurfaceArea? number Minimum nodal surface area in ft² or m².
minimumConduitSlope? number Minimum conduit slope as a ratio, not a percentage.

ModelOptions

Complete read-only option record, including all writable fields and solver tolerances.

Extends

Properties

Property Modifier Type Description Inherited from
routingStepSeconds readonly number Nominal routing step in seconds. Resets Courant factor to zero unless both are supplied. ModelOptionsPatch.routingStepSeconds
reportStepSeconds readonly number Binary report interval in whole seconds, independent of iterator observation cadence. ModelOptionsPatch.reportStepSeconds
detailedReportingEnabled readonly boolean Enable detailed report tables; object selection still uses includedInReport. ModelOptionsPatch.detailedReportingEnabled
customEllipseModel readonly CustomEllipseModel Ellipse cross-section interpretation. ModelOptionsPatch.customEllipseModel
surchargeMethod readonly SurchargeMethod Surcharge treatment. ModelOptionsPatch.surchargeMethod
allowPonding readonly boolean Allow configured nodal surface ponding. ModelOptionsPatch.allowPonding
inertiaDamping readonly InertiaDamping Dynamic Wave inertia-damping rule. ModelOptionsPatch.inertiaDamping
normalFlowLimit readonly NormalFlowLimit Normal-flow limiting rule. ModelOptionsPatch.normalFlowLimit
skipSteadyState readonly boolean Allow steady-state routing skips. ModelOptionsPatch.skipSteadyState
rainfallEnabled readonly boolean Process rainfall; does not create missing definitions. ModelOptionsPatch.rainfallEnabled
rdiiEnabled readonly boolean Process rainfall-dependent infiltration/inflow. ModelOptionsPatch.rdiiEnabled
snowmeltEnabled readonly boolean Process snowmelt. ModelOptionsPatch.snowmeltEnabled
groundwaterEnabled readonly boolean Process groundwater. ModelOptionsPatch.groundwaterEnabled
routingEnabled readonly boolean Route hydraulic flow. ModelOptionsPatch.routingEnabled
qualityEnabled readonly boolean Process water quality. ModelOptionsPatch.qualityEnabled
ruleStepSeconds readonly number Control-rule interval in whole seconds. ModelOptionsPatch.ruleStepSeconds
sweepStart readonly SweepDay First month/day for seasonal sweeping. ModelOptionsPatch.sweepStart
sweepEnd readonly SweepDay Last month/day for seasonal sweeping. ModelOptionsPatch.sweepEnd
maximumTrials readonly number Maximum Dynamic Wave trial iterations. ModelOptionsPatch.maximumTrials
requestedThreads readonly number Model-requested solver threads, distinct from the worker capacity in SimulationOptions.threads. ModelOptionsPatch.requestedThreads
minimumRoutingStepSeconds readonly number Lower bound for variable routing steps in seconds. ModelOptionsPatch.minimumRoutingStepSeconds
lengtheningStepSeconds readonly number Conduit-lengthening time step in seconds. ModelOptionsPatch.lengtheningStepSeconds
antecedentDrySeconds readonly number Antecedent dry period in seconds. ModelOptionsPatch.antecedentDrySeconds
courantFactor readonly number Variable-step adjustment factor. Explicit writes must be positive; reads may contain the disabled value zero. ModelOptionsPatch.courantFactor
minimumSurfaceArea readonly number Minimum nodal surface area in ft² or m². ModelOptionsPatch.minimumSurfaceArea
minimumConduitSlope readonly number Minimum conduit slope as a ratio, not a percentage. ModelOptionsPatch.minimumConduitSlope
headTolerance readonly number Read-only hydraulic head convergence tolerance. -
systemFlowTolerance readonly number Read-only system-flow convergence tolerance. -
lateralFlowTolerance readonly number Read-only lateral-flow convergence tolerance. -

SchedulePatch

Sparse calendar boundaries for Simulation.updateSchedule(); omitted times retain their values.

Properties

Property Type Description
startTime? string Simulation start in timezone-free model calendar time.
reportStart? string First reporting time in timezone-free model calendar time.
endTime? string Simulation end in timezone-free model calendar time.

SweepDay

type SweepDay = readonly [number, number];

Calendar month and day for seasonal sweeping; validated by the native solver.