OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
InflowData.hpp
Go to the documentation of this file.
1
15#ifndef OPENSWMM_ENGINE_INFLOW_DATA_HPP
16#define OPENSWMM_ENGINE_INFLOW_DATA_HPP
17
18#include <vector>
19#include <string>
20
21namespace openswmm {
22
23// ============================================================================
24// External inflow definitions (from [INFLOWS] section)
25// ============================================================================
26
28 int count() const { return static_cast<int>(node_idx.size()); }
29
30 std::vector<int> node_idx;
31 std::vector<std::string> constituent;
32 std::vector<std::string> ts_name;
33 std::vector<std::string> inflow_type;
34 std::vector<double> m_factor;
35 std::vector<double> s_factor;
36 std::vector<double> baseline;
37 std::vector<std::string> pattern_name;
38
39 void add(int ni, const std::string& cons, const std::string& ts,
40 const std::string& type, double mf, double sf, double base,
41 const std::string& pat) {
42 node_idx.push_back(ni); constituent.push_back(cons);
43 ts_name.push_back(ts); inflow_type.push_back(type);
44 m_factor.push_back(mf); s_factor.push_back(sf);
45 baseline.push_back(base); pattern_name.push_back(pat);
46 }
47};
48
49// ============================================================================
50// Dry weather flow definitions (from [DWF] section)
51// ============================================================================
52
53struct DwfData {
54 int count() const { return static_cast<int>(node_idx.size()); }
55
56 std::vector<int> node_idx;
57 std::vector<std::string> constituent;
58 std::vector<double> avg_value;
59 std::vector<std::string> pat1;
60 std::vector<std::string> pat2;
61 std::vector<std::string> pat3;
62 std::vector<std::string> pat4;
63
64 void add(int ni, const std::string& cons, double avg,
65 const std::string& p1, const std::string& p2,
66 const std::string& p3, const std::string& p4) {
67 node_idx.push_back(ni); constituent.push_back(cons);
68 avg_value.push_back(avg);
69 pat1.push_back(p1); pat2.push_back(p2);
70 pat3.push_back(p3); pat4.push_back(p4);
71 }
72};
73
74// ============================================================================
75// RDII assignments (from [RDII] section)
76// ============================================================================
77
79 int count() const { return static_cast<int>(node_idx.size()); }
80
81 std::vector<int> node_idx;
82 std::vector<std::string> uh_name;
83 std::vector<double> sewer_area;
84
85 void add(int ni, const std::string& uh, double area) {
86 node_idx.push_back(ni); uh_name.push_back(uh);
87 sewer_area.push_back(area);
88 }
89};
90
91// ============================================================================
92// Time patterns (from [PATTERNS] section)
93// ============================================================================
94
96 int count() const { return static_cast<int>(names.size()); }
97
98 std::vector<std::string> names;
99 std::vector<int> types;
100 std::vector<std::vector<double>> factors;
101
102 void add(const std::string& name, int type, const std::vector<double>& facs) {
103 names.push_back(name); types.push_back(type);
104 factors.push_back(facs);
105 }
106};
107
108} // namespace openswmm
109
110#endif // OPENSWMM_ENGINE_INFLOW_DATA_HPP
Definition Controls.cpp:24
Definition InflowData.hpp:53
std::vector< std::string > constituent
"FLOW" or pollutant name
Definition InflowData.hpp:57
void add(int ni, const std::string &cons, double avg, const std::string &p1, const std::string &p2, const std::string &p3, const std::string &p4)
Definition InflowData.hpp:64
std::vector< int > node_idx
Target node.
Definition InflowData.hpp:56
std::vector< std::string > pat1
Monthly pattern name.
Definition InflowData.hpp:59
std::vector< std::string > pat2
Daily pattern name.
Definition InflowData.hpp:60
std::vector< double > avg_value
Average value.
Definition InflowData.hpp:58
std::vector< std::string > pat4
Weekend pattern name.
Definition InflowData.hpp:62
int count() const
Definition InflowData.hpp:54
std::vector< std::string > pat3
Hourly pattern name.
Definition InflowData.hpp:61
Definition InflowData.hpp:27
std::vector< std::string > pattern_name
Baseline pattern name.
Definition InflowData.hpp:37
std::vector< std::string > constituent
"FLOW" or pollutant name
Definition InflowData.hpp:31
std::vector< int > node_idx
Target node index.
Definition InflowData.hpp:30
std::vector< double > baseline
Baseline value.
Definition InflowData.hpp:36
int count() const
Definition InflowData.hpp:28
std::vector< std::string > inflow_type
"FLOW","CONCEN","MASS"
Definition InflowData.hpp:33
std::vector< double > s_factor
Scaling factor.
Definition InflowData.hpp:35
std::vector< double > m_factor
Multiplier factor.
Definition InflowData.hpp:34
std::vector< std::string > ts_name
Timeseries name ("" if none)
Definition InflowData.hpp:32
void add(int ni, const std::string &cons, const std::string &ts, const std::string &type, double mf, double sf, double base, const std::string &pat)
Definition InflowData.hpp:39
Definition InflowData.hpp:95
std::vector< std::vector< double > > factors
Up to 24 multiplier values.
Definition InflowData.hpp:100
void add(const std::string &name, int type, const std::vector< double > &facs)
Definition InflowData.hpp:102
std::vector< std::string > names
Pattern name.
Definition InflowData.hpp:98
int count() const
Definition InflowData.hpp:96
std::vector< int > types
0=MONTHLY,1=DAILY,2=HOURLY,3=WEEKEND
Definition InflowData.hpp:99
Definition InflowData.hpp:78
std::vector< std::string > uh_name
Unit hydrograph name.
Definition InflowData.hpp:82
std::vector< double > sewer_area
Tributary sewer area.
Definition InflowData.hpp:83
void add(int ni, const std::string &uh, double area)
Definition InflowData.hpp:85
std::vector< int > node_idx
Target node.
Definition InflowData.hpp:81
int count() const
Definition InflowData.hpp:79