34#ifndef OPENSWMM_INFLOW_HPP
35#define OPENSWMM_INFLOW_HPP
211 std::vector<TimePattern> patterns_;
Owned resolved inflow definitions and pattern lookup cache. Serialize init/refresh/compute with model...
Definition Inflow.hpp:155
void init(SimulationContext &ctx)
Rebuild external/DWF row caches, bindings and unit conversions from the model.
Definition Inflow.cpp:130
void computeAll(SimulationContext &ctx, double current_date, double dt)
Add resolved external/DWF water and quality rates to routing input channels.
Definition Inflow.cpp:435
void refreshPatterns(const SimulationContext &ctx)
Copy current pattern types/factors into private fixed-width runtime rows.
Definition Inflow.cpp:114
friend class openswmm::SWMMEngine
Definition Inflow.hpp:208
double getPatternFactor(int p, int month, int day, int hour)
Computes time pattern multiplier for a specific point in time.
Definition inflow.c:472
constexpr int WEEKEND_PATTERN
Definition Inflow.hpp:54
constexpr int MONTHLY_PATTERN
Definition Inflow.hpp:51
constexpr int HOURLY_PATTERN
Definition Inflow.hpp:53
constexpr int DAILY_PATTERN
Definition Inflow.hpp:52
ExtInflowKind
Definition Inflow.hpp:63
@ FLOW
Volumetric inflow (constituent FLOW)
Definition Inflow.hpp:64
@ AGE
Definition Inflow.hpp:72
@ MSX_MASS
Definition Inflow.hpp:77
@ CONCEN
Pollutant concentration; mass rate = value * node flow.
Definition Inflow.hpp:65
@ MSX_CONCEN
Definition Inflow.hpp:76
@ MASS
Definition Inflow.hpp:66
Definition ExchangeLaw.hpp:60
Central, reentrant simulation context.
Definition SimulationContext.hpp:390
Definition Inflow.hpp:110
void resize(int n)
Reset every DWF row to unresolved/default values.
Definition Inflow.cpp:81
int count
Definition Inflow.hpp:111
std::vector< int > node_idx
Which node.
Definition Inflow.hpp:112
std::vector< double > avg_value
Average DWF value.
Definition Inflow.hpp:113
std::vector< int > msx_idx
Definition Inflow.hpp:126
std::vector< int > pat_weekend
Definition Inflow.hpp:117
std::vector< uint8_t > is_flow
Definition Inflow.hpp:121
std::vector< int > pat_hourly
Hourly pattern index (-1 = none)
Definition Inflow.hpp:116
std::vector< int > pollut_idx
Pollutant index for a non-FLOW row (-1 when FLOW or unmatched).
Definition Inflow.hpp:123
std::vector< int > pat_monthly
Monthly pattern index (-1 = none)
Definition Inflow.hpp:114
std::vector< int > pat_daily
Daily pattern index (-1 = none)
Definition Inflow.hpp:115
std::vector< int > ts_idx
Timeseries index (-1 = none)
Definition Inflow.hpp:83
int count
Definition Inflow.hpp:81
std::vector< int > pollut_idx
Definition Inflow.hpp:94
void resize(int n)
Reset every external-inflow row to unresolved/default values.
Definition Inflow.cpp:68
std::vector< double > scale_factor
Timeseries scaling factor.
Definition Inflow.hpp:86
std::vector< double > conv_factor
Definition Inflow.hpp:87
std::vector< int > node_idx
Which node this inflow applies to.
Definition Inflow.hpp:82
std::vector< int > base_pat_idx
Baseline pattern index (-1 = none)
Definition Inflow.hpp:84
std::vector< double > baseline
Constant baseline value.
Definition Inflow.hpp:85
std::vector< int > kind
Definition Inflow.hpp:90
Definition Inflow.hpp:142
int type
0=monthly, 1=daily, 2=hourly, 3=weekend
Definition Inflow.hpp:143
double factors[24]
Up to 24 factors (monthly=12, daily=7, hourly=24)
Definition Inflow.hpp:144