OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::HeatState Struct Reference

Runtime heat state shared by the engines (phase H1). More...

#include <HeatData.hpp>

Collaboration diagram for openswmm::HeatState:

Public Member Functions

void resize (int n_nodes, int n_links, double initial_temp)
 
void resizeWatershed (int n_subcatch, double initial_temp)
 
bool watershedSized (int n_subcatch) const noexcept
 
void clear ()
 

Public Attributes

std::vector< double > node_temp_vol_in
 
std::vector< double > node_lid_drain_temp_vol_in
 
std::vector< double > node_temp
 [node], °C
 
std::vector< double > link_temp
 [link], °C
 
bool legacy_seeded = false
 The LEGACY mirror seeds INITIAL_STATE on its first step.
 
double shortwave_now = -1.0
 
double cloud_now = 0.0
 Cloud fraction at the current step, C ∈ [0,1]. 0 = clear.
 
std::vector< double > subarea_temp
 [subcatch * kNSubArea + subarea], °C — ponded surface temperature.
 
std::vector< double > subarea_vol_prev
 
std::vector< double > subcatch_runoff_temp
 [subcatch], °C — temperature the subcatchment's runoff leaves at.
 
std::vector< double > subcatch_runon_temp_vol_in
 
std::vector< double > subcatch_runon_temp_rate
 
std::vector< double > subcatch_outfall_temp_vol
 

Static Public Attributes

static constexpr int kNSubArea = static_cast<int>(HeatSubArea::COUNT_)
 

Detailed Description

Runtime heat state shared by the engines (phase H1).

node_temp_vol_in is a RATE (°C·ft³/s) — loaders add q · T and the engine integrates it over its substeps, exactly as node_age_vol_in does for age. node_temp/link_temp are the PUBLISHED temperatures (°C) the reports and gates read.

Member Function Documentation

◆ clear()

void openswmm::HeatState::clear ( )
inline

◆ resize()

void openswmm::HeatState::resize ( int n_nodes,
int n_links,
double initial_temp )
inline
Here is the caller graph for this function:

◆ resizeWatershed()

void openswmm::HeatState::resizeWatershed ( int n_subcatch,
double initial_temp )
inline

◆ watershedSized()

bool openswmm::HeatState::watershedSized ( int n_subcatch) const
inlinenoexcept

Member Data Documentation

◆ cloud_now

double openswmm::HeatState::cloud_now = 0.0

Cloud fraction at the current step, C ∈ [0,1]. 0 = clear.

◆ kNSubArea

int openswmm::HeatState::kNSubArea = static_cast<int>(HeatSubArea::COUNT_)
staticconstexpr

◆ legacy_seeded

bool openswmm::HeatState::legacy_seeded = false

The LEGACY mirror seeds INITIAL_STATE on its first step.

◆ link_temp

std::vector<double> openswmm::HeatState::link_temp

[link], °C

◆ node_lid_drain_temp_vol_in

std::vector<double> openswmm::HeatState::node_lid_drain_temp_vol_in

[node], °C·ft³/s arriving through LID underdrains, accumulated in the runoff step beside nodes.lid_drain_qual_vol and consumed by the wet-weather loader on that same per-runoff-step cadence — the twin of WaterAgeState::node_lid_drain_age_vol_in. Until this existed the drain-to-node loader handed the drain the RAINFALL temperature, so H5b's storage-layer temperature reached run-on receivers but never a node (LID fix round, 2026-08-30).

◆ node_temp

std::vector<double> openswmm::HeatState::node_temp

[node], °C

◆ node_temp_vol_in

std::vector<double> openswmm::HeatState::node_temp_vol_in

[node], °C·ft³/s

◆ shortwave_now

double openswmm::HeatState::shortwave_now = -1.0

Incoming shortwave at the current step, W/m², cloud already applied.

NEGATIVE means "not yet resolved this run", and that is load-bearing, not decorative. radiativeFluxOut passes this straight into netRadiativeFluxOut's jin_wm2, whose documented sentinel for "use the configured constant" is a negative value. A 0.0 default would make that sentinel unreachable from the production path, so any call landing before the step's updateSolarForcing would silently drop the shortwave term to zero instead of falling back on RadiativeConfig::shortwave_wm2. updateSolarForcing never writes a negative (it ends in max(0.0, ...)), so the sentinel cannot be confused with a resolved night-time 0.

◆ subarea_temp

std::vector<double> openswmm::HeatState::subarea_temp

[subcatch * kNSubArea + subarea], °C — ponded surface temperature.

◆ subarea_vol_prev

std::vector<double> openswmm::HeatState::subarea_vol_prev

[subcatch * kNSubArea + subarea], ft³ — that subarea's stored water at the END of the previous step. The solver overwrites its depths in place, so the old volume is otherwise gone by the time this runs.

◆ subcatch_outfall_temp_vol

std::vector<double> openswmm::HeatState::subcatch_outfall_temp_vol

[subcatch], °C·ft³ — outfall-return temperature-volume, accumulated on the ROUTING clock beside subcatches.outfall_runon_vol and consumed on the RUNOFF clock. A volume, not a rate, for exactly the reason its age counterpart is: the two clocks differ, so the producer cannot know the interval the consumer will divide by.

◆ subcatch_runoff_temp

std::vector<double> openswmm::HeatState::subcatch_runoff_temp

[subcatch], °C — temperature the subcatchment's runoff leaves at.

◆ subcatch_runon_temp_rate

std::vector<double> openswmm::HeatState::subcatch_runon_temp_rate

[subcatch], ft³/s — the run-on rate whose temperature is KNOWN, i.e. the flow actually represented in subcatch_runon_temp_vol_in.

This is the pair that keeps A3's defect from recurring. subcatches.runon_inflow has THREE contributors (the subcatchment cascade, the LID underdrain return, and the outfall return); A3 filled its age numerator from one of them and divided by all three, so the arriving age was dragged toward zero — measured at 3.834 h under a 4 h rain, younger than anything entering the model.

Carrying the rate alongside the numerator makes the ratio a true mean of whatever was counted, whether that is one contributor or three. H5a counts the cascade and the outfall return; the LID underdrain arrives with H5b, because a drain's temperature is a per-layer quantity that does not exist until the LID layer species row does. Until then the omission biases nothing — it simply averages over less water, which is the difference between an incomplete answer and a wrong one.

◆ subcatch_runon_temp_vol_in

std::vector<double> openswmm::HeatState::subcatch_runon_temp_vol_in

[subcatch], °C·ft³/s — per-step RATE accumulator for arriving run-on, following the node_temp_vol_in convention: donors accumulate q · T, and it is zeroed once consumed.


The documentation for this struct was generated from the following file: