OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
QualityData.hpp
Go to the documentation of this file.
1
16#ifndef OPENSWMM_ENGINE_QUALITY_DATA_HPP
17#define OPENSWMM_ENGINE_QUALITY_DATA_HPP
18
19#include <vector>
20#include <string>
21
22namespace openswmm {
23
24// ============================================================================
25// Land use definitions
26// ============================================================================
27
29 int count() const { return static_cast<int>(sweep_interval.size()); }
30
31 std::vector<double> sweep_interval;
32 std::vector<double> sweep_removal;
33 std::vector<double> last_swept;
34
35 void resize(int n) {
36 auto un = static_cast<std::size_t>(n);
37 sweep_interval.assign(un, 0.0);
38 sweep_removal.assign(un, 0.0);
39 last_swept.assign(un, 0.0);
40 }
41};
42
43// ============================================================================
44// Buildup function per (landuse x pollutant)
45// ============================================================================
46
49 std::vector<int> func_type;
50 std::vector<double> coeff1;
51 std::vector<double> coeff2;
52 std::vector<double> coeff3;
53 std::vector<int> normalizer;
54
55 int n_landuses = 0;
56 int n_pollutants = 0;
57
58 void resize(int nlu, int npoll) {
59 n_landuses = nlu; n_pollutants = npoll;
60 auto total = static_cast<std::size_t>(nlu * npoll);
61 func_type.assign(total, 0);
62 coeff1.assign(total, 0.0);
63 coeff2.assign(total, 0.0);
64 coeff3.assign(total, 0.0);
65 normalizer.assign(total, 0);
66 }
67};
68
69// ============================================================================
70// Washoff function per (landuse x pollutant)
71// ============================================================================
72
75 std::vector<int> func_type;
76 std::vector<double> coeff;
77 std::vector<double> expon;
78 std::vector<double> sweep_effic;
79 std::vector<double> bmp_effic;
80
81 int n_landuses = 0;
82 int n_pollutants = 0;
83
84 void resize(int nlu, int npoll) {
85 n_landuses = nlu; n_pollutants = npoll;
86 auto total = static_cast<std::size_t>(nlu * npoll);
87 func_type.assign(total, 0);
88 coeff.assign(total, 0.0);
89 expon.assign(total, 0.0);
90 sweep_effic.assign(total, 0.0);
91 bmp_effic.assign(total, 0.0);
92 }
93};
94
95// ============================================================================
96// Treatment expression per (node x pollutant)
97// ============================================================================
98
101 std::vector<std::string> expressions;
102
103 int n_nodes = 0;
105
106 void resize(int nn, int npoll) {
107 n_nodes = nn; n_pollutants = npoll;
108 expressions.assign(static_cast<std::size_t>(nn * npoll), "");
109 }
110
111 bool hasAny() const {
112 for (const auto& e : expressions) if (!e.empty()) return true;
113 return false;
114 }
115};
116
117} // namespace openswmm
118
119#endif // OPENSWMM_ENGINE_QUALITY_DATA_HPP
Definition Controls.cpp:24
Definition QualityData.hpp:47
int n_pollutants
Definition QualityData.hpp:56
std::vector< int > func_type
Index: [landuse * n_pollutants + pollutant].
Definition QualityData.hpp:49
int n_landuses
Definition QualityData.hpp:55
std::vector< double > coeff2
Definition QualityData.hpp:51
void resize(int nlu, int npoll)
Definition QualityData.hpp:58
std::vector< double > coeff1
Definition QualityData.hpp:50
std::vector< double > coeff3
Definition QualityData.hpp:52
std::vector< int > normalizer
0=PER_AREA, 1=PER_CURB
Definition QualityData.hpp:53
Definition QualityData.hpp:28
int count() const
Definition QualityData.hpp:29
void resize(int n)
Definition QualityData.hpp:35
std::vector< double > sweep_interval
Days between sweeps.
Definition QualityData.hpp:31
std::vector< double > last_swept
Days since last swept.
Definition QualityData.hpp:33
std::vector< double > sweep_removal
Max removal fraction (0-100)
Definition QualityData.hpp:32
Definition QualityData.hpp:99
std::vector< std::string > expressions
Index: [node * n_pollutants + pollutant].
Definition QualityData.hpp:101
int n_nodes
Definition QualityData.hpp:103
void resize(int nn, int npoll)
Definition QualityData.hpp:106
bool hasAny() const
Definition QualityData.hpp:111
int n_pollutants
Definition QualityData.hpp:104
Definition QualityData.hpp:73
std::vector< double > sweep_effic
0-100
Definition QualityData.hpp:78
int n_pollutants
Definition QualityData.hpp:82
std::vector< double > expon
Definition QualityData.hpp:77
std::vector< int > func_type
Index: [landuse * n_pollutants + pollutant].
Definition QualityData.hpp:75
std::vector< double > bmp_effic
0-100
Definition QualityData.hpp:79
std::vector< double > coeff
Definition QualityData.hpp:76
void resize(int nlu, int npoll)
Definition QualityData.hpp:84
int n_landuses
Definition QualityData.hpp:81