OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
SubcatchData.hpp
Go to the documentation of this file.
1
18#ifndef OPENSWMM_ENGINE_SUBCATCH_DATA_HPP
19#define OPENSWMM_ENGINE_SUBCATCH_DATA_HPP
20
21#include <vector>
22#include <string>
23#include <cstdint>
24#include <algorithm>
25#include <limits>
26
27namespace openswmm {
28
29// ============================================================================
30// SubcatchData — SoA layout
31// ============================================================================
32
42
43 // -----------------------------------------------------------------------
44 // Static properties — set at parse time
45 // -----------------------------------------------------------------------
46
53 std::vector<int> outlet_node;
54
59 std::vector<int> outlet_subcatch;
60
66 std::vector<std::string> outlet_name;
67
72 std::vector<int> gage;
73
78 std::vector<double> area;
79
84 std::vector<double> width;
85
90 std::vector<double> slope;
91
96 std::vector<double> curb_length;
97
102 std::vector<double> frac_imperv;
103
108 std::vector<double> frac_imperv_no_store;
109
114 std::vector<double> n_imperv;
115
120 std::vector<double> n_perv;
121
126 std::vector<double> ds_imperv;
127
132 std::vector<double> ds_perv;
133
134 // -----------------------------------------------------------------------
135 // Inter-subarea routing (from [SUBAREAS] section)
136 // -----------------------------------------------------------------------
137
145 std::vector<int> subarea_routing;
146
153 std::vector<double> pct_routed;
154
155 // -----------------------------------------------------------------------
156 // Infiltration parameters (per subcatchment)
157 // -----------------------------------------------------------------------
158
160 std::vector<int> infil_model;
161
163 std::vector<double> infil_p1;
165 std::vector<double> infil_p2;
167 std::vector<double> infil_p3;
169 std::vector<double> infil_p4;
171 std::vector<double> infil_p5;
172
173 // -----------------------------------------------------------------------
174 // State variables — updated each timestep
175 // -----------------------------------------------------------------------
176
181 std::vector<double> runoff;
182
187 std::vector<double> rainfall;
188
193 std::vector<double> evap_loss;
194
199 std::vector<double> infil_loss;
200
205 std::vector<double> ponded_depth;
206
211 std::vector<double> gw_flow;
212
213 // -----------------------------------------------------------------------
214 // Previous-step state
215 // -----------------------------------------------------------------------
216
218 std::vector<double> old_runoff;
219
221 std::vector<double> old_gw_flow;
222
223 // -----------------------------------------------------------------------
224 // Runon coupling — subcatch-to-subcatch routing
225 // -----------------------------------------------------------------------
226
229 std::vector<double> runon_inflow;
230
232 std::vector<double> old_runon_inflow;
233
237 std::vector<double> outfall_runon_vol;
238
239 // -----------------------------------------------------------------------
240 // Groundwater surface water head coupling
241 // -----------------------------------------------------------------------
242
245 std::vector<double> gw_sw_head;
246
248 std::vector<double> gw_node_avail_flow;
249
256 std::vector<double> gw_max_infil_vol;
257
258 // -----------------------------------------------------------------------
259 // Quality washoff output
260 // -----------------------------------------------------------------------
261
264 std::vector<double> washoff_load;
265
266 // -----------------------------------------------------------------------
267 // Per-subcatch quality state — flat 2D: [subcatch * n_pollutants + pollutant]
268 // -----------------------------------------------------------------------
269
275 std::vector<double> conc;
276
278 std::vector<double> conc_old;
279
286 std::vector<double> ponded_qual;
287
290
291 // -----------------------------------------------------------------------
292 // Per-object INP comment
293 // -----------------------------------------------------------------------
294
300 std::vector<std::string> comments;
301
308 std::vector<std::string> tags;
309
310 // -----------------------------------------------------------------------
311 // Report flag — per-object output filter
312 // -----------------------------------------------------------------------
313
316 std::vector<char> rpt_flag;
317
318 // -----------------------------------------------------------------------
319 // Cumulative statistics
320 // -----------------------------------------------------------------------
321
326 std::vector<double> stat_precip_vol;
327 std::vector<double> stat_evap_vol;
328 std::vector<double> stat_infil_vol;
329 std::vector<double> stat_imperv_vol;
330 std::vector<double> stat_perv_vol;
331
336 std::vector<double> stat_runoff_vol;
337
342 std::vector<double> stat_max_runoff;
343
344 // Gap #63: Per-subcatch groundwater statistics (accumulated each GW step)
345 std::vector<double> stat_gw_infil_vol;
346 std::vector<double> stat_gw_upper_evap_vol;
347 std::vector<double> stat_gw_lower_evap_vol;
348 std::vector<double> stat_gw_deep_perc_vol;
349 std::vector<double> stat_gw_flow_vol;
350 std::vector<double> stat_gw_max_flow;
351 std::vector<double> stat_gw_sum_theta;
352 std::vector<double> stat_gw_sum_depth;
353 std::vector<double> stat_gw_final_theta;
354 std::vector<double> stat_gw_final_depth;
355 std::vector<long> stat_gw_steps;
356
357 // -----------------------------------------------------------------------
358 // Groundwater parameters (from [GROUNDWATER] section)
359 // -----------------------------------------------------------------------
360
362 std::vector<int> gw_aquifer;
363
365 std::vector<int> gw_node;
366
368 std::vector<double> gw_surf_elev;
369
371 std::vector<double> gw_a1;
372
374 std::vector<double> gw_b1;
375
377 std::vector<double> gw_a2;
378
380 std::vector<double> gw_b2;
381
383 std::vector<double> gw_a3;
384
386 std::vector<double> gw_tw;
387
389 std::vector<double> gw_hstar;
390
391 // -----------------------------------------------------------------------
392 // Snowpack assignment (index into SnowpackStore, -1 = none)
393 // -----------------------------------------------------------------------
394
396 std::vector<int> snowpack;
397
405 std::vector<double> snow_net_imperv;
406
414 std::vector<double> snow_net_perv;
415
423 std::vector<double> total_lid_area_ft2;
424
432 std::vector<double> lid_return_to_perv_cfs;
433
442 std::vector<double> lid_drain_runon_cfs;
443
444 // -----------------------------------------------------------------------
445 // Cumulative pollutant washoff loads — flat 2D: [subcatch * n_pollutants + pollutant]
446 // -----------------------------------------------------------------------
447
452 std::vector<double> total_load;
453
456
457 void resize_total_load(int n_sc, int n_poll) {
459 total_load.assign(
460 static_cast<std::size_t>(n_sc) * static_cast<std::size_t>(n_poll), 0.0);
461 }
462
463 // -----------------------------------------------------------------------
464 // Land-use coverage — flat 2D: [subcatch * n_landuses + landuse]
465 // -----------------------------------------------------------------------
466
471 std::vector<double> coverage;
472
475
481 std::vector<double> sweep_last_swept;
482
488 void resize_coverage(int n_sc, int n_lu) {
489 coverage_n_landuses = n_lu;
490 auto sz = static_cast<std::size_t>(n_sc) * static_cast<std::size_t>(n_lu);
491 coverage.assign(sz, 0.0);
492 sweep_last_swept.assign(sz, 0.0);
493 }
494
495 // -----------------------------------------------------------------------
496 // Capacity management
497 // -----------------------------------------------------------------------
498
499 int count() const noexcept { return static_cast<int>(area.size()); }
500
501 void resize(int n) {
502 const auto un = static_cast<std::size_t>(n);
503
504 outlet_node.assign(un, -1);
505 outlet_subcatch.assign(un, -1);
506 outlet_name.resize(un);
507 gage.assign(un, -1);
508 area.assign(un, 0.0);
509 width.assign(un, 0.0);
510 slope.assign(un, 0.0);
511 curb_length.assign(un, 0.0);
512 frac_imperv.assign(un, 0.0);
513 frac_imperv_no_store.assign(un, 0.0);
514 n_imperv.assign(un, 0.013);
515 n_perv.assign(un, 0.1);
516 ds_imperv.assign(un, 0.0);
517 ds_perv.assign(un, 0.0);
518 subarea_routing.assign(un, 0); // TO_OUTLET
519 pct_routed.assign(un, 0.0);
520
521 infil_model.assign(un, 0);
522 infil_p1.assign(un, 0.0);
523 infil_p2.assign(un, 0.0);
524 infil_p3.assign(un, 0.0);
525 infil_p4.assign(un, 0.0);
526 infil_p5.assign(un, 0.0);
527
528 runoff.assign(un, 0.0);
529 rainfall.assign(un, 0.0);
530 evap_loss.assign(un, 0.0);
531 infil_loss.assign(un, 0.0);
532 ponded_depth.assign(un, 0.0);
533 gw_flow.assign(un, 0.0);
534 old_runoff.assign(un, 0.0);
535 old_gw_flow.assign(un, 0.0);
536 runon_inflow.assign(un, 0.0);
537 old_runon_inflow.assign(un, 0.0);
538 outfall_runon_vol.assign(un, 0.0);
539 gw_sw_head.assign(un, 0.0);
540 gw_node_avail_flow.assign(un, 0.0);
541 gw_max_infil_vol.assign(un, std::numeric_limits<double>::max());
542
543 comments.assign(un, std::string{});
544 tags.assign(un, std::string{});
545
546 rpt_flag.assign(un, 0);
547
548 stat_precip_vol.assign(un, 0.0);
549 stat_evap_vol.assign(un, 0.0);
550 stat_infil_vol.assign(un, 0.0);
551 stat_imperv_vol.assign(un, 0.0);
552 stat_perv_vol.assign(un, 0.0);
553 stat_runoff_vol.assign(un, 0.0);
554 stat_max_runoff.assign(un, 0.0);
555 stat_gw_infil_vol.assign(un, 0.0);
556 stat_gw_upper_evap_vol.assign(un, 0.0);
557 stat_gw_lower_evap_vol.assign(un, 0.0);
558 stat_gw_deep_perc_vol.assign(un, 0.0);
559 stat_gw_flow_vol.assign(un, 0.0);
560 stat_gw_max_flow.assign(un, 0.0);
561 stat_gw_sum_theta.assign(un, 0.0);
562 stat_gw_sum_depth.assign(un, 0.0);
563 stat_gw_final_theta.assign(un, 0.0);
564 stat_gw_final_depth.assign(un, 0.0);
565 stat_gw_steps.assign(un, 0L);
566
567 gw_aquifer.assign(un, -1);
568 gw_node.assign(un, -1);
569 gw_surf_elev.assign(un, 0.0);
570 gw_a1.assign(un, 0.0);
571 gw_b1.assign(un, 0.0);
572 gw_a2.assign(un, 0.0);
573 gw_b2.assign(un, 0.0);
574 gw_a3.assign(un, 0.0);
575 gw_tw.assign(un, 0.0);
576 gw_hstar.assign(un, 0.0);
577 snowpack.assign(un, -1);
578 snow_net_imperv.assign(un, -1.0);
579 snow_net_perv.assign(un, -1.0);
580 total_lid_area_ft2.assign(un, 0.0);
581 lid_return_to_perv_cfs.assign(un, 0.0);
582 lid_drain_runon_cfs.assign(un, 0.0);
583 }
584
588 void grow_to(int n) {
589 if (n <= count()) return;
590 const auto un = static_cast<std::size_t>(n);
591 auto g = [&](auto& vec, auto def) { vec.resize(un, def); };
592 g(outlet_node, -1); g(outlet_subcatch, -1);
593 outlet_name.resize(un); g(gage, -1);
594 g(area, 0.0); g(width, 0.0); g(slope, 0.0); g(curb_length, 0.0);
595 g(frac_imperv, 0.0); g(frac_imperv_no_store, 0.0);
596 g(n_imperv, 0.013); g(n_perv, 0.1);
597 g(ds_imperv, 0.0); g(ds_perv, 0.0);
598 g(subarea_routing, 0); g(pct_routed, 0.0);
599 g(infil_model, 0);
600 g(infil_p1, 0.0); g(infil_p2, 0.0); g(infil_p3, 0.0);
601 g(infil_p4, 0.0); g(infil_p5, 0.0);
602 g(runoff, 0.0); g(rainfall, 0.0);
603 g(evap_loss, 0.0); g(infil_loss, 0.0);
604 g(ponded_depth, 0.0); g(gw_flow, 0.0);
605 g(old_runoff, 0.0); g(old_gw_flow, 0.0);
606 g(runon_inflow, 0.0); g(old_runon_inflow, 0.0);
607 g(gw_sw_head, 0.0); g(gw_node_avail_flow, 0.0);
608 g(gw_max_infil_vol, std::numeric_limits<double>::max());
609 g(outfall_runon_vol, 0.0);
610 comments.resize(un, std::string{});
611 tags.resize(un, std::string{});
612
613 g(rpt_flag, static_cast<char>(0));
614 g(stat_precip_vol, 0.0); g(stat_evap_vol, 0.0);
615 g(stat_infil_vol, 0.0); g(stat_imperv_vol, 0.0);
616 g(stat_perv_vol, 0.0); g(stat_runoff_vol, 0.0);
617 g(stat_max_runoff, 0.0);
620 g(stat_gw_flow_vol, 0.0); g(stat_gw_max_flow, 0.0);
621 g(stat_gw_sum_theta, 0.0); g(stat_gw_sum_depth, 0.0);
623 stat_gw_steps.resize(un, 0L);
624 g(gw_aquifer, -1); g(gw_node, -1); g(gw_surf_elev, 0.0);
625 g(gw_a1, 0.0); g(gw_b1, 0.0); g(gw_a2, 0.0); g(gw_b2, 0.0);
626 g(gw_a3, 0.0); g(gw_tw, 0.0); g(gw_hstar, 0.0);
627 g(snowpack, -1);
628 g(snow_net_imperv, -1.0);
629 g(snow_net_perv, -1.0);
630 g(total_lid_area_ft2, 0.0);
632 g(lid_drain_runon_cfs, 0.0);
633 // Note: conc, conc_old, ponded_qual, washoff_load handled by resize_quality()
634 // Note: coverage, total_load handled separately
635 }
636
645 void erase_at(int idx) {
646 const auto ui = static_cast<std::size_t>(idx);
647 auto e = [&](auto& v) { if (ui < v.size()) v.erase(v.begin() + static_cast<std::ptrdiff_t>(idx)); };
648
650 e(area); e(width); e(slope); e(curb_length);
653
654 e(infil_model); e(infil_p1); e(infil_p2); e(infil_p3); e(infil_p4); e(infil_p5);
655
657 e(gw_flow); e(old_runoff); e(old_gw_flow);
660 e(comments); e(tags); e(rpt_flag);
661
668
670 e(gw_a1); e(gw_b1); e(gw_a2); e(gw_b2); e(gw_a3); e(gw_tw); e(gw_hstar);
673
674 // Flat 2D quality arrays: [sc * np + p]
675 if (conc_n_pollutants > 0) {
676 const auto np = static_cast<std::size_t>(conc_n_pollutants);
677 const auto base = ui * np;
678 auto erase2d = [&](auto& v) {
679 if (base + np <= v.size())
680 v.erase(v.begin() + static_cast<std::ptrdiff_t>(base),
681 v.begin() + static_cast<std::ptrdiff_t>(base + np));
682 };
683 erase2d(conc); erase2d(conc_old); erase2d(ponded_qual); erase2d(washoff_load);
684 }
685
686 // Flat 2D total load: [sc * np + p]
687 if (total_load_n_pollutants > 0) {
688 const auto np = static_cast<std::size_t>(total_load_n_pollutants);
689 const auto base = ui * np;
690 if (base + np <= total_load.size())
691 total_load.erase(
692 total_load.begin() + static_cast<std::ptrdiff_t>(base),
693 total_load.begin() + static_cast<std::ptrdiff_t>(base + np));
694 }
695
696 // Flat 2D coverage/sweep matrices: [sc * n_lu + lu]
697 if (coverage_n_landuses > 0) {
698 const auto nlu = static_cast<std::size_t>(coverage_n_landuses);
699 const auto base = ui * nlu;
700 auto erase2d = [&](auto& v) {
701 if (base + nlu <= v.size())
702 v.erase(v.begin() + static_cast<std::ptrdiff_t>(base),
703 v.begin() + static_cast<std::ptrdiff_t>(base + nlu));
704 };
705 erase2d(coverage); erase2d(sweep_last_swept);
706 }
707 }
708
712 void resize_quality(int n_pollutants) {
713 conc_n_pollutants = n_pollutants;
714 if (n_pollutants > 0) {
715 auto total = static_cast<std::size_t>(count()) *
716 static_cast<std::size_t>(n_pollutants);
717 conc.assign(total, 0.0);
718 conc_old.assign(total, 0.0);
719 ponded_qual.assign(total, 0.0);
720 washoff_load.assign(total, 0.0);
721 }
722 }
723
724 void resize_washoff_load(int n_pollutants) {
725 if (n_pollutants > 0) {
726 washoff_load.assign(
727 static_cast<std::size_t>(count()) *
728 static_cast<std::size_t>(n_pollutants), 0.0);
729 }
730 }
731
736 outlet_node.shrink_to_fit();
737 outlet_subcatch.shrink_to_fit();
738 outlet_name.shrink_to_fit();
739 gage.shrink_to_fit();
740 area.shrink_to_fit();
741 width.shrink_to_fit();
742 slope.shrink_to_fit();
743 curb_length.shrink_to_fit();
744 frac_imperv.shrink_to_fit();
745 frac_imperv_no_store.shrink_to_fit();
746 n_imperv.shrink_to_fit();
747 n_perv.shrink_to_fit();
748 ds_imperv.shrink_to_fit();
749 ds_perv.shrink_to_fit();
750 subarea_routing.shrink_to_fit();
751 pct_routed.shrink_to_fit();
752
753 infil_model.shrink_to_fit();
754 infil_p1.shrink_to_fit();
755 infil_p2.shrink_to_fit();
756 infil_p3.shrink_to_fit();
757 infil_p4.shrink_to_fit();
758 infil_p5.shrink_to_fit();
759
760 runoff.shrink_to_fit();
761 rainfall.shrink_to_fit();
762 evap_loss.shrink_to_fit();
763 infil_loss.shrink_to_fit();
764 ponded_depth.shrink_to_fit();
765 gw_flow.shrink_to_fit();
766 old_runoff.shrink_to_fit();
767 old_gw_flow.shrink_to_fit();
768 runon_inflow.shrink_to_fit();
769 old_runon_inflow.shrink_to_fit();
770 outfall_runon_vol.shrink_to_fit();
771 gw_sw_head.shrink_to_fit();
772 gw_node_avail_flow.shrink_to_fit();
773 gw_max_infil_vol.shrink_to_fit();
774
775 comments.shrink_to_fit();
776 tags.shrink_to_fit();
777
778 rpt_flag.shrink_to_fit();
779
780 stat_precip_vol.shrink_to_fit();
781 stat_evap_vol.shrink_to_fit();
782 stat_infil_vol.shrink_to_fit();
783 stat_imperv_vol.shrink_to_fit();
784 stat_perv_vol.shrink_to_fit();
785 stat_runoff_vol.shrink_to_fit();
786 stat_max_runoff.shrink_to_fit();
787
788 gw_aquifer.shrink_to_fit();
789 gw_node.shrink_to_fit();
790 gw_surf_elev.shrink_to_fit();
791 gw_a1.shrink_to_fit();
792 gw_b1.shrink_to_fit();
793 gw_a2.shrink_to_fit();
794 gw_b2.shrink_to_fit();
795 gw_a3.shrink_to_fit();
796 gw_tw.shrink_to_fit();
797 gw_hstar.shrink_to_fit();
798 snowpack.shrink_to_fit();
799 snow_net_imperv.shrink_to_fit();
800 snow_net_perv.shrink_to_fit();
801
802 conc.shrink_to_fit();
803 conc_old.shrink_to_fit();
804 ponded_qual.shrink_to_fit();
805 washoff_load.shrink_to_fit();
806 total_load.shrink_to_fit();
807 coverage.shrink_to_fit();
808 sweep_last_swept.shrink_to_fit();
809 }
810
811 void save_state() noexcept {
812 std::copy(runoff.begin(), runoff.end(), old_runoff.begin());
813 std::copy(runon_inflow.begin(), runon_inflow.end(), old_runon_inflow.begin());
814 std::copy(conc.begin(), conc.end(), conc_old.begin());
815 }
816
817 void reset_state() noexcept {
818 std::fill(runoff.begin(), runoff.end(), 0.0);
819 std::fill(rainfall.begin(), rainfall.end(), 0.0);
820 std::fill(snow_net_imperv.begin(), snow_net_imperv.end(), -1.0);
821 std::fill(snow_net_perv.begin(), snow_net_perv.end(), -1.0);
822 std::fill(evap_loss.begin(), evap_loss.end(), 0.0);
823 std::fill(infil_loss.begin(), infil_loss.end(), 0.0);
824 std::fill(ponded_depth.begin(), ponded_depth.end(), 0.0);
825 std::fill(old_runoff.begin(), old_runoff.end(), 0.0);
826 std::fill(old_gw_flow.begin(), old_gw_flow.end(), 0.0);
827 std::fill(runon_inflow.begin(), runon_inflow.end(), 0.0);
828 std::fill(old_runon_inflow.begin(), old_runon_inflow.end(), 0.0);
829 std::fill(gw_sw_head.begin(), gw_sw_head.end(), 0.0);
830 std::fill(gw_node_avail_flow.begin(), gw_node_avail_flow.end(), 0.0);
831 std::fill(washoff_load.begin(), washoff_load.end(), 0.0);
832 std::fill(conc.begin(), conc.end(), 0.0);
833 std::fill(conc_old.begin(), conc_old.end(), 0.0);
834 }
835};
836
837} /* namespace openswmm */
838
839#endif /* OPENSWMM_ENGINE_SUBCATCH_DATA_HPP */
Definition NodeCoupling.cpp:15
Structure-of-Arrays storage for all subcatchments.
Definition SubcatchData.hpp:41
std::vector< int > gage
Rain gage index for this subcatchment.
Definition SubcatchData.hpp:72
std::vector< double > total_lid_area_ft2
Total LID area for this subcatchment (ft²).
Definition SubcatchData.hpp:423
void reset_state() noexcept
Definition SubcatchData.hpp:817
std::vector< int > infil_model
Infiltration model: 0=HORTON, 1=MOD_HORTON, 2=GREEN_AMPT, 3=MOD_GREEN_AMPT, 4=CURVE_NUMBER.
Definition SubcatchData.hpp:160
std::vector< double > gw_b2
Groundwater flow exponent B2.
Definition SubcatchData.hpp:380
std::vector< double > snow_net_perv
Snow-modified net precipitation for pervious subarea (ft/sec).
Definition SubcatchData.hpp:414
std::vector< double > stat_gw_infil_vol
Cumulative infiltration to GW (ft³)
Definition SubcatchData.hpp:345
int total_load_n_pollutants
Number of pollutants in total_load matrix.
Definition SubcatchData.hpp:455
std::vector< double > outfall_runon_vol
Gap #28: accumulated outfall-routed volume (ft³) between runoff steps.
Definition SubcatchData.hpp:237
std::vector< double > stat_precip_vol
Total precipitation volume (project volume units).
Definition SubcatchData.hpp:326
std::vector< double > gw_surf_elev
Surface elevation for groundwater calculations.
Definition SubcatchData.hpp:368
std::vector< double > gw_sw_head
Surface water head at GW receiving node (project length units).
Definition SubcatchData.hpp:245
void resize_quality(int n_pollutants)
Resize per-subcatch quality arrays after pollutant count is known.
Definition SubcatchData.hpp:712
std::vector< double > slope
Average slope of catchment (fraction).
Definition SubcatchData.hpp:90
std::vector< double > infil_p1
Infiltration param 1: f0 (Horton), suction (GA), CN (CN).
Definition SubcatchData.hpp:163
std::vector< double > old_gw_flow
GW flow at the previous runoff evaluation (for interpolation).
Definition SubcatchData.hpp:221
std::vector< int > snowpack
Snowpack index for this subcatchment (-1 = none).
Definition SubcatchData.hpp:396
std::vector< double > gw_tw
Threshold groundwater table elevation.
Definition SubcatchData.hpp:386
std::vector< double > evap_loss
Current evaporation loss rate (project length/time units).
Definition SubcatchData.hpp:193
std::vector< double > old_runoff
Runoff at the previous timestep.
Definition SubcatchData.hpp:218
std::vector< double > gw_node_avail_flow
Available node flow for GW negative flow limit (cfs/ft2).
Definition SubcatchData.hpp:248
std::vector< double > stat_infil_vol
Cumulative infiltration volume (ft3)
Definition SubcatchData.hpp:328
std::vector< double > gw_flow
Groundwater outflow rate (project flow units).
Definition SubcatchData.hpp:211
std::vector< double > stat_evap_vol
Cumulative evaporation volume (ft3)
Definition SubcatchData.hpp:327
std::vector< double > stat_gw_sum_theta
Sum of upper-zone theta (for time-avg)
Definition SubcatchData.hpp:351
std::vector< double > stat_perv_vol
Cumulative pervious runoff volume (ft3)
Definition SubcatchData.hpp:330
std::vector< double > area
Subcatchment area (project area units).
Definition SubcatchData.hpp:78
std::vector< double > gw_a3
Groundwater flow coefficient A3.
Definition SubcatchData.hpp:383
std::vector< int > outlet_subcatch
Index of the subcatch that receives overflow (-1 if none).
Definition SubcatchData.hpp:59
std::vector< double > gw_hstar
Water table elevation at which lateral GW flow ceases.
Definition SubcatchData.hpp:389
int coverage_n_landuses
Number of landuses stored in the coverage and sweep matrices.
Definition SubcatchData.hpp:474
std::vector< std::string > comments
Object comment from the INP file (';'-prefixed lines immediately above this subcatchment's data row),...
Definition SubcatchData.hpp:300
std::vector< double > stat_gw_upper_evap_vol
Cumulative upper zone evap (ft³)
Definition SubcatchData.hpp:346
std::vector< double > old_runon_inflow
Previous-step runon inflow (for interpolation).
Definition SubcatchData.hpp:232
std::vector< double > stat_runoff_vol
Total runoff volume (project volume units).
Definition SubcatchData.hpp:336
std::vector< double > n_imperv
Manning's n for impervious area.
Definition SubcatchData.hpp:114
std::vector< double > lid_drain_runon_cfs
LID drain flow routed to a target subcatchment (CFS).
Definition SubcatchData.hpp:442
std::vector< double > n_perv
Manning's n for pervious area.
Definition SubcatchData.hpp:120
std::vector< double > infil_p4
Infiltration param 4: dry time (Horton), 0 (GA/CN).
Definition SubcatchData.hpp:169
void resize_coverage(int n_sc, int n_lu)
Resize the coverage and sweep matrices.
Definition SubcatchData.hpp:488
std::vector< double > lid_return_to_perv_cfs
LID surface return flow to pervious area (CFS).
Definition SubcatchData.hpp:432
std::vector< std::string > tags
Per-object tag from the INP [TAGS] section.
Definition SubcatchData.hpp:308
std::vector< double > runon_inflow
Runoff inflow from upstream subcatchments (project flow units).
Definition SubcatchData.hpp:229
std::vector< double > stat_gw_final_theta
Upper-zone theta at last GW step.
Definition SubcatchData.hpp:353
std::vector< double > gw_a2
Groundwater flow coefficient A2.
Definition SubcatchData.hpp:377
std::vector< double > stat_gw_lower_evap_vol
Cumulative lower zone evap (ft³)
Definition SubcatchData.hpp:347
int conc_n_pollutants
Number of pollutants in the quality arrays.
Definition SubcatchData.hpp:289
std::vector< std::string > outlet_name
Outlet name string for deferred resolution.
Definition SubcatchData.hpp:66
std::vector< double > stat_gw_deep_perc_vol
Cumulative deep percolation (ft³)
Definition SubcatchData.hpp:348
std::vector< double > stat_imperv_vol
Cumulative impervious runoff volume (ft3)
Definition SubcatchData.hpp:329
std::vector< double > ponded_qual
Ponded surface water quality mass per (subcatch, pollutant).
Definition SubcatchData.hpp:286
std::vector< double > pct_routed
Fraction of runoff routed between subareas (0–1).
Definition SubcatchData.hpp:153
std::vector< double > infil_p2
Infiltration param 2: fmin (Horton), conductivity (GA), 0 (CN).
Definition SubcatchData.hpp:165
std::vector< double > stat_gw_max_flow
Peak lateral GW outflow (CFS)
Definition SubcatchData.hpp:350
std::vector< double > gw_a1
Groundwater flow coefficient A1.
Definition SubcatchData.hpp:371
void resize(int n)
Definition SubcatchData.hpp:501
std::vector< double > stat_gw_final_depth
Water table height at last GW step (ft)
Definition SubcatchData.hpp:354
std::vector< double > snow_net_imperv
Snow-modified net precipitation for impervious subareas (ft/sec).
Definition SubcatchData.hpp:405
std::vector< double > ds_perv
Depression storage depth for pervious area (project length units).
Definition SubcatchData.hpp:132
std::vector< double > width
Width of overland flow path (project length units).
Definition SubcatchData.hpp:84
std::vector< double > infil_loss
Current infiltration loss rate (project length/time units).
Definition SubcatchData.hpp:199
std::vector< double > frac_imperv_no_store
Fraction of impervious area with no depression storage (0–1).
Definition SubcatchData.hpp:108
std::vector< double > conc_old
Previous-step quality in subcatchment runoff.
Definition SubcatchData.hpp:278
int count() const noexcept
Definition SubcatchData.hpp:499
void erase_at(int idx)
Erase the subcatchment at index idx from every parallel array.
Definition SubcatchData.hpp:645
std::vector< double > gw_max_infil_vol
Gap #40: max infiltration volume (ft) upper GW zone can accept next step.
Definition SubcatchData.hpp:256
void resize_total_load(int n_sc, int n_poll)
Definition SubcatchData.hpp:457
std::vector< char > rpt_flag
Whether this subcatchment is included in report/output (0=no, 1=yes).
Definition SubcatchData.hpp:316
std::vector< int > gw_aquifer
Aquifer index for this subcatchment (-1 = none).
Definition SubcatchData.hpp:362
std::vector< int > outlet_node
Index of the drain-to node or subcatchment.
Definition SubcatchData.hpp:53
void grow_to(int n)
Grow all arrays to hold at least n subcatchments, preserving existing data.
Definition SubcatchData.hpp:588
std::vector< double > runoff
Current total runoff flow rate (project flow units).
Definition SubcatchData.hpp:181
void shrink_to_fit()
Release excess vector capacity accumulated during parsing.
Definition SubcatchData.hpp:735
std::vector< double > coverage
Coverage fraction per (subcatchment x landuse).
Definition SubcatchData.hpp:471
std::vector< double > stat_max_runoff
Maximum reported runoff rate (project flow units).
Definition SubcatchData.hpp:342
std::vector< double > infil_p5
Infiltration param 5: max infil (Horton), 0 (GA/CN).
Definition SubcatchData.hpp:171
std::vector< long > stat_gw_steps
Step count for GW averages.
Definition SubcatchData.hpp:355
std::vector< double > rainfall
Current total rainfall depth rate (project length/time units).
Definition SubcatchData.hpp:187
std::vector< double > washoff_load
Washoff mass rate per (subcatch, pollutant) (mass/sec).
Definition SubcatchData.hpp:264
std::vector< double > ponded_depth
Current total ponded depth over subcatchment (project length units).
Definition SubcatchData.hpp:205
void save_state() noexcept
Definition SubcatchData.hpp:811
std::vector< double > frac_imperv
Fraction of area that is impervious (0–1).
Definition SubcatchData.hpp:102
std::vector< int > gw_node
Receiving node index for groundwater flow (-1 = none).
Definition SubcatchData.hpp:365
std::vector< double > gw_b1
Groundwater flow exponent B1.
Definition SubcatchData.hpp:374
std::vector< double > infil_p3
Infiltration param 3: decay (Horton), initial deficit (GA), 0 (CN).
Definition SubcatchData.hpp:167
std::vector< double > sweep_last_swept
Gap #34: days since last swept per (subcatch x landuse).
Definition SubcatchData.hpp:481
std::vector< double > total_load
Total washoff load per (subcatchment x pollutant) (mass units).
Definition SubcatchData.hpp:452
std::vector< double > ds_imperv
Depression storage depth for impervious area (project length units).
Definition SubcatchData.hpp:126
std::vector< int > subarea_routing
Inter-subarea routing mode.
Definition SubcatchData.hpp:145
void resize_washoff_load(int n_pollutants)
Definition SubcatchData.hpp:724
std::vector< double > stat_gw_sum_depth
Sum of water table height (ft, for time-avg)
Definition SubcatchData.hpp:352
std::vector< double > stat_gw_flow_vol
Cumulative lateral GW outflow (ft³)
Definition SubcatchData.hpp:349
std::vector< double > conc
Current quality concentration in subcatchment runoff.
Definition SubcatchData.hpp:275
std::vector< double > curb_length
Total curb length (project length units).
Definition SubcatchData.hpp:96