OpenSWMM Engine  6.0.0-alpha.3
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.3)
Loading...
Searching...
No Matches
SubcatchData.hpp
Go to the documentation of this file.
1
17
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
75 std::vector<std::string> snowpack_name;
76
81 std::vector<int> gage;
82
87 std::vector<double> area;
88
93 std::vector<double> width;
94
99 std::vector<double> slope;
100
105 std::vector<double> curb_length;
106
117 std::vector<double> rain_scale_factor;
118
131 std::vector<double> snow_scale_factor;
132
137 std::vector<double> frac_imperv;
138
143 std::vector<double> frac_imperv_no_store;
144
149 std::vector<double> n_imperv;
150
155 std::vector<double> n_perv;
156
161 std::vector<double> ds_imperv;
162
167 std::vector<double> ds_perv;
168
169 // -----------------------------------------------------------------------
170 // Inter-subarea routing (from [SUBAREAS] section)
171 // -----------------------------------------------------------------------
172
180 std::vector<int> subarea_routing;
181
188 std::vector<double> pct_routed;
189
190 // -----------------------------------------------------------------------
191 // Infiltration parameters (per subcatchment)
192 // -----------------------------------------------------------------------
193
195 std::vector<int> infil_model;
196
198 std::vector<double> infil_p1;
200 std::vector<double> infil_p2;
202 std::vector<double> infil_p3;
204 std::vector<double> infil_p4;
206 std::vector<double> infil_p5;
207
208 // -----------------------------------------------------------------------
209 // State variables — updated each timestep
210 // -----------------------------------------------------------------------
211
216 std::vector<double> runoff;
217
222 std::vector<double> rainfall;
223
228 std::vector<double> evap_loss;
229
234 std::vector<double> infil_loss;
235
240 std::vector<double> ponded_depth;
241
246 std::vector<double> gw_flow;
247
248 // -----------------------------------------------------------------------
249 // Previous-step state
250 // -----------------------------------------------------------------------
251
253 std::vector<double> old_runoff;
254
256 std::vector<double> old_gw_flow;
257
258 // -----------------------------------------------------------------------
259 // Runon coupling — subcatch-to-subcatch routing
260 // -----------------------------------------------------------------------
261
264 std::vector<double> runon_inflow;
265
267 std::vector<double> old_runon_inflow;
268
272 std::vector<double> outfall_runon_vol;
273
274 // -----------------------------------------------------------------------
275 // Groundwater surface water head coupling
276 // -----------------------------------------------------------------------
277
280 std::vector<double> gw_sw_head;
281
283 std::vector<double> gw_node_avail_flow;
284
291 std::vector<double> gw_max_infil_vol;
292
293 // -----------------------------------------------------------------------
294 // Quality washoff output
295 // -----------------------------------------------------------------------
296
299 std::vector<double> washoff_load;
300
301 // -----------------------------------------------------------------------
302 // Per-subcatch quality state — flat 2D: [subcatch * n_pollutants + pollutant]
303 // -----------------------------------------------------------------------
304
310 std::vector<double> conc;
311
313 std::vector<double> conc_old;
314
321 std::vector<double> ponded_qual;
322
325
326 // -----------------------------------------------------------------------
327 // Per-object INP comment
328 // -----------------------------------------------------------------------
329
335 std::vector<std::string> comments;
336
343 std::vector<std::string> tags;
344
345 // -----------------------------------------------------------------------
346 // Report flag — per-object output filter
347 // -----------------------------------------------------------------------
348
351 std::vector<char> rpt_flag;
352
353 // -----------------------------------------------------------------------
354 // Cumulative statistics
355 // -----------------------------------------------------------------------
356
361 std::vector<double> stat_precip_vol;
362 std::vector<double> stat_evap_vol;
363 std::vector<double> stat_infil_vol;
364 std::vector<double> stat_imperv_vol;
365 std::vector<double> stat_perv_vol;
366
371 std::vector<double> stat_runoff_vol;
372
377 std::vector<double> stat_max_runoff;
378
379 // Gap #63: Per-subcatch groundwater statistics (accumulated each GW step)
380 std::vector<double> stat_gw_infil_vol;
381 std::vector<double> stat_gw_upper_evap_vol;
382 std::vector<double> stat_gw_lower_evap_vol;
383 std::vector<double> stat_gw_deep_perc_vol;
384 std::vector<double> stat_gw_flow_vol;
385 std::vector<double> stat_gw_max_flow;
386 std::vector<double> stat_gw_sum_theta;
387 std::vector<double> stat_gw_sum_depth;
388 std::vector<double> stat_gw_final_theta;
389 std::vector<double> stat_gw_final_depth;
390 std::vector<long> stat_gw_steps;
391
392 // -----------------------------------------------------------------------
393 // Groundwater parameters (from [GROUNDWATER] section)
394 // -----------------------------------------------------------------------
395
397 std::vector<int> gw_aquifer;
398
400 std::vector<int> gw_node;
401
403 std::vector<double> gw_surf_elev;
404
406 std::vector<double> gw_a1;
407
409 std::vector<double> gw_b1;
410
412 std::vector<double> gw_a2;
413
415 std::vector<double> gw_b2;
416
418 std::vector<double> gw_a3;
419
421 std::vector<double> gw_tw;
422
424 std::vector<double> gw_hstar;
425
426 // -----------------------------------------------------------------------
427 // Snowpack assignment (index into SnowpackStore, -1 = none)
428 // -----------------------------------------------------------------------
429
431 std::vector<int> snowpack;
432
440 std::vector<double> snow_net_imperv;
441
449 std::vector<double> snow_net_perv;
450
458 std::vector<double> total_lid_area_ft2;
459
467 std::vector<double> lid_return_to_perv_cfs;
468
477 std::vector<double> lid_drain_runon_cfs;
478
479 // -----------------------------------------------------------------------
480 // Cumulative pollutant washoff loads — flat 2D: [subcatch * n_pollutants + pollutant]
481 // -----------------------------------------------------------------------
482
487 std::vector<double> total_load;
488
491
492 void resize_total_load(int n_sc, int n_poll) {
494 total_load.assign(
495 static_cast<std::size_t>(n_sc) * static_cast<std::size_t>(n_poll), 0.0);
496 }
497
498 // -----------------------------------------------------------------------
499 // Land-use coverage — flat 2D: [subcatch * n_landuses + landuse]
500 // -----------------------------------------------------------------------
501
506 std::vector<double> coverage;
507
510
516 std::vector<double> sweep_last_swept;
517
523 void resize_coverage(int n_sc, int n_lu) {
524 coverage_n_landuses = n_lu;
525 auto sz = static_cast<std::size_t>(n_sc) * static_cast<std::size_t>(n_lu);
526 coverage.assign(sz, 0.0);
527 sweep_last_swept.assign(sz, 0.0);
528 }
529
530 // -----------------------------------------------------------------------
531 // Capacity management
532 // -----------------------------------------------------------------------
533
534 int count() const noexcept { return static_cast<int>(area.size()); }
535
536 void resize(int n) {
537 const auto un = static_cast<std::size_t>(n);
538
539 outlet_node.assign(un, -1);
540 outlet_subcatch.assign(un, -1);
541 outlet_name.resize(un);
542 snowpack_name.resize(un);
543 gage.assign(un, -1);
544 area.assign(un, 0.0);
545 width.assign(un, 0.0);
546 slope.assign(un, 0.0);
547 curb_length.assign(un, 0.0);
548 rain_scale_factor.assign(un, 1.0);
549 snow_scale_factor.assign(un, 1.0);
550 frac_imperv.assign(un, 0.0);
551 frac_imperv_no_store.assign(un, 0.0);
552 n_imperv.assign(un, 0.013);
553 n_perv.assign(un, 0.1);
554 ds_imperv.assign(un, 0.0);
555 ds_perv.assign(un, 0.0);
556 subarea_routing.assign(un, 0); // TO_OUTLET
557 pct_routed.assign(un, 0.0);
558
559 infil_model.assign(un, 0);
560 infil_p1.assign(un, 0.0);
561 infil_p2.assign(un, 0.0);
562 infil_p3.assign(un, 0.0);
563 infil_p4.assign(un, 0.0);
564 infil_p5.assign(un, 0.0);
565
566 runoff.assign(un, 0.0);
567 rainfall.assign(un, 0.0);
568 evap_loss.assign(un, 0.0);
569 infil_loss.assign(un, 0.0);
570 ponded_depth.assign(un, 0.0);
571 gw_flow.assign(un, 0.0);
572 old_runoff.assign(un, 0.0);
573 old_gw_flow.assign(un, 0.0);
574 runon_inflow.assign(un, 0.0);
575 old_runon_inflow.assign(un, 0.0);
576 outfall_runon_vol.assign(un, 0.0);
577 gw_sw_head.assign(un, 0.0);
578 gw_node_avail_flow.assign(un, 0.0);
579 gw_max_infil_vol.assign(un, std::numeric_limits<double>::max());
580
581 comments.assign(un, std::string{});
582 tags.assign(un, std::string{});
583
584 rpt_flag.assign(un, 0);
585
586 stat_precip_vol.assign(un, 0.0);
587 stat_evap_vol.assign(un, 0.0);
588 stat_infil_vol.assign(un, 0.0);
589 stat_imperv_vol.assign(un, 0.0);
590 stat_perv_vol.assign(un, 0.0);
591 stat_runoff_vol.assign(un, 0.0);
592 stat_max_runoff.assign(un, 0.0);
593 stat_gw_infil_vol.assign(un, 0.0);
594 stat_gw_upper_evap_vol.assign(un, 0.0);
595 stat_gw_lower_evap_vol.assign(un, 0.0);
596 stat_gw_deep_perc_vol.assign(un, 0.0);
597 stat_gw_flow_vol.assign(un, 0.0);
598 stat_gw_max_flow.assign(un, 0.0);
599 stat_gw_sum_theta.assign(un, 0.0);
600 stat_gw_sum_depth.assign(un, 0.0);
601 stat_gw_final_theta.assign(un, 0.0);
602 stat_gw_final_depth.assign(un, 0.0);
603 stat_gw_steps.assign(un, 0L);
604
605 gw_aquifer.assign(un, -1);
606 gw_node.assign(un, -1);
607 gw_surf_elev.assign(un, 0.0);
608 gw_a1.assign(un, 0.0);
609 gw_b1.assign(un, 0.0);
610 gw_a2.assign(un, 0.0);
611 gw_b2.assign(un, 0.0);
612 gw_a3.assign(un, 0.0);
613 gw_tw.assign(un, 0.0);
614 gw_hstar.assign(un, 0.0);
615 snowpack.assign(un, -1);
616 snow_net_imperv.assign(un, -1.0);
617 snow_net_perv.assign(un, -1.0);
618 total_lid_area_ft2.assign(un, 0.0);
619 lid_return_to_perv_cfs.assign(un, 0.0);
620 lid_drain_runon_cfs.assign(un, 0.0);
621 }
622
626 void grow_to(int n) {
627 if (n <= count()) return;
628 const auto un = static_cast<std::size_t>(n);
629 auto g = [&](auto& vec, auto def) { vec.resize(un, def); };
630 g(outlet_node, -1); g(outlet_subcatch, -1);
631 outlet_name.resize(un); snowpack_name.resize(un); g(gage, -1);
632 g(area, 0.0); g(width, 0.0); g(slope, 0.0); g(curb_length, 0.0);
633 g(rain_scale_factor, 1.0); g(snow_scale_factor, 1.0);
634 g(frac_imperv, 0.0); g(frac_imperv_no_store, 0.0);
635 g(n_imperv, 0.013); g(n_perv, 0.1);
636 g(ds_imperv, 0.0); g(ds_perv, 0.0);
637 g(subarea_routing, 0); g(pct_routed, 0.0);
638 g(infil_model, 0);
639 g(infil_p1, 0.0); g(infil_p2, 0.0); g(infil_p3, 0.0);
640 g(infil_p4, 0.0); g(infil_p5, 0.0);
641 g(runoff, 0.0); g(rainfall, 0.0);
642 g(evap_loss, 0.0); g(infil_loss, 0.0);
643 g(ponded_depth, 0.0); g(gw_flow, 0.0);
644 g(old_runoff, 0.0); g(old_gw_flow, 0.0);
645 g(runon_inflow, 0.0); g(old_runon_inflow, 0.0);
646 g(gw_sw_head, 0.0); g(gw_node_avail_flow, 0.0);
647 g(gw_max_infil_vol, std::numeric_limits<double>::max());
648 g(outfall_runon_vol, 0.0);
649 comments.resize(un, std::string{});
650 tags.resize(un, std::string{});
651
652 g(rpt_flag, static_cast<char>(0));
653 g(stat_precip_vol, 0.0); g(stat_evap_vol, 0.0);
654 g(stat_infil_vol, 0.0); g(stat_imperv_vol, 0.0);
655 g(stat_perv_vol, 0.0); g(stat_runoff_vol, 0.0);
656 g(stat_max_runoff, 0.0);
659 g(stat_gw_flow_vol, 0.0); g(stat_gw_max_flow, 0.0);
660 g(stat_gw_sum_theta, 0.0); g(stat_gw_sum_depth, 0.0);
662 stat_gw_steps.resize(un, 0L);
663 g(gw_aquifer, -1); g(gw_node, -1); g(gw_surf_elev, 0.0);
664 g(gw_a1, 0.0); g(gw_b1, 0.0); g(gw_a2, 0.0); g(gw_b2, 0.0);
665 g(gw_a3, 0.0); g(gw_tw, 0.0); g(gw_hstar, 0.0);
666 g(snowpack, -1);
667 g(snow_net_imperv, -1.0);
668 g(snow_net_perv, -1.0);
669 g(total_lid_area_ft2, 0.0);
671 g(lid_drain_runon_cfs, 0.0);
672 // Note: conc, conc_old, ponded_qual, washoff_load handled by resize_quality()
673 // Note: coverage, total_load handled separately
674 }
675
684 void erase_at(int idx) {
685 const auto ui = static_cast<std::size_t>(idx);
686 auto e = [&](auto& v) { if (ui < v.size()) v.erase(v.begin() + static_cast<std::ptrdiff_t>(idx)); };
687
689 e(area); e(width); e(slope); e(curb_length);
693
694 e(infil_model); e(infil_p1); e(infil_p2); e(infil_p3); e(infil_p4); e(infil_p5);
695
697 e(gw_flow); e(old_runoff); e(old_gw_flow);
700 e(comments); e(tags); e(rpt_flag);
701
708
710 e(gw_a1); e(gw_b1); e(gw_a2); e(gw_b2); e(gw_a3); e(gw_tw); e(gw_hstar);
713
714 // Flat 2D quality arrays: [sc * np + p]
715 if (conc_n_pollutants > 0) {
716 const auto np = static_cast<std::size_t>(conc_n_pollutants);
717 const auto base = ui * np;
718 auto erase2d = [&](auto& v) {
719 if (base + np <= v.size())
720 v.erase(v.begin() + static_cast<std::ptrdiff_t>(base),
721 v.begin() + static_cast<std::ptrdiff_t>(base + np));
722 };
723 erase2d(conc); erase2d(conc_old); erase2d(ponded_qual); erase2d(washoff_load);
724 }
725
726 // Flat 2D total load: [sc * np + p]
727 if (total_load_n_pollutants > 0) {
728 const auto np = static_cast<std::size_t>(total_load_n_pollutants);
729 const auto base = ui * np;
730 if (base + np <= total_load.size())
731 total_load.erase(
732 total_load.begin() + static_cast<std::ptrdiff_t>(base),
733 total_load.begin() + static_cast<std::ptrdiff_t>(base + np));
734 }
735
736 // Flat 2D coverage/sweep matrices: [sc * n_lu + lu]
737 if (coverage_n_landuses > 0) {
738 const auto nlu = static_cast<std::size_t>(coverage_n_landuses);
739 const auto base = ui * nlu;
740 auto erase2d = [&](auto& v) {
741 if (base + nlu <= v.size())
742 v.erase(v.begin() + static_cast<std::ptrdiff_t>(base),
743 v.begin() + static_cast<std::ptrdiff_t>(base + nlu));
744 };
745 erase2d(coverage); erase2d(sweep_last_swept);
746 }
747 }
748
752 void resize_quality(int n_pollutants) {
753 conc_n_pollutants = n_pollutants;
754 if (n_pollutants > 0) {
755 auto total = static_cast<std::size_t>(count()) *
756 static_cast<std::size_t>(n_pollutants);
757 conc.assign(total, 0.0);
758 conc_old.assign(total, 0.0);
759 ponded_qual.assign(total, 0.0);
760 washoff_load.assign(total, 0.0);
761 }
762 }
763
764 void resize_washoff_load(int n_pollutants) {
765 if (n_pollutants > 0) {
766 washoff_load.assign(
767 static_cast<std::size_t>(count()) *
768 static_cast<std::size_t>(n_pollutants), 0.0);
769 }
770 }
771
776 outlet_node.shrink_to_fit();
777 outlet_subcatch.shrink_to_fit();
778 outlet_name.shrink_to_fit();
779 gage.shrink_to_fit();
780 area.shrink_to_fit();
781 width.shrink_to_fit();
782 slope.shrink_to_fit();
783 curb_length.shrink_to_fit();
784 rain_scale_factor.shrink_to_fit();
785 snow_scale_factor.shrink_to_fit();
786 frac_imperv.shrink_to_fit();
787 frac_imperv_no_store.shrink_to_fit();
788 n_imperv.shrink_to_fit();
789 n_perv.shrink_to_fit();
790 ds_imperv.shrink_to_fit();
791 ds_perv.shrink_to_fit();
792 subarea_routing.shrink_to_fit();
793 pct_routed.shrink_to_fit();
794
795 infil_model.shrink_to_fit();
796 infil_p1.shrink_to_fit();
797 infil_p2.shrink_to_fit();
798 infil_p3.shrink_to_fit();
799 infil_p4.shrink_to_fit();
800 infil_p5.shrink_to_fit();
801
802 runoff.shrink_to_fit();
803 rainfall.shrink_to_fit();
804 evap_loss.shrink_to_fit();
805 infil_loss.shrink_to_fit();
806 ponded_depth.shrink_to_fit();
807 gw_flow.shrink_to_fit();
808 old_runoff.shrink_to_fit();
809 old_gw_flow.shrink_to_fit();
810 runon_inflow.shrink_to_fit();
811 old_runon_inflow.shrink_to_fit();
812 outfall_runon_vol.shrink_to_fit();
813 gw_sw_head.shrink_to_fit();
814 gw_node_avail_flow.shrink_to_fit();
815 gw_max_infil_vol.shrink_to_fit();
816
817 comments.shrink_to_fit();
818 tags.shrink_to_fit();
819
820 rpt_flag.shrink_to_fit();
821
822 stat_precip_vol.shrink_to_fit();
823 stat_evap_vol.shrink_to_fit();
824 stat_infil_vol.shrink_to_fit();
825 stat_imperv_vol.shrink_to_fit();
826 stat_perv_vol.shrink_to_fit();
827 stat_runoff_vol.shrink_to_fit();
828 stat_max_runoff.shrink_to_fit();
829
830 gw_aquifer.shrink_to_fit();
831 gw_node.shrink_to_fit();
832 gw_surf_elev.shrink_to_fit();
833 gw_a1.shrink_to_fit();
834 gw_b1.shrink_to_fit();
835 gw_a2.shrink_to_fit();
836 gw_b2.shrink_to_fit();
837 gw_a3.shrink_to_fit();
838 gw_tw.shrink_to_fit();
839 gw_hstar.shrink_to_fit();
840 snowpack.shrink_to_fit();
841 snow_net_imperv.shrink_to_fit();
842 snow_net_perv.shrink_to_fit();
843
844 conc.shrink_to_fit();
845 conc_old.shrink_to_fit();
846 ponded_qual.shrink_to_fit();
847 washoff_load.shrink_to_fit();
848 total_load.shrink_to_fit();
849 coverage.shrink_to_fit();
850 sweep_last_swept.shrink_to_fit();
851 }
852
853 void save_state() noexcept {
854 std::copy(runoff.begin(), runoff.end(), old_runoff.begin());
855 std::copy(runon_inflow.begin(), runon_inflow.end(), old_runon_inflow.begin());
856 std::copy(conc.begin(), conc.end(), conc_old.begin());
857 }
858
859 void reset_state() noexcept {
860 std::fill(runoff.begin(), runoff.end(), 0.0);
861 std::fill(rainfall.begin(), rainfall.end(), 0.0);
862 std::fill(snow_net_imperv.begin(), snow_net_imperv.end(), -1.0);
863 std::fill(snow_net_perv.begin(), snow_net_perv.end(), -1.0);
864 std::fill(evap_loss.begin(), evap_loss.end(), 0.0);
865 std::fill(infil_loss.begin(), infil_loss.end(), 0.0);
866 std::fill(ponded_depth.begin(), ponded_depth.end(), 0.0);
867 std::fill(old_runoff.begin(), old_runoff.end(), 0.0);
868 std::fill(old_gw_flow.begin(), old_gw_flow.end(), 0.0);
869 std::fill(runon_inflow.begin(), runon_inflow.end(), 0.0);
870 std::fill(old_runon_inflow.begin(), old_runon_inflow.end(), 0.0);
871 std::fill(gw_sw_head.begin(), gw_sw_head.end(), 0.0);
872 std::fill(gw_node_avail_flow.begin(), gw_node_avail_flow.end(), 0.0);
873 std::fill(washoff_load.begin(), washoff_load.end(), 0.0);
874 std::fill(conc.begin(), conc.end(), 0.0);
875 std::fill(conc_old.begin(), conc_old.end(), 0.0);
876 }
877};
878
879} /* namespace openswmm */
880
881#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:81
std::vector< double > total_lid_area_ft2
Total LID area for this subcatchment (ft²).
Definition SubcatchData.hpp:458
void reset_state() noexcept
Definition SubcatchData.hpp:859
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:195
std::vector< double > gw_b2
Groundwater flow exponent B2.
Definition SubcatchData.hpp:415
std::vector< double > snow_net_perv
Snow-modified net precipitation for pervious subarea (ft/sec).
Definition SubcatchData.hpp:449
std::vector< double > stat_gw_infil_vol
Cumulative infiltration to GW (ft³)
Definition SubcatchData.hpp:380
std::vector< std::string > snowpack_name
Snow pack name string for deferred resolution.
Definition SubcatchData.hpp:75
int total_load_n_pollutants
Number of pollutants in total_load matrix.
Definition SubcatchData.hpp:490
std::vector< double > outfall_runon_vol
Gap #28: accumulated outfall-routed volume (ft³) between runoff steps.
Definition SubcatchData.hpp:272
std::vector< double > stat_precip_vol
Total precipitation volume (project volume units).
Definition SubcatchData.hpp:361
std::vector< double > gw_surf_elev
Surface elevation for groundwater calculations.
Definition SubcatchData.hpp:403
std::vector< double > gw_sw_head
Surface water head at GW receiving node (project length units).
Definition SubcatchData.hpp:280
void resize_quality(int n_pollutants)
Resize per-subcatch quality arrays after pollutant count is known.
Definition SubcatchData.hpp:752
std::vector< double > slope
Average slope of catchment (fraction).
Definition SubcatchData.hpp:99
std::vector< double > infil_p1
Infiltration param 1: f0 (Horton), suction (GA), CN (CN).
Definition SubcatchData.hpp:198
std::vector< double > old_gw_flow
GW flow at the previous runoff evaluation (for interpolation).
Definition SubcatchData.hpp:256
std::vector< int > snowpack
Snowpack index for this subcatchment (-1 = none).
Definition SubcatchData.hpp:431
std::vector< double > gw_tw
Threshold groundwater table elevation.
Definition SubcatchData.hpp:421
std::vector< double > evap_loss
Current evaporation loss rate (project length/time units).
Definition SubcatchData.hpp:228
std::vector< double > old_runoff
Runoff at the previous timestep.
Definition SubcatchData.hpp:253
std::vector< double > gw_node_avail_flow
Available node flow for GW negative flow limit (cfs/ft2).
Definition SubcatchData.hpp:283
std::vector< double > stat_infil_vol
Cumulative infiltration volume (ft3)
Definition SubcatchData.hpp:363
std::vector< double > gw_flow
Groundwater outflow rate (project flow units).
Definition SubcatchData.hpp:246
std::vector< double > stat_evap_vol
Cumulative evaporation volume (ft3)
Definition SubcatchData.hpp:362
std::vector< double > stat_gw_sum_theta
Sum of upper-zone theta (for time-avg)
Definition SubcatchData.hpp:386
std::vector< double > stat_perv_vol
Cumulative pervious runoff volume (ft3)
Definition SubcatchData.hpp:365
std::vector< double > snow_scale_factor
Subcatchment-level snowfall scale factor (default 1.0 = no scaling).
Definition SubcatchData.hpp:131
std::vector< double > area
Subcatchment area (project area units).
Definition SubcatchData.hpp:87
std::vector< double > gw_a3
Groundwater flow coefficient A3.
Definition SubcatchData.hpp:418
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:424
int coverage_n_landuses
Number of landuses stored in the coverage and sweep matrices.
Definition SubcatchData.hpp:509
std::vector< std::string > comments
Object comment from the INP file (';'-prefixed lines immediately above this subcatchment's data row),...
Definition SubcatchData.hpp:335
std::vector< double > stat_gw_upper_evap_vol
Cumulative upper zone evap (ft³)
Definition SubcatchData.hpp:381
std::vector< double > old_runon_inflow
Previous-step runon inflow (for interpolation).
Definition SubcatchData.hpp:267
std::vector< double > stat_runoff_vol
Total runoff volume (project volume units).
Definition SubcatchData.hpp:371
std::vector< double > n_imperv
Manning's n for impervious area.
Definition SubcatchData.hpp:149
std::vector< double > lid_drain_runon_cfs
LID drain flow routed to a target subcatchment (CFS).
Definition SubcatchData.hpp:477
std::vector< double > n_perv
Manning's n for pervious area.
Definition SubcatchData.hpp:155
std::vector< double > infil_p4
Infiltration param 4: dry time (Horton), 0 (GA/CN).
Definition SubcatchData.hpp:204
void resize_coverage(int n_sc, int n_lu)
Resize the coverage and sweep matrices.
Definition SubcatchData.hpp:523
std::vector< double > lid_return_to_perv_cfs
LID surface return flow to pervious area (CFS).
Definition SubcatchData.hpp:467
std::vector< std::string > tags
Per-object tag from the INP [TAGS] section.
Definition SubcatchData.hpp:343
std::vector< double > runon_inflow
Runoff inflow from upstream subcatchments (project flow units).
Definition SubcatchData.hpp:264
std::vector< double > rain_scale_factor
Subcatchment-level rainfall scale factor (default 1.0 = no scaling).
Definition SubcatchData.hpp:117
std::vector< double > stat_gw_final_theta
Upper-zone theta at last GW step.
Definition SubcatchData.hpp:388
std::vector< double > gw_a2
Groundwater flow coefficient A2.
Definition SubcatchData.hpp:412
std::vector< double > stat_gw_lower_evap_vol
Cumulative lower zone evap (ft³)
Definition SubcatchData.hpp:382
int conc_n_pollutants
Number of pollutants in the quality arrays.
Definition SubcatchData.hpp:324
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:383
std::vector< double > stat_imperv_vol
Cumulative impervious runoff volume (ft3)
Definition SubcatchData.hpp:364
std::vector< double > ponded_qual
Ponded surface water quality mass per (subcatch, pollutant).
Definition SubcatchData.hpp:321
std::vector< double > pct_routed
Fraction of runoff routed between subareas (0–1).
Definition SubcatchData.hpp:188
std::vector< double > infil_p2
Infiltration param 2: fmin (Horton), conductivity (GA), 0 (CN).
Definition SubcatchData.hpp:200
std::vector< double > stat_gw_max_flow
Peak lateral GW outflow (CFS)
Definition SubcatchData.hpp:385
std::vector< double > gw_a1
Groundwater flow coefficient A1.
Definition SubcatchData.hpp:406
void resize(int n)
Definition SubcatchData.hpp:536
std::vector< double > stat_gw_final_depth
Water table height at last GW step (ft)
Definition SubcatchData.hpp:389
std::vector< double > snow_net_imperv
Snow-modified net precipitation for impervious subareas (ft/sec).
Definition SubcatchData.hpp:440
std::vector< double > ds_perv
Depression storage depth for pervious area (project length units).
Definition SubcatchData.hpp:167
std::vector< double > width
Width of overland flow path (project length units).
Definition SubcatchData.hpp:93
std::vector< double > infil_loss
Current infiltration loss rate (project length/time units).
Definition SubcatchData.hpp:234
std::vector< double > frac_imperv_no_store
Fraction of impervious area with no depression storage (0–1).
Definition SubcatchData.hpp:143
std::vector< double > conc_old
Previous-step quality in subcatchment runoff.
Definition SubcatchData.hpp:313
int count() const noexcept
Definition SubcatchData.hpp:534
void erase_at(int idx)
Erase the subcatchment at index idx from every parallel array.
Definition SubcatchData.hpp:684
std::vector< double > gw_max_infil_vol
Gap #40: max infiltration volume (ft) upper GW zone can accept next step.
Definition SubcatchData.hpp:291
void resize_total_load(int n_sc, int n_poll)
Definition SubcatchData.hpp:492
std::vector< char > rpt_flag
Whether this subcatchment is included in report/output (0=no, 1=yes).
Definition SubcatchData.hpp:351
std::vector< int > gw_aquifer
Aquifer index for this subcatchment (-1 = none).
Definition SubcatchData.hpp:397
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:626
std::vector< double > runoff
Current total runoff flow rate (project flow units).
Definition SubcatchData.hpp:216
void shrink_to_fit()
Release excess vector capacity accumulated during parsing.
Definition SubcatchData.hpp:775
std::vector< double > coverage
Coverage fraction per (subcatchment x landuse).
Definition SubcatchData.hpp:506
std::vector< double > stat_max_runoff
Maximum reported runoff rate (project flow units).
Definition SubcatchData.hpp:377
std::vector< double > infil_p5
Infiltration param 5: max infil (Horton), 0 (GA/CN).
Definition SubcatchData.hpp:206
std::vector< long > stat_gw_steps
Step count for GW averages.
Definition SubcatchData.hpp:390
std::vector< double > rainfall
Current total rainfall depth rate (project length/time units).
Definition SubcatchData.hpp:222
std::vector< double > washoff_load
Washoff mass rate per (subcatch, pollutant) (mass/sec).
Definition SubcatchData.hpp:299
std::vector< double > ponded_depth
Current total ponded depth over subcatchment (project length units).
Definition SubcatchData.hpp:240
void save_state() noexcept
Definition SubcatchData.hpp:853
std::vector< double > frac_imperv
Fraction of area that is impervious (0–1).
Definition SubcatchData.hpp:137
std::vector< int > gw_node
Receiving node index for groundwater flow (-1 = none).
Definition SubcatchData.hpp:400
std::vector< double > gw_b1
Groundwater flow exponent B1.
Definition SubcatchData.hpp:409
std::vector< double > infil_p3
Infiltration param 3: decay (Horton), initial deficit (GA), 0 (CN).
Definition SubcatchData.hpp:202
std::vector< double > sweep_last_swept
Gap #34: days since last swept per (subcatch x landuse).
Definition SubcatchData.hpp:516
std::vector< double > total_load
Total washoff load per (subcatchment x pollutant) (mass units).
Definition SubcatchData.hpp:487
std::vector< double > ds_imperv
Depression storage depth for impervious area (project length units).
Definition SubcatchData.hpp:161
std::vector< int > subarea_routing
Inter-subarea routing mode.
Definition SubcatchData.hpp:180
void resize_washoff_load(int n_pollutants)
Definition SubcatchData.hpp:764
std::vector< double > stat_gw_sum_depth
Sum of water table height (ft, for time-avg)
Definition SubcatchData.hpp:387
std::vector< double > stat_gw_flow_vol
Cumulative lateral GW outflow (ft³)
Definition SubcatchData.hpp:384
std::vector< double > conc
Current quality concentration in subcatchment runoff.
Definition SubcatchData.hpp:310
std::vector< double > curb_length
Total curb length (project length units).
Definition SubcatchData.hpp:105