![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Classes | |
| struct | Fluxes |
| Integrated accepted point exchanges and final thermal diagnostics. Water depths m and energy kJ/m2 cover the whole requested interval. Temperature Celsius and albedo are final accepted substep values, not interval averages. steps counts accepted leaves; retries counts successful binary splits. More... | |
| struct | Forcing |
| Held point meteorology over one requested interval. seconds is duration, precipitation integrated liquid-equivalent m, temperature Celsius, wind m/s, humidity [0,1], incoming radiation W/m2, cosine [0,1]. Catch and drift apply to snowfall; snow_fraction=-1 selects temperature partition. Other fields remain held while advance splits time and apportions precipitation. More... | |
| struct | HeldState |
| struct | LumpedFluxes |
| struct | LumpedState |
| struct | NativeState |
| Owned per-surface UEB predictions, accepted outputs and whole-model ledgers. Three surface columns per subcatchment; rain/snow caches are per subcatchment. Held water/energy use m and kJ/m2; global water/energy ledgers use m3 and kJ. Sample/completed clocks are elapsed seconds. last_seconds is the last call span; enabled column clocks can differ when source groups advance independently. Report arrays live in SnowSoA; one serialized owner coordinates both stores. More... | |
| struct | Parameters |
| Point UEB material, radiation and integration parameters. Temperatures are Celsius, lengths m, densities kg/m3, heat capacities kJ/(kg K), conductivities kJ/(m K h), drainage/conductance m/h, max_step seconds. Fractions, age responses and stability are dimensionless; low_frequency retains the reference hourly convention. validate() checks all fields before public advance. More... | |
| struct | Site |
| Per-column environmental settings. forest is canopy fraction, drift a snow multiplier, pressure Pa, ground_heat prescribed W/m2 into the snow system, extinction_depth m. Public advance checks forest [0,1], drift>=0, positive pressure/depth and finite signed ground heat. More... | |
| struct | State |
| One owned point snow/active-soil energy and thermal-memory inventory. energy kJ/m2 may be signed, water m SWE, age dimensionless optical age, refreezing depths m. The duration-weighted history spans at most 24 hours. No forcing/runtime context is shared between independent point states. More... | |
| struct | ThermalSample |
| One duration-weighted preceding thermal sample (seconds and Celsius). More... | |
Enumerations | |
| enum class | TemperatureMethod { ModifiedForceRestore , Equilibrium } |
Functions | |
| std::string | prepareHeld (HeldState &state, const Parameters ¶meters, const Site &site, const Forcing &forcing, const std::array< double, 10 > &curve) |
| Predict one full constant-forcing UEB window while retaining accepted inventory. | |
| std::string | consumeHeld (HeldState &state, double seconds, const std::array< double, 10 > &curve, LumpedFluxes &output) |
| Publish only the requested elapsed share of an already solved snow window. | |
| void | closeHeld (HeldState &state) noexcept |
| Discard the remaining prediction's active clock while keeping elapsed inventory. | |
| std::string | validateDepletion (const std::array< double, 10 > &curve) |
| Check a ten-point snow-cover depletion curve. | |
| double | depletionCover (const std::array< double, 10 > &curve, double relative_water) noexcept |
| Interpolate coverage from relative basin-average snow water. | |
| std::string | initializeLumped (LumpedState &state, double water, double point_energy, double maximum, const std::array< double, 10 > &curve) |
| Prepare a basin-average water inventory and covered-area point state. | |
| std::string | advanceLumped (LumpedState &state, const Parameters ¶meters, const Site &site, const Forcing &forcing, const std::array< double, 10 > &curve, LumpedFluxes &output) |
| Trial one UEB point interval then reconcile basin cover and represented energy. | |
| double | bulkTemperature (const State &state, const Parameters ¶meters) noexcept |
| Convert signed represented snow/active-soil energy to bulk temperature. | |
| std::string | advance (State &state, const Parameters ¶meters, const Site &site, const Forcing &forcing, Fluxes &output) |
| Advance one isolated point pack with bounded reference solves and whole-call publication. | |
| std::string | initializeSubcatchments (SimulationContext &context, snow::SnowSoA &snow) |
| Initialize privately staged UEB columns from authored native snow assignments. | |
| double | nextSnowBoundary (const SimulationContext &context, double elapsed, double proposed) noexcept |
| Shorten a proposed span to the next native UEB held-forcing boundary. | |
| std::string | advanceSubcatchments (SimulationContext &context, snow::SnowSoA &native, double date, double elapsed, double seconds, const double *rain, const double *snow) |
| Trial accepted UEB snow and plowing over one source/runoff interval. | |
|
strong |
| std::string openswmm::surface::ueb::advance | ( | State & | state, |
| const Parameters & | parameters, | ||
| const Site & | site, | ||
| const Forcing & | forcing, | ||
| Fluxes & | output ) |
Advance one isolated point pack with bounded reference solves and whole-call publication.
| [in,out] | state | Valid finite inventory with nonnegative water/age/refreezing depths and positive-duration thermal samples above absolute zero spanning at most 24 hours. Replaced only after the full requested interval is accepted. |
| parameters | Valid material/integration configuration, checked on entry. | |
| site | Finite valid forest/drift/pressure/ground-heat/extinction settings. | |
| forcing | Positive finite duration seconds; nonnegative precipitation m, wind m/s and incoming W/m2; temperature in (-100,70] Celsius; humidity/cosine [0,1]; nonnegative catch; snow_fraction exactly -1 or [0,1]. Meteorology is held constant. | |
| [out] | output | Replaced on success with integrated m/kJ-per-m2 fluxes, summed water/energy residuals and counts, plus endpoint temperatures/albedo. Retained on normal failure. Signed sublimation includes deposition. |
| std::string openswmm::surface::ueb::advanceLumped | ( | LumpedState & | state, |
| const Parameters & | parameters, | ||
| const Site & | site, | ||
| const Forcing & | forcing, | ||
| const std::array< double, 10 > & | curve, | ||
| LumpedFluxes & | output ) |
Trial one UEB point interval then reconcile basin cover and represented energy.
| [in,out] | state | Consistent finite nonnegative water/maximum metres, cover [0,1], positive cover for nonempty water and point.water*cover agreeing with basin water. Owns covered-point thermal history. Publication replaces it only after normal success. |
| parameters | Qualified point UEB physical/numerical parameters; advance validates them. | |
| site | Qualified point site forcing/pressure/forest configuration. | |
| forcing | Held interval point forcing in UEB units, positive seconds; passed unchanged to the point kernel. Precipitation partition follows that kernel. | |
| curve | Finite nondecreasing depletion fractions, checked each call. | |
| [out] | output | Assigned on success: whole-element integrated water depths m, point diagnostics and kJ/m2 forcing/geometry-energy accounts; retained on refusal. |
| std::string openswmm::surface::ueb::advanceSubcatchments | ( | SimulationContext & | context, |
| snow::SnowSoA & | native, | ||
| double | date, | ||
| double | elapsed, | ||
| double | seconds, | ||
| const double * | rain, | ||
| const double * | snow ) |
Trial accepted UEB snow and plowing over one source/runoff interval.
| [in,out] | context | Matching initialized weather/gage/snow configuration. On success replaces UEB runtime and books signed sublimation in runoff balance; weather/table cursors and radiation outputs may change even if trial fails. |
| [in,out] | native | Compatible native state/owner flags. Enabled external surfaces are advanced; success replaces staged histories/reports, including DD receivers of plowed UEB snow. Caller supplies consistent report and accepted water pools. |
| date | Start of interval in native OLE days; must correspond to elapsed. | |
| elapsed | Start seconds since simulation origin, in the owning source schedule. | |
| seconds | Positive accepted span, no longer than snow/hour/gage/transient/ simulation boundary; caller qualifies finite time and coherent column clocks. | |
| rain | Borrowed per-subcatchment finite nonnegative, already partitioned and catch-corrected liquid ft/s; array has at least native.n_subcatch entries. | |
| snow | Same-layout solid precipitation ft/s. Native drift/catch must already be applied: this adapter forces site drift and snow catch to one. |
|
noexcept |
Convert signed represented snow/active-soil energy to bulk temperature.
| state | Finite energy kJ/m2 and water m; nonnegative water required. |
| parameters | Positive density/depth/heat-capacity fields guaranteeing positive combined snow/soil heat capacity; not validated here. |
|
noexcept |
Discard the remaining prediction's active clock while keeping elapsed inventory.
| [in,out] | state | Sets duration=elapsed=0 only; accepted state is retained. Begin/end/full flux data remain stored but are no longer pending, and a later prepare replaces them. No water rollback, physical flux booking or allocation. |
| std::string openswmm::surface::ueb::consumeHeld | ( | HeldState & | state, |
| double | seconds, | ||
| const std::array< double, 10 > & | curve, | ||
| LumpedFluxes & | output ) |
Publish only the requested elapsed share of an already solved snow window.
| [in,out] | state | Consistent prepared window and current accepted partial state; no concurrent forcing/model edits. Updates accepted inventory and elapsed only on normal success, retaining private full predicted end/flux. |
| seconds | Finite positive consumption no greater than remaining duration except 1e-5-second calendar roundoff, which snaps exactly to the full endpoint. | |
| curve | Same qualified depletion curve used at preparation, checked again. | |
| [out] | output | Assigned whole-element integrated depth/energy share on success; retained on normal refusal. point fluxes remain the full prepared solve, not a scaled new solve. Point steps/retries/diagnostics publish only on first consumption. |
|
noexcept |
Interpolate coverage from relative basin-average snow water.
| curve | Qualified finite monotone fraction ordinates from validateDepletion(). |
| relative_water | Finite basin water divided by its maximum reference depth. |
| std::string openswmm::surface::ueb::initializeLumped | ( | LumpedState & | state, |
| double | water, | ||
| double | point_energy, | ||
| double | maximum, | ||
| const std::array< double, 10 > & | curve ) |
Prepare a basin-average water inventory and covered-area point state.
| [in,out] | state | Replaced only on normal success; prior state retained on refusal. |
| water | Finite nonnegative whole-element water-equivalent depth metres. | |
| point_energy | Finite covered-point energy kJ/m2, assigned directly rather than divided by cover. Physical consistency follows the point model/caller. | |
| maximum | Finite nonnegative maximum/reference basin SWE metres. Nonempty water raises it to at least water; empty water forces reference zero. | |
| curve | Valid depletion ordinates; nonempty water must yield positive cover. |
| std::string openswmm::surface::ueb::initializeSubcatchments | ( | SimulationContext & | context, |
| snow::SnowSoA & | snow ) |
Initialize privately staged UEB columns from authored native snow assignments.
| [in,out] | context | Initialized snowpacks/configuration, compatible subcatchment areas/pack indices and unit factors. Replaces only snowpacks.runtime on success. |
| [in,out] | snow | Initialized three-surface native geometry/history arrays with valid extents and assignments. Replaces external-owner flags and publishes UEB water/cover/cold reports on success; zero-duration publication retains flux fields. |
|
noexcept |
Shorten a proposed span to the next native UEB held-forcing boundary.
| context | Initialized snow runtime/configuration with finite positive step and valid start date; global ignore-snow or inactive runtime bypasses shortening. |
| elapsed | Current finite elapsed seconds in the source/runoff schedule. |
| proposed | Proposed finite nonnegative duration seconds. |
| std::string openswmm::surface::ueb::prepareHeld | ( | HeldState & | state, |
| const Parameters & | parameters, | ||
| const Site & | site, | ||
| const Forcing & | forcing, | ||
| const std::array< double, 10 > & | curve ) |
Predict one full constant-forcing UEB window while retaining accepted inventory.
| [in,out] | state | Consistent accepted lumped state with no pending window. Stores begin/end/full-window flux, duration and zero elapsed on success; accepted water/energy remains unchanged until consumed. |
| parameters | Qualified UEB physical/numerical parameters. | |
| site | Qualified UEB site configuration. | |
| forcing | Held weather/precipitation over positive seconds in UEB point units; drivers must close a window at forcing or SNOW_STEP changes. | |
| curve | Qualified depletion fractions, checked by advanceLumped(). |
| std::string openswmm::surface::ueb::validateDepletion | ( | const std::array< double, 10 > & | curve | ) |
Check a ten-point snow-cover depletion curve.
| curve | Ordinates for relative water 0, 0.1, ..., 0.9; implicit value at1 is1. |