OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
NodeData.hpp
Go to the documentation of this file.
1
25#ifndef OPENSWMM_ENGINE_NODE_DATA_HPP
26#define OPENSWMM_ENGINE_NODE_DATA_HPP
27
28#include <vector>
29#include <cstdint>
30#include <string>
31#include <algorithm>
32
33namespace openswmm {
34
35// ============================================================================
36// Node type enumeration
37// ============================================================================
38
43enum class NodeType : int8_t {
44 JUNCTION = 0,
45 OUTFALL = 1,
46 DIVIDER = 2,
47 STORAGE = 3
48};
49
54enum class OutfallType : int8_t {
55 FREE = 0,
56 NORMAL = 1,
57 FIXED = 2,
58 TIDAL = 3,
59 TIMESERIES = 4
60};
61
66enum class DividerType : int8_t {
67 CUTOFF = 0,
68 OVERFLOW_DIV = 1,
69 TABULAR = 2,
70 WEIR = 3
71};
72
73// ============================================================================
74// NodeData — SoA layout
75// ============================================================================
76
90struct NodeData {
91
92 // -----------------------------------------------------------------------
93 // Static properties — set at parse time
94 // -----------------------------------------------------------------------
95
97 std::vector<NodeType> type;
98
103 std::vector<double> invert_elev;
104
109 std::vector<double> full_depth;
110
115 std::vector<double> init_depth;
116
121 std::vector<double> sur_depth;
122
127 std::vector<double> ponded_area;
128
129 // -----------------------------------------------------------------------
130 // Outfall-specific properties (valid when type[i] == OUTFALL)
131 // -----------------------------------------------------------------------
132
134 std::vector<OutfallType> outfall_type;
135
141 std::vector<double> outfall_param;
142
144 std::vector<uint8_t> outfall_has_flap_gate;
145
148 std::vector<int> outfall_route_to;
149
156 std::vector<int> outfall_link_idx;
157
160 std::vector<double> outfall_link_offset;
161
179 std::vector<double> outfall_2d_head;
180
181 // -----------------------------------------------------------------------
182 // Storage-specific properties (valid when type[i] == STORAGE)
183 // -----------------------------------------------------------------------
184
189 std::vector<int> storage_curve;
190
192 std::vector<std::string> storage_curve_name;
193
195 std::vector<double> storage_a;
197 std::vector<double> storage_b;
199 std::vector<double> storage_c;
200
202 std::vector<double> storage_seep_rate;
203
205 std::vector<double> storage_evap_frac;
206
208 std::vector<double> storage_evap_loss;
209
211 std::vector<double> storage_exfil_loss;
212
214 std::vector<double> exfil_suction;
216 std::vector<double> exfil_ksat;
218 std::vector<double> exfil_imd;
219
220 // -----------------------------------------------------------------------
221 // Divider-specific properties (valid when type[i] == DIVIDER)
222 // -----------------------------------------------------------------------
223
225 std::vector<DividerType> divider_type;
226
228 std::vector<double> divider_cutoff;
229
231 std::vector<double> divider_cd;
232
234 std::vector<double> divider_max_depth;
235
237 std::vector<int> divider_curve;
238
240 std::vector<int> divider_link;
241
243 std::vector<std::string> divider_link_name;
244
246 std::vector<std::string> divider_curve_name;
247
248 // -----------------------------------------------------------------------
249 // State variables — updated each timestep
250 // -----------------------------------------------------------------------
251
256 std::vector<double> depth;
257
262 std::vector<double> head;
263
268 std::vector<double> volume;
269
274 std::vector<double> lat_flow;
275
283 std::vector<double> user_lat_flow;
284
285 // -----------------------------------------------------------------------
286 // Decomposed lateral inflow sources
287 // Each source process writes to its own buffer.
288 // assembleLateralInflows() sums them all into lat_flow.
289 // -----------------------------------------------------------------------
290
292 std::vector<double> runoff_inflow;
293
295 std::vector<double> gw_inflow;
296
298 std::vector<double> ext_inflow;
299
301 std::vector<double> dwf_inflow;
302
304 std::vector<double> rdii_inflow;
305
307 std::vector<double> iface_inflow;
308
330 std::vector<double> coupling_inflow;
331
332 // -----------------------------------------------------------------------
333 // Quality mass inflow assembly arrays
334 // assembleQualityInflows() writes these; mixAtNodes() reads them.
335 // -----------------------------------------------------------------------
336
339 std::vector<double> qual_mass_in;
340
342 std::vector<double> qual_vol_in;
343
353 std::vector<double> lid_drain_qual_load;
354
361 std::vector<double> lid_drain_qual_vol;
362
363 // -----------------------------------------------------------------------
364 // Per-node quality state — flat 2D: [node * n_pollutants + pollutant]
365 // -----------------------------------------------------------------------
366
372 std::vector<double> conc;
373
375 std::vector<double> conc_old;
376
378 std::vector<double> hrt;
379
389 std::vector<double> user_conc_mass_flux;
390
393
398 std::vector<double> inflow;
399
404 std::vector<double> outflow;
405
410 std::vector<double> overflow;
411
416 std::vector<double> losses;
417
422 std::vector<double> crown_elev;
423
428 std::vector<int> degree;
429
434 std::vector<double> old_net_inflow;
435
440 std::vector<double> full_volume;
441
442 // -----------------------------------------------------------------------
443 // Previous-step state (for output interpolation / CFL checks)
444 // -----------------------------------------------------------------------
445
447 std::vector<double> old_depth;
448
450 std::vector<double> old_volume;
451
453 std::vector<double> old_lat_flow;
454
455 // -----------------------------------------------------------------------
456 // Per-object INP comment
457 // -----------------------------------------------------------------------
458
468 std::vector<std::string> comments;
469
481 std::vector<std::string> tags;
482
483 // -----------------------------------------------------------------------
484 // Report flag — per-object output filter
485 // -----------------------------------------------------------------------
486
489 std::vector<char> rpt_flag;
490
491 // -----------------------------------------------------------------------
492 // Cumulative statistics
493 // -----------------------------------------------------------------------
494
499 std::vector<double> stat_vol_flooded;
500
505 std::vector<double> stat_time_flooded;
506
511 std::vector<double> stat_max_depth;
512
517 std::vector<double> stat_max_overflow;
518
520 std::vector<double> stat_max_overflow_date;
521
524 std::vector<double> stat_sum_depth;
525
528 std::vector<double> stat_max_depth_date;
529
532 std::vector<double> stat_max_rpt_depth;
533
536 std::vector<double> stat_max_inflow_date;
537
540 std::vector<double> stat_time_surcharged;
541
544 std::vector<double> stat_max_surcharge_height;
545
550 std::vector<double> stat_outfall_avg_flow;
551
554 std::vector<double> stat_max_lat_inflow;
555
558 std::vector<double> stat_max_total_inflow;
559
562 std::vector<double> stat_lat_inflow_vol;
563
565 std::vector<double> stat_total_inflow_vol;
566
569 std::vector<double> stat_total_outflow_vol;
570
575 std::vector<double> stat_outfall_max_flow;
576
581 std::vector<long> stat_outfall_periods;
582
589 std::vector<int> stat_non_converged_count;
590
598 std::vector<double> stat_time_courant_critical;
599
606 std::vector<double> stat_total_load;
608
609 // -----------------------------------------------------------------------
610 // Capacity management
611 // -----------------------------------------------------------------------
612
614 int count() const noexcept { return static_cast<int>(type.size()); }
615
623 void resize(int n) {
624 const auto un = static_cast<std::size_t>(n);
625 type.assign(un, NodeType::JUNCTION);
626 invert_elev.assign(un, 0.0);
627 full_depth.assign(un, 0.0);
628 init_depth.assign(un, 0.0);
629 sur_depth.assign(un, 0.0);
630 ponded_area.assign(un, 0.0);
631
633 outfall_param.assign(un, 0.0);
634 outfall_has_flap_gate.assign(un, 0);
635 outfall_route_to.assign(un, -1);
636 outfall_link_idx.assign(un, -1);
637 outfall_link_offset.assign(un, 0.0);
638 outfall_2d_head.assign(un, -1.0e30);
639
640 storage_curve.assign(un, -1);
641 storage_curve_name.resize(un);
642 storage_a.assign(un, 0.0);
643 storage_b.assign(un, 0.0);
644 storage_c.assign(un, 0.0);
645 storage_seep_rate.assign(un, 0.0);
646 storage_evap_frac.assign(un, 0.0);
647 storage_evap_loss.assign(un, 0.0);
648 storage_exfil_loss.assign(un, 0.0);
649 exfil_suction.assign(un, 0.0);
650 exfil_ksat.assign(un, 0.0);
651 exfil_imd.assign(un, 0.0);
652
654 divider_cutoff.assign(un, 0.0);
655 divider_cd.assign(un, 0.0);
656 divider_max_depth.assign(un, 0.0);
657 divider_curve.assign(un, -1);
658 divider_link.assign(un, -1);
659 divider_link_name.resize(un);
660 divider_curve_name.resize(un);
661
662 depth.assign(un, 0.0);
663 head.assign(un, 0.0);
664 volume.assign(un, 0.0);
665 lat_flow.assign(un, 0.0);
666 user_lat_flow.assign(un, 0.0);
667 runoff_inflow.assign(un, 0.0);
668 gw_inflow.assign(un, 0.0);
669 ext_inflow.assign(un, 0.0);
670 dwf_inflow.assign(un, 0.0);
671 rdii_inflow.assign(un, 0.0);
672 iface_inflow.assign(un, 0.0);
673 coupling_inflow.assign(un, 0.0);
674 qual_mass_in.clear();
675 qual_vol_in.assign(un, 0.0);
676 lid_drain_qual_load.clear();
677 lid_drain_qual_vol.assign(un, 0.0);
678 inflow.assign(un, 0.0);
679 outflow.assign(un, 0.0);
680 overflow.assign(un, 0.0);
681 losses.assign(un, 0.0);
682 crown_elev.assign(un, 0.0);
683 degree.assign(un, 0);
684 old_net_inflow.assign(un, 0.0);
685 full_volume.assign(un, 0.0);
686 old_depth.assign(un, 0.0);
687 old_volume.assign(un, 0.0);
688 old_lat_flow.assign(un, 0.0);
689
690 comments.assign(un, std::string{});
691 tags.assign(un, std::string{});
692
693 rpt_flag.assign(un, 0);
694
695 stat_vol_flooded.assign(un, 0.0);
696 stat_time_flooded.assign(un, 0.0);
697 stat_max_depth.assign(un, 0.0);
698 stat_max_overflow.assign(un, 0.0);
699 stat_max_overflow_date.assign(un, 0.0);
700 stat_sum_depth.assign(un, 0.0);
701 stat_max_depth_date.assign(un, 0.0);
702 stat_max_rpt_depth.assign(un, 0.0);
703 stat_max_inflow_date.assign(un, 0.0);
704 stat_time_surcharged.assign(un, 0.0);
705 stat_max_surcharge_height.assign(un, 0.0);
706 stat_max_lat_inflow.assign(un, 0.0);
707 stat_max_total_inflow.assign(un, 0.0);
708 stat_lat_inflow_vol.assign(un, 0.0);
709 stat_total_inflow_vol.assign(un, 0.0);
710 stat_total_outflow_vol.assign(un, 0.0);
711 stat_outfall_avg_flow.assign(un, 0.0);
712 stat_outfall_max_flow.assign(un, 0.0);
713 stat_outfall_periods.assign(un, 0);
714 stat_non_converged_count.assign(un, 0);
715 stat_time_courant_critical.assign(un, 0.0);
716 }
717
725 void grow_to(int n) {
726 if (n <= count()) return;
727 const auto un = static_cast<std::size_t>(n);
728 auto g = [&](auto& vec, auto def) { vec.resize(un, def); };
730 g(invert_elev, 0.0); g(full_depth, 0.0); g(init_depth, 0.0);
731 g(sur_depth, 0.0); g(ponded_area, 0.0);
733 g(outfall_has_flap_gate, uint8_t{0}); g(outfall_route_to, -1);
735 g(outfall_2d_head, -1.0e30);
736 g(storage_curve, -1); storage_curve_name.resize(un);
737 g(storage_a, 0.0); g(storage_b, 0.0); g(storage_c, 0.0);
738 g(storage_seep_rate, 0.0); g(storage_evap_frac, 0.0);
739 g(storage_evap_loss, 0.0); g(storage_exfil_loss, 0.0);
740 g(exfil_suction, 0.0); g(exfil_ksat, 0.0); g(exfil_imd, 0.0);
742 g(divider_cd, 0.0); g(divider_max_depth, 0.0);
743 g(divider_curve, -1); g(divider_link, -1);
744 divider_link_name.resize(un); divider_curve_name.resize(un);
745 g(depth, 0.0); g(head, 0.0); g(volume, 0.0);
746 g(lat_flow, 0.0); g(user_lat_flow, 0.0);
747 g(runoff_inflow, 0.0); g(gw_inflow, 0.0); g(ext_inflow, 0.0);
748 g(dwf_inflow, 0.0); g(rdii_inflow, 0.0); g(iface_inflow, 0.0);
749 g(coupling_inflow, 0.0);
750 qual_vol_in.resize(un, 0.0);
751 lid_drain_qual_vol.resize(un, 0.0);
752 g(inflow, 0.0); g(outflow, 0.0); g(overflow, 0.0);
753 g(losses, 0.0); g(crown_elev, 0.0); g(degree, 0);
754 g(old_net_inflow, 0.0); g(full_volume, 0.0);
755 g(old_depth, 0.0); g(old_volume, 0.0); g(old_lat_flow, 0.0);
756 comments.resize(un, std::string{});
757 tags.resize(un, std::string{});
758
759 g(rpt_flag, static_cast<char>(0));
760 g(stat_vol_flooded, 0.0); g(stat_time_flooded, 0.0);
761 g(stat_max_depth, 0.0); g(stat_max_overflow, 0.0);
762 g(stat_max_overflow_date, 0.0); g(stat_sum_depth, 0.0);
772 // Note: qual_mass_in, conc, conc_old, hrt handled by resize_quality()
773 }
774
784 void erase_at(int idx) {
785 const auto ui = static_cast<std::size_t>(idx);
786 auto e = [&](auto& v) { if (ui < v.size()) v.erase(v.begin() + static_cast<std::ptrdiff_t>(idx)); };
787
789
793
795 e(storage_a); e(storage_b); e(storage_c);
798
801
802 e(depth); e(head); e(volume);
803 e(lat_flow); e(user_lat_flow);
808 e(inflow); e(outflow); e(overflow); e(losses);
811 e(comments); e(tags); e(rpt_flag);
812
820
821 // Flat 2D quality arrays: [node * np + p] → erase the stride for idx
822 if (conc_n_pollutants > 0) {
823 const auto np = static_cast<std::size_t>(conc_n_pollutants);
824 const auto base = ui * np;
825 auto erase2d = [&](auto& v) {
826 if (base + np <= v.size())
827 v.erase(v.begin() + static_cast<std::ptrdiff_t>(base),
828 v.begin() + static_cast<std::ptrdiff_t>(base + np));
829 };
830 erase2d(conc); erase2d(conc_old);
831 erase2d(qual_mass_in); erase2d(lid_drain_qual_load); erase2d(user_conc_mass_flux);
832 if (ui < hrt.size()) hrt.erase(hrt.begin() + static_cast<std::ptrdiff_t>(idx));
833 }
834
835 // Flat 2D stat load: [node * np + p]
836 if (stat_n_pollutants > 0) {
837 const auto np = static_cast<std::size_t>(stat_n_pollutants);
838 const auto base = ui * np;
839 if (base + np <= stat_total_load.size())
840 stat_total_load.erase(
841 stat_total_load.begin() + static_cast<std::ptrdiff_t>(base),
842 stat_total_load.begin() + static_cast<std::ptrdiff_t>(base + np));
843 }
844 }
845
849 void resize_loads(int n_pollutants) {
850 stat_n_pollutants = n_pollutants;
851 if (n_pollutants > 0) {
852 auto total = static_cast<std::size_t>(count()) *
853 static_cast<std::size_t>(n_pollutants);
854 stat_total_load.assign(total, 0.0);
855 }
856 }
857
861 void resize_quality(int n_pollutants) {
862 conc_n_pollutants = n_pollutants;
863 if (n_pollutants > 0) {
864 auto total = static_cast<std::size_t>(count()) *
865 static_cast<std::size_t>(n_pollutants);
866 conc.assign(total, 0.0);
867 conc_old.assign(total, 0.0);
868 hrt.assign(static_cast<std::size_t>(count()), 0.0);
869 user_conc_mass_flux.assign(total, 0.0);
870 qual_mass_in.assign(total, 0.0);
871 lid_drain_qual_load.assign(total, 0.0);
872 }
873 }
874
883 type.shrink_to_fit();
884 invert_elev.shrink_to_fit();
885 full_depth.shrink_to_fit();
886 init_depth.shrink_to_fit();
887 sur_depth.shrink_to_fit();
888 ponded_area.shrink_to_fit();
889
890 outfall_type.shrink_to_fit();
891 outfall_param.shrink_to_fit();
892 outfall_has_flap_gate.shrink_to_fit();
893 outfall_route_to.shrink_to_fit();
894 outfall_link_idx.shrink_to_fit();
895 outfall_link_offset.shrink_to_fit();
896 outfall_2d_head.shrink_to_fit();
897
898 storage_curve.shrink_to_fit();
899 storage_curve_name.shrink_to_fit();
900 storage_a.shrink_to_fit();
901 storage_b.shrink_to_fit();
902 storage_c.shrink_to_fit();
903 storage_seep_rate.shrink_to_fit();
904 storage_evap_frac.shrink_to_fit();
905 storage_evap_loss.shrink_to_fit();
906 storage_exfil_loss.shrink_to_fit();
907 exfil_suction.shrink_to_fit();
908 exfil_ksat.shrink_to_fit();
909 exfil_imd.shrink_to_fit();
910
911 divider_type.shrink_to_fit();
912 divider_cutoff.shrink_to_fit();
913 divider_cd.shrink_to_fit();
914 divider_max_depth.shrink_to_fit();
915 divider_curve.shrink_to_fit();
916 divider_link.shrink_to_fit();
917 divider_link_name.shrink_to_fit();
918 divider_curve_name.shrink_to_fit();
919
920 depth.shrink_to_fit();
921 head.shrink_to_fit();
922 volume.shrink_to_fit();
923 lat_flow.shrink_to_fit();
924 user_lat_flow.shrink_to_fit();
925 runoff_inflow.shrink_to_fit();
926 gw_inflow.shrink_to_fit();
927 ext_inflow.shrink_to_fit();
928 dwf_inflow.shrink_to_fit();
929 rdii_inflow.shrink_to_fit();
930 iface_inflow.shrink_to_fit();
931 coupling_inflow.shrink_to_fit();
932 qual_mass_in.shrink_to_fit();
933 qual_vol_in.shrink_to_fit();
934 conc.shrink_to_fit();
935 conc_old.shrink_to_fit();
936 user_conc_mass_flux.shrink_to_fit();
937 inflow.shrink_to_fit();
938 outflow.shrink_to_fit();
939 overflow.shrink_to_fit();
940 losses.shrink_to_fit();
941 crown_elev.shrink_to_fit();
942 degree.shrink_to_fit();
943 old_net_inflow.shrink_to_fit();
944 full_volume.shrink_to_fit();
945 old_depth.shrink_to_fit();
946 old_volume.shrink_to_fit();
947 old_lat_flow.shrink_to_fit();
948
949 comments.shrink_to_fit();
950 tags.shrink_to_fit();
951
952 rpt_flag.shrink_to_fit();
953
954 stat_vol_flooded.shrink_to_fit();
955 stat_time_flooded.shrink_to_fit();
956 stat_max_depth.shrink_to_fit();
957 stat_max_overflow.shrink_to_fit();
958 stat_max_overflow_date.shrink_to_fit();
959 stat_sum_depth.shrink_to_fit();
960 stat_max_depth_date.shrink_to_fit();
961 stat_max_rpt_depth.shrink_to_fit();
962 stat_max_inflow_date.shrink_to_fit();
963 stat_time_surcharged.shrink_to_fit();
964 stat_max_surcharge_height.shrink_to_fit();
965 stat_max_lat_inflow.shrink_to_fit();
966 stat_max_total_inflow.shrink_to_fit();
967 stat_lat_inflow_vol.shrink_to_fit();
968 stat_total_inflow_vol.shrink_to_fit();
969 stat_total_outflow_vol.shrink_to_fit();
970 stat_outfall_avg_flow.shrink_to_fit();
971 stat_outfall_max_flow.shrink_to_fit();
972 stat_outfall_periods.shrink_to_fit();
973 stat_total_load.shrink_to_fit();
974 }
975
979 void save_state() noexcept {
980 std::copy(depth.begin(), depth.end(), old_depth.begin());
981 std::copy(volume.begin(), volume.end(), old_volume.begin());
982 std::copy(lat_flow.begin(), lat_flow.end(), old_lat_flow.begin());
983 // Save net inflow for trapezoidal averaging in next step
984 for (std::size_t i = 0; i < inflow.size(); ++i) {
985 old_net_inflow[i] = inflow[i] - outflow[i];
986 }
987 std::copy(conc.begin(), conc.end(), conc_old.begin());
988 }
989
996 void reset_state() noexcept {
997 const auto n = depth.size();
998 // Apply initial depths from input (matching legacy node_initState)
999 for (std::size_t i = 0; i < n; ++i) {
1000 depth[i] = init_depth[i];
1001 old_depth[i] = init_depth[i];
1002 head[i] = invert_elev[i] + init_depth[i];
1003 }
1004 // Volumes must be computed from init_depth by caller (needs table data)
1005 std::fill(volume.begin(), volume.end(), 0.0);
1006 std::fill(old_volume.begin(), old_volume.end(), 0.0);
1007 // Zero flows
1008 std::fill(lat_flow.begin(), lat_flow.end(), 0.0);
1009 std::fill(inflow.begin(), inflow.end(), 0.0);
1010 std::fill(outflow.begin(), outflow.end(), 0.0);
1011 std::fill(overflow.begin(), overflow.end(), 0.0);
1012 std::fill(losses.begin(), losses.end(), 0.0);
1013 std::fill(old_net_inflow.begin(), old_net_inflow.end(), 0.0);
1014 std::fill(old_lat_flow.begin(), old_lat_flow.end(), 0.0);
1015 // coupling_inflow is NOT cleared by clearInflowSources (its end-of-
1016 // step value must persist into the next step's assembly), so zero it
1017 // explicitly on cold start.
1018 std::fill(coupling_inflow.begin(), coupling_inflow.end(), 0.0);
1020 std::fill(conc.begin(), conc.end(), 0.0);
1021 std::fill(conc_old.begin(), conc_old.end(), 0.0);
1022 (void)n;
1023 }
1024
1034 void clearInflowSources() noexcept {
1035 // runoff_inflow and gw_inflow: zeroed in stepRunoff() Phase 2
1036 std::fill(ext_inflow.begin(), ext_inflow.end(), 0.0);
1037 std::fill(dwf_inflow.begin(), dwf_inflow.end(), 0.0);
1038 std::fill(rdii_inflow.begin(), rdii_inflow.end(), 0.0);
1039 std::fill(iface_inflow.begin(), iface_inflow.end(), 0.0);
1040 std::fill(qual_mass_in.begin(), qual_mass_in.end(), 0.0);
1041 std::fill(qual_vol_in.begin(), qual_vol_in.end(), 0.0);
1042 }
1043};
1044
1045} /* namespace openswmm */
1046
1047#endif /* OPENSWMM_ENGINE_NODE_DATA_HPP */
Definition NodeCoupling.cpp:15
OutfallType
Outfall boundary condition type.
Definition NodeData.hpp:54
NodeType
Node type codes.
Definition NodeData.hpp:43
DividerType
Flow divider type.
Definition NodeData.hpp:66
@ OVERFLOW_DIV
Renamed from OVERFLOW to avoid macOS math.h macro collision.
@ TIMESERIES
Data from an in-file [TIMESERIES].
Structure-of-Arrays storage for all nodes.
Definition NodeData.hpp:90
std::vector< double > coupling_inflow
2D ↔ 1D coupling exchange flow at the node (project flow units).
Definition NodeData.hpp:330
std::vector< double > stat_lat_inflow_vol
Definition NodeData.hpp:562
int count() const noexcept
Number of nodes.
Definition NodeData.hpp:614
std::vector< double > depth
Current water depth above invert (project length units).
Definition NodeData.hpp:256
std::vector< double > invert_elev
Invert elevation (project length units).
Definition NodeData.hpp:103
std::vector< double > ext_inflow
External (timeseries/baseline) inflows (project flow units).
Definition NodeData.hpp:298
std::vector< double > exfil_imd
Green-Ampt initial moisture deficit for exfiltration (0-1).
Definition NodeData.hpp:218
std::vector< double > conc_old
Previous-step quality at each node.
Definition NodeData.hpp:375
std::vector< int > outfall_route_to
Subcatchment index to route outfall discharge to (-1 = none).
Definition NodeData.hpp:148
std::vector< double > iface_inflow
Interface file (upstream model coupling) inflows (project flow units).
Definition NodeData.hpp:307
std::vector< double > qual_mass_in
Accumulated quality mass inflow rate per (node, pollutant).
Definition NodeData.hpp:339
std::vector< double > outfall_2d_head
Cached 2D surface head at the outfall coupling point (project length).
Definition NodeData.hpp:179
std::vector< std::string > divider_link_name
Diversion link name (for deferred resolution).
Definition NodeData.hpp:243
std::vector< double > stat_vol_flooded
Total volume of water lost as overflow (project volume units).
Definition NodeData.hpp:499
std::vector< double > storage_b
Functional storage area parameter B.
Definition NodeData.hpp:197
std::vector< double > stat_time_courant_critical
CFL time-step critical count per node.
Definition NodeData.hpp:598
std::vector< int > divider_curve
Diversion curve index for TABULAR dividers (-1 = none).
Definition NodeData.hpp:237
void erase_at(int idx)
Erase the node at index idx from every parallel array.
Definition NodeData.hpp:784
std::vector< std::string > divider_curve_name
Diversion curve name (for deferred resolution, TABULAR only).
Definition NodeData.hpp:246
std::vector< double > hrt
Hydraulic residence time for storage nodes (seconds).
Definition NodeData.hpp:378
std::vector< uint8_t > outfall_has_flap_gate
True if the outfall has a gated flap (uint8_t: 0=no, 1=yes).
Definition NodeData.hpp:144
std::vector< double > old_depth
Depth at the previous timestep.
Definition NodeData.hpp:447
void reset_state() noexcept
Reset state variables, applying init_depth from input.
Definition NodeData.hpp:996
std::vector< double > divider_cd
Weir discharge coefficient for WEIR dividers.
Definition NodeData.hpp:231
std::vector< double > qual_vol_in
Accumulated volume inflow rate per node (ft3/sec).
Definition NodeData.hpp:342
std::vector< double > old_volume
Volume at the previous timestep.
Definition NodeData.hpp:450
std::vector< double > exfil_suction
Green-Ampt suction head for exfiltration (in or mm, converted to ft).
Definition NodeData.hpp:214
std::vector< double > outfall_param
Fixed outfall stage or tidal curve / time series index.
Definition NodeData.hpp:141
std::vector< double > stat_total_outflow_vol
Definition NodeData.hpp:569
std::vector< double > user_conc_mass_flux
User-forced quality mass flux at each node (mass/sec).
Definition NodeData.hpp:389
std::vector< double > storage_a
Functional storage area parameter A (area = A * depth^B + C).
Definition NodeData.hpp:195
void shrink_to_fit()
Release excess vector capacity accumulated during parsing.
Definition NodeData.hpp:882
std::vector< double > stat_max_surcharge_height
Definition NodeData.hpp:544
std::vector< double > stat_max_overflow
Maximum reported overflow rate (project flow units).
Definition NodeData.hpp:517
std::vector< int > divider_link
Diversion link index (-1 = not set).
Definition NodeData.hpp:240
std::vector< char > rpt_flag
Whether this node is included in report/output (0=no, 1=yes).
Definition NodeData.hpp:489
std::vector< double > outflow
Current total outflow from the node (project flow units).
Definition NodeData.hpp:404
void clearInflowSources() noexcept
Zero routing-phase inflow source arrays.
Definition NodeData.hpp:1034
std::vector< double > overflow
Current overflow / ponded flow (project flow units).
Definition NodeData.hpp:410
std::vector< double > old_net_inflow
Net inflow from previous timestep (inflow - outflow) for averaging.
Definition NodeData.hpp:434
std::vector< double > stat_max_depth_date
Definition NodeData.hpp:528
std::vector< double > stat_max_lat_inflow
Definition NodeData.hpp:554
std::vector< double > stat_outfall_max_flow
Outfall maximum flow (project flow units).
Definition NodeData.hpp:575
std::vector< double > volume
Current water volume (project volume units).
Definition NodeData.hpp:268
int conc_n_pollutants
Number of pollutants in the quality arrays.
Definition NodeData.hpp:392
std::vector< double > lat_flow
Current lateral inflow (project flow units).
Definition NodeData.hpp:274
std::vector< double > ponded_area
Ponding area at the surface (sq project length units).
Definition NodeData.hpp:127
std::vector< double > stat_total_inflow_vol
Cumulative total inflow volume at each node (ft3).
Definition NodeData.hpp:565
std::vector< double > sur_depth
Maximum depth allowed at the node (ponding or surcharge limit).
Definition NodeData.hpp:121
std::vector< double > crown_elev
Crown elevation — top of highest connecting conduit (project length units).
Definition NodeData.hpp:422
std::vector< double > stat_max_inflow_date
Definition NodeData.hpp:536
std::vector< double > old_lat_flow
Lateral flow at the previous timestep.
Definition NodeData.hpp:453
std::vector< double > stat_outfall_avg_flow
Outfall cumulative average flow (flow units × reporting periods).
Definition NodeData.hpp:550
std::vector< double > inflow
Current total inflow to the node (project flow units).
Definition NodeData.hpp:398
void save_state() noexcept
Snapshot current state into old-step arrays before solving.
Definition NodeData.hpp:979
std::vector< double > stat_time_surcharged
Definition NodeData.hpp:540
std::vector< double > stat_max_depth
Maximum reported depth (project length units).
Definition NodeData.hpp:511
std::vector< long > stat_outfall_periods
Outfall number of non-zero flow periods.
Definition NodeData.hpp:581
std::vector< int > storage_curve
Storage curve index into TableData (CURVE_STORAGE).
Definition NodeData.hpp:189
void resize_loads(int n_pollutants)
Resize pollutant load arrays after pollutant count is known.
Definition NodeData.hpp:849
std::vector< double > conc
Current quality concentration at each node.
Definition NodeData.hpp:372
std::vector< DividerType > divider_type
Divider method (DividerType enum value).
Definition NodeData.hpp:225
std::vector< double > divider_max_depth
Weir max depth for WEIR dividers.
Definition NodeData.hpp:234
std::vector< int > degree
Node degree — number of connecting links (+ve downstream, -ve upstream terminal).
Definition NodeData.hpp:428
std::vector< double > lid_drain_qual_vol
LID drain volume inflow rate per node (ft3/sec).
Definition NodeData.hpp:361
std::vector< double > storage_exfil_loss
Storage node exfiltration loss this timestep (ft3).
Definition NodeData.hpp:211
std::vector< double > runoff_inflow
Interpolated surface runoff from subcatchments (project flow units).
Definition NodeData.hpp:292
std::vector< double > dwf_inflow
Dry weather flow inflows (project flow units).
Definition NodeData.hpp:301
std::vector< double > stat_time_flooded
Total duration the node was flooded (seconds).
Definition NodeData.hpp:505
std::vector< std::string > tags
Per-object tag from the INP [TAGS] section.
Definition NodeData.hpp:481
std::vector< double > lid_drain_qual_load
LID drain quality mass rate per (node, pollutant) (mass/sec).
Definition NodeData.hpp:353
std::vector< double > stat_sum_depth
Definition NodeData.hpp:524
std::vector< double > stat_max_rpt_depth
Definition NodeData.hpp:532
std::vector< double > init_depth
Initial water depth (project length units).
Definition NodeData.hpp:115
std::vector< double > stat_total_load
Cumulative pollutant loads at each node.
Definition NodeData.hpp:606
void resize(int n)
Resize all arrays to hold exactly n nodes.
Definition NodeData.hpp:623
std::vector< double > storage_seep_rate
Seepage rate from storage node (project units/day).
Definition NodeData.hpp:202
std::vector< double > exfil_ksat
Green-Ampt saturated hydraulic conductivity for exfiltration (in/hr or mm/hr, converted to ft/sec).
Definition NodeData.hpp:216
std::vector< double > outfall_link_offset
Conduit offset at the outfall end (ft), matching the link stored in outfall_link_idx....
Definition NodeData.hpp:160
std::vector< int > stat_non_converged_count
Count of non-converging steps per node.
Definition NodeData.hpp:589
std::vector< double > full_volume
Full volume at node (project volume units).
Definition NodeData.hpp:440
std::vector< double > storage_evap_frac
Fraction of potential evaporation realized at storage node (0-1).
Definition NodeData.hpp:205
std::vector< std::string > storage_curve_name
Curve name for deferred resolution (populated during parsing).
Definition NodeData.hpp:192
std::vector< double > stat_max_overflow_date
Date/time when maximum overflow occurred (OADate (days since 12/30/1899)).
Definition NodeData.hpp:520
std::vector< std::string > comments
Object comment from the INP file (lines with a single ';' prefix immediately above this object's data...
Definition NodeData.hpp:468
std::vector< double > losses
Node losses (evaporation + seepage) (project flow units).
Definition NodeData.hpp:416
void grow_to(int n)
Grow all arrays to hold at least n nodes, preserving existing data.
Definition NodeData.hpp:725
std::vector< NodeType > type
Node type for each node.
Definition NodeData.hpp:97
std::vector< double > full_depth
Full depth of the node (project length units).
Definition NodeData.hpp:109
std::vector< double > stat_max_total_inflow
Definition NodeData.hpp:558
std::vector< double > rdii_inflow
RDII unit hydrograph inflows (project flow units).
Definition NodeData.hpp:304
void resize_quality(int n_pollutants)
Resize per-node quality arrays after pollutant count is known.
Definition NodeData.hpp:861
std::vector< int > outfall_link_idx
Cached index of the conduit connected to this outfall (-1 if none).
Definition NodeData.hpp:156
std::vector< double > storage_c
Functional storage area parameter C (baseline area).
Definition NodeData.hpp:199
std::vector< double > head
Current water surface head (project length units = invert + depth).
Definition NodeData.hpp:262
std::vector< OutfallType > outfall_type
Outfall boundary condition type.
Definition NodeData.hpp:134
std::vector< double > divider_cutoff
Cutoff flow for CUTOFF dividers.
Definition NodeData.hpp:228
std::vector< double > storage_evap_loss
Storage node evaporation loss this timestep (ft3).
Definition NodeData.hpp:208
std::vector< double > gw_inflow
Interpolated groundwater flow from subcatchments (project flow units).
Definition NodeData.hpp:295
std::vector< double > user_lat_flow
User-forced lateral inflow set via the API (project flow units).
Definition NodeData.hpp:283
int stat_n_pollutants
Definition NodeData.hpp:607