OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
UebHeld.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2
11
12#pragma once
13#include "UebLumped.hpp"
14
15namespace openswmm::surface::ueb {
16// A snow solve can span many runoff/marcher steps. The end state is private
17// until consumed: readers and checkpoints see only the elapsed share of the
18// water/energy balance. Forcing must remain constant over the prepared window;
19// drivers end a window at precipitation changes and at SNOW_STEP boundaries.
20struct HeldState {
23 double duration = 0, elapsed = 0;
27 bool pending() const noexcept { return elapsed < duration; }
28};
29
42std::string prepareHeld(HeldState& state, const Parameters& parameters, const Site& site,
43 const Forcing& forcing, const std::array<double, 10>& curve);
61std::string consumeHeld(HeldState& state, double seconds, const std::array<double, 10>& curve,
62 LumpedFluxes& output);
63// Discard only the unused prediction, preserving the elapsed inventory. Used
64// when a runtime forcing edit ends the old held interval early.
69void closeHeld(HeldState& state) noexcept;
70} // namespace openswmm::surface::ueb
Lumped Utah Energy Balance snow model integration.
Definition SnowCheckpoint.hpp:60
std::string prepareHeld(HeldState &s, const Parameters &p, const Site &site, const Forcing &f, const std::array< double, 10 > &curve)
Predict one full constant-forcing UEB window while retaining accepted inventory.
Definition UebHeld.cpp:58
std::string consumeHeld(HeldState &s, double seconds, const std::array< double, 10 > &curve, LumpedFluxes &output)
Publish only the requested elapsed share of an already solved snow window.
Definition UebHeld.cpp:73
void closeHeld(HeldState &s) noexcept
Discard the remaining prediction's active clock while keeping elapsed inventory.
Definition UebHeld.cpp:133
Definition UebHeld.hpp:20
double elapsed
Definition UebHeld.hpp:23
LumpedState accepted
Definition UebHeld.hpp:21
LumpedState begin
Definition UebHeld.hpp:21
double duration
Definition UebHeld.hpp:23
LumpedFluxes flux
Definition UebHeld.hpp:22
LumpedState end
Definition UebHeld.hpp:21
bool pending() const noexcept
Test whether the prepared forcing window has unconsumed duration.
Definition UebHeld.hpp:27
Definition UebLumped.hpp:25
Definition UebLumped.hpp:21