OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
SimulationSnapshot.hpp
Go to the documentation of this file.
1
26#ifndef OPENSWMM_SIMULATION_SNAPSHOT_HPP
27#define OPENSWMM_SIMULATION_SNAPSHOT_HPP
28
29#include <vector>
30#include <string>
31#include <cstdint>
32
33namespace openswmm {
34
40 std::vector<double> depth;
41 std::vector<double> head;
42 std::vector<double> volume;
43 std::vector<double> lateral_inflow;
44 std::vector<double> total_inflow;
45 std::vector<double> overflow;
46};
47
53 std::vector<double> flow;
54 std::vector<double> depth;
55 std::vector<double> velocity;
56 std::vector<double> capacity;
57};
58
64 std::vector<double> rainfall;
65 std::vector<double> evap;
66 std::vector<double> infil;
67 std::vector<double> runoff;
68 std::vector<double> gw_flow;
69 std::vector<double> gw_elev;
70 std::vector<double> soil_moist;
71};
72
78 std::vector<double> rainfall;
79};
80
91 // -----------------------------------------------------------------------
92 // Timing
93 // -----------------------------------------------------------------------
94
96 double sim_time = 0.0;
97
99 std::int64_t wall_time_unix = 0;
100
103
104 // -----------------------------------------------------------------------
105 // Object counts
106 // -----------------------------------------------------------------------
107
108 int node_count = 0;
109 int link_count = 0;
111 int gage_count = 0;
112 int pollut_count = 0;
113
114 // -----------------------------------------------------------------------
115 // State arrays (parallel to the engine's SoA arrays)
116 // -----------------------------------------------------------------------
117
122
123 // -----------------------------------------------------------------------
124 // System-level results (for binary output file)
125 // -----------------------------------------------------------------------
126
127 double sys_temperature = 0.0;
128 double sys_rainfall = 0.0;
129 double sys_snow_depth = 0.0;
130 double sys_evap = 0.0;
131 double sys_infil = 0.0;
132 double sys_runoff = 0.0;
133 double sys_dw_inflow = 0.0;
134 double sys_gw_inflow = 0.0;
135 double sys_lat_inflow = 0.0;
136 double sys_flooding = 0.0;
137 double sys_outflow = 0.0;
138 double sys_storage = 0.0;
139 double sys_pet = 0.0;
140
141 // -----------------------------------------------------------------------
142 // Pollutant concentrations (optional; populated only if quality routing active)
143 // -----------------------------------------------------------------------
144
150 std::vector<double> node_quality;
151
156 std::vector<double> link_quality;
157
161 std::vector<double> subcatch_quality;
162
163 // -----------------------------------------------------------------------
164 // String tables (for plugins that need to label their output)
165 // -----------------------------------------------------------------------
166
168 const std::vector<std::string>* node_ids = nullptr;
169
171 const std::vector<std::string>* link_ids = nullptr;
172
174 const std::vector<std::string>* subcatch_ids = nullptr;
175
177 const std::vector<std::string>* gage_ids = nullptr;
178
180 const std::vector<std::string>* pollut_names = nullptr;
181
182 // -----------------------------------------------------------------------
183 // Unit information
184 // -----------------------------------------------------------------------
185
187 const char* flow_units = nullptr;
188
190 const char* length_units = nullptr;
191};
192
193} /* namespace openswmm */
194
195#endif /* OPENSWMM_SIMULATION_SNAPSHOT_HPP */
Definition Controls.cpp:24
Snapshot of rain gage state at an output time step.
Definition SimulationSnapshot.hpp:77
std::vector< double > rainfall
Current rainfall rate [project rate units].
Definition SimulationSnapshot.hpp:78
Snapshot of node state at an output time step.
Definition SimulationSnapshot.hpp:39
std::vector< double > volume
Stored volume [project volume units].
Definition SimulationSnapshot.hpp:42
std::vector< double > lateral_inflow
Lateral inflow [project flow units].
Definition SimulationSnapshot.hpp:43
std::vector< double > total_inflow
Total inflow [project flow units].
Definition SimulationSnapshot.hpp:44
std::vector< double > head
Hydraulic head [project length units].
Definition SimulationSnapshot.hpp:41
std::vector< double > overflow
Overflow / surcharge [project flow units].
Definition SimulationSnapshot.hpp:45
std::vector< double > depth
Water depth [project length units].
Definition SimulationSnapshot.hpp:40
Complete simulation state snapshot at one output time step.
Definition SimulationSnapshot.hpp:90
std::vector< double > subcatch_quality
Subcatchment pollutant loadings.
Definition SimulationSnapshot.hpp:161
const std::vector< std::string > * gage_ids
Gage IDs in index order.
Definition SimulationSnapshot.hpp:177
SubcatchSnapshot subcatch
Subcatchment state.
Definition SimulationSnapshot.hpp:120
LinkSnapshot links
Link state.
Definition SimulationSnapshot.hpp:119
GageSnapshot gages
Gage state.
Definition SimulationSnapshot.hpp:121
double sys_lat_inflow
Total lateral inflow (RDII + external)
Definition SimulationSnapshot.hpp:135
const char * flow_units
Flow unit string (e.g., "CFS", "LPS").
Definition SimulationSnapshot.hpp:187
double sys_gw_inflow
Total groundwater inflow.
Definition SimulationSnapshot.hpp:134
int link_count
Number of links.
Definition SimulationSnapshot.hpp:109
double sys_pet
Potential evapotranspiration.
Definition SimulationSnapshot.hpp:139
double sys_outflow
Total outflow.
Definition SimulationSnapshot.hpp:137
double sim_time
Simulation time of this snapshot (decimal days / Julian date).
Definition SimulationSnapshot.hpp:96
int gage_count
Number of rain gages.
Definition SimulationSnapshot.hpp:111
double sys_storage
Total storage volume.
Definition SimulationSnapshot.hpp:138
std::vector< double > node_quality
Node pollutant concentrations.
Definition SimulationSnapshot.hpp:150
int subcatch_count
Number of subcatchments.
Definition SimulationSnapshot.hpp:110
int pollut_count
Number of pollutants.
Definition SimulationSnapshot.hpp:112
double sys_runoff
Total runoff flow.
Definition SimulationSnapshot.hpp:132
int output_step_index
Sequential output step index (0-based).
Definition SimulationSnapshot.hpp:102
int node_count
Number of nodes.
Definition SimulationSnapshot.hpp:108
const std::vector< std::string > * link_ids
Link IDs in index order.
Definition SimulationSnapshot.hpp:171
std::int64_t wall_time_unix
Wall-clock Unix timestamp when snapshot was taken.
Definition SimulationSnapshot.hpp:99
double sys_evap
Total evaporation loss.
Definition SimulationSnapshot.hpp:130
const std::vector< std::string > * node_ids
Node IDs in index order. Pointer to engine-managed strings.
Definition SimulationSnapshot.hpp:168
double sys_rainfall
Average rainfall over all gages.
Definition SimulationSnapshot.hpp:128
double sys_infil
Total infiltration loss.
Definition SimulationSnapshot.hpp:131
const char * length_units
Length unit string (e.g., "FEET", "METERS").
Definition SimulationSnapshot.hpp:190
const std::vector< std::string > * pollut_names
Pollutant names in index order.
Definition SimulationSnapshot.hpp:180
double sys_snow_depth
Total snow depth.
Definition SimulationSnapshot.hpp:129
double sys_flooding
Total flooding.
Definition SimulationSnapshot.hpp:136
const std::vector< std::string > * subcatch_ids
Subcatchment IDs in index order.
Definition SimulationSnapshot.hpp:174
double sys_temperature
Air temperature.
Definition SimulationSnapshot.hpp:127
NodeSnapshot nodes
Node state.
Definition SimulationSnapshot.hpp:118
std::vector< double > link_quality
Link pollutant concentrations.
Definition SimulationSnapshot.hpp:156
double sys_dw_inflow
Total dry weather inflow.
Definition SimulationSnapshot.hpp:133
Snapshot of subcatchment state at an output time step.
Definition SimulationSnapshot.hpp:63
std::vector< double > soil_moist
Soil moisture [-].
Definition SimulationSnapshot.hpp:70
std::vector< double > rainfall
Rainfall rate [project rate units].
Definition SimulationSnapshot.hpp:64
std::vector< double > infil
Infiltration [project rate units].
Definition SimulationSnapshot.hpp:66
std::vector< double > runoff
Surface runoff [project flow units].
Definition SimulationSnapshot.hpp:67
std::vector< double > gw_flow
Groundwater outflow [project flow units].
Definition SimulationSnapshot.hpp:68
std::vector< double > evap
Evaporation [project rate units].
Definition SimulationSnapshot.hpp:65
std::vector< double > gw_elev
Groundwater elevation [project length units].
Definition SimulationSnapshot.hpp:69