![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
#include <Snow.hpp>
Public Member Functions | |
| void | resize (int n) |
Public Attributes | |
| int | n_subcatch = 0 |
| std::vector< double > | wsnow |
| Snow water equivalent (ft) | |
| std::vector< double > | fw |
| Free water in pack (ft) | |
| std::vector< double > | coldc |
| Cold content (ft water equiv) | |
| std::vector< double > | ati |
| Antecedent temperature index (deg F) | |
| std::vector< double > | awe |
| Areal depletion index. | |
| std::vector< double > | imelt |
| Melt rate output (ft/sec) | |
| std::vector< double > | tbase |
| Base melt temperature (deg F) | |
| std::vector< double > | dhm |
| Degree-day melt factor (ft/deg-F/sec) | |
| std::vector< double > | dhmin |
| Min melt coeff (winter solstice) (ft/deg-F/sec) | |
| std::vector< double > | dhmax |
| Max melt coeff (summer solstice) (ft/deg-F/sec) | |
| std::vector< double > | fwfrac |
| Free water capacity fraction. | |
| std::vector< double > | fArea |
| Fraction of total area for each subarea. | |
| std::vector< double > | age |
| std::vector< double > | out_age |
| std::vector< double > | si |
| Snow depth for 100% cover (ft) | |
| std::vector< double > | sba |
| Snow coverage area at start of new-snow ADC. | |
| std::vector< double > | sbws |
| Snow water equiv at end of new-snow ADC. | |
| std::vector< double > | asc |
| Computed areal snow coverage (0–1), per subarea. | |
| double | adc_imperv [10] = {1,1,1,1,1,1,1,1,1,1} |
| double | adc_perv [10] = {1,1,1,1,1,1,1,1,1,1} |
| std::vector< double > | snn |
| Plowable fraction of impervious area. | |
| std::vector< double > | weplow |
| Depth at which plowing begins (ft) | |
| std::vector< double > | sfrac |
| std::vector< int > | to_subcatch |
| Target subcatchment for plowed snow. | |
| double | tipm = 0.5 |
| ATI weighting factor. | |
| double | rnm = 0.6 |
| Negative melt ratio. | |
| double | season = 0.0 |
| Current snowmelt season factor (-1 to +1) | |
| double | removed = 0.0 |
| Cumulative snow plowed out of system (ft3) | |
| double | precip_age = 0.0 |
| bool | track_age = false |
| void openswmm::snow::SnowSoA::resize | ( | int | n | ) |
| double openswmm::snow::SnowSoA::adc_imperv[10] = {1,1,1,1,1,1,1,1,1,1} |
| double openswmm::snow::SnowSoA::adc_perv[10] = {1,1,1,1,1,1,1,1,1,1} |
| std::vector<double> openswmm::snow::SnowSoA::age |
S2b — WATER AGE of the pack's water (seconds), per subcatchment × subarea. Complete-mix over wsnow + fw TOGETHER.
Two stores would be more faithful — snow and free water have genuinely different residence times — but the melt path moves water between them within a single step anyway, and one age is the minimum that carries residence time at all. Recorded as a deliberate approximation in SNOW_DIVERGENCE_REGISTER.md rather than left unnamed, which is what lesson 64 is actually about.
Maintained inside this solver on purpose. Plowing moves water between surfaces AND to another subcatchment inside plowSnow; an age update running afterwards can see only the end state and would have to guess which water went where. The age therefore moves at the point the water moves, which is the only place that knows.
| std::vector<double> openswmm::snow::SnowSoA::asc |
Computed areal snow coverage (0–1), per subarea.
| std::vector<double> openswmm::snow::SnowSoA::ati |
Antecedent temperature index (deg F)
| std::vector<double> openswmm::snow::SnowSoA::awe |
Areal depletion index.
| std::vector<double> openswmm::snow::SnowSoA::coldc |
Cold content (ft water equiv)
| std::vector<double> openswmm::snow::SnowSoA::dhm |
Degree-day melt factor (ft/deg-F/sec)
| std::vector<double> openswmm::snow::SnowSoA::dhmax |
Max melt coeff (summer solstice) (ft/deg-F/sec)
| std::vector<double> openswmm::snow::SnowSoA::dhmin |
Min melt coeff (winter solstice) (ft/deg-F/sec)
| std::vector<double> openswmm::snow::SnowSoA::fArea |
Fraction of total area for each subarea.
| std::vector<double> openswmm::snow::SnowSoA::fw |
Free water in pack (ft)
| std::vector<double> openswmm::snow::SnowSoA::fwfrac |
Free water capacity fraction.
| std::vector<double> openswmm::snow::SnowSoA::imelt |
Melt rate output (ft/sec)
| int openswmm::snow::SnowSoA::n_subcatch = 0 |
| std::vector<double> openswmm::snow::SnowSoA::out_age |
S2b — age of the water this step PUBLISHED as imelt (seconds).
Not the same as age, and the difference is the whole reason this array exists: in a complete-mix pool the water leaving carries the pool's age, but a pack that EMPTIES this step leaves age at 0 with no water to describe. Meltwater from such a pack still carries the age the pack had. Sentinel-free — it is only meaningful where imelt > 0, and callers gate on that.
| double openswmm::snow::SnowSoA::precip_age = 0.0 |
S2b — age of water arriving from the sky (seconds). Set by the engine each runoff step from the water-age component's RAINFALL source.
A scalar set from outside rather than a lookup into the transport config, so hydrology keeps no dependency on the transport layer — the same shape as season, tipm and rnm.
| double openswmm::snow::SnowSoA::removed = 0.0 |
Cumulative snow plowed out of system (ft3)
| double openswmm::snow::SnowSoA::rnm = 0.6 |
Negative melt ratio.
| std::vector<double> openswmm::snow::SnowSoA::sba |
Snow coverage area at start of new-snow ADC.
| std::vector<double> openswmm::snow::SnowSoA::sbws |
Snow water equiv at end of new-snow ADC.
| double openswmm::snow::SnowSoA::season = 0.0 |
Current snowmelt season factor (-1 to +1)
| std::vector<double> openswmm::snow::SnowSoA::sfrac |
Plowing fractions [subcatch * 5 + i] [0]=removed, [1]=to imperv, [2]=to perv, [3]=immediate melt, [4]=to other subcatch
| std::vector<double> openswmm::snow::SnowSoA::si |
Snow depth for 100% cover (ft)
| std::vector<double> openswmm::snow::SnowSoA::snn |
Plowable fraction of impervious area.
| std::vector<double> openswmm::snow::SnowSoA::tbase |
Base melt temperature (deg F)
| double openswmm::snow::SnowSoA::tipm = 0.5 |
ATI weighting factor.
| std::vector<int> openswmm::snow::SnowSoA::to_subcatch |
Target subcatchment for plowed snow.
| bool openswmm::snow::SnowSoA::track_age = false |
S2b — whether to maintain age / out_age at all.
The age arrays are pure bookkeeping: nothing in the water balance reads them, so a deck is byte-identical either way. The flag exists to keep the arithmetic off the hot path when WATER_AGE is off, not to protect an answer.
| std::vector<double> openswmm::snow::SnowSoA::weplow |
Depth at which plowing begins (ft)
| std::vector<double> openswmm::snow::SnowSoA::wsnow |
Snow water equivalent (ft)