OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
QualityRouting.hpp
Go to the documentation of this file.
1
19
#ifndef OPENSWMM_QUALITY_ROUTING_HPP
20
#define OPENSWMM_QUALITY_ROUTING_HPP
21
22
#include <vector>
23
24
namespace
openswmm
{
25
26
struct
SimulationContext;
27
28
namespace
quality {
29
30
// ============================================================================
31
// Constants
32
// ============================================================================
33
34
constexpr
double
ZERO_VOLUME
= 0.0353147;
35
constexpr
double
ZERO_DEPTH
= 0.003281;
36
37
// ============================================================================
38
// Quality solver
39
// ============================================================================
40
41
class
QualitySolver
{
42
public
:
43
void
init
(
int
n_nodes,
int
n_links,
int
n_pollutants);
44
57
void
execute
(
SimulationContext
& ctx,
double
dt);
58
66
void
addWetWeatherLoads
(
SimulationContext
& ctx,
double
dt);
67
68
private
:
69
int
n_pollutants_ = 0;
70
71
// Per-node quality working arrays: [node * n_pollutants + pollutant]
72
std::vector<double> node_mass_in_;
73
std::vector<double> node_vol_in_;
74
76
void
accumulateLinkLoads(
SimulationContext
& ctx,
double
dt);
77
79
void
mixAtNodes(
SimulationContext
& ctx,
double
dt);
80
82
void
applyDecay(
SimulationContext
& ctx,
double
dt);
83
85
void
updateLinkQuality(
SimulationContext
& ctx);
86
};
87
88
}
// namespace quality
89
}
// namespace openswmm
90
91
#endif
// OPENSWMM_QUALITY_ROUTING_HPP
openswmm::quality::QualitySolver
Definition
QualityRouting.hpp:41
openswmm::quality::QualitySolver::addWetWeatherLoads
void addWetWeatherLoads(SimulationContext &ctx, double dt)
Add subcatchment washoff quality loads to node inflows.
Definition
QualityRouting.cpp:60
openswmm::quality::QualitySolver::init
void init(int n_nodes, int n_links, int n_pollutants)
Definition
QualityRouting.cpp:33
openswmm::quality::QualitySolver::execute
void execute(SimulationContext &ctx, double dt)
Execute one quality routing timestep.
Definition
QualityRouting.cpp:41
openswmm::quality::ZERO_VOLUME
constexpr double ZERO_VOLUME
1 liter in ft3
Definition
QualityRouting.hpp:34
openswmm::quality::ZERO_DEPTH
constexpr double ZERO_DEPTH
1 mm in ft
Definition
QualityRouting.hpp:35
openswmm
Definition
Controls.cpp:24
openswmm::SimulationContext
Central, reentrant simulation context.
Definition
SimulationContext.hpp:141
src
engine
quality
QualityRouting.hpp
Generated by
1.9.8