20#ifndef OPENSWMM_RDII_HPP
21#define OPENSWMM_RDII_HPP
26#include <unordered_map>
30struct SimulationContext;
72 past_rain.assign(
static_cast<std::size_t
>(n), 0.0);
73 past_month.assign(
static_cast<std::size_t
>(n), 0);
118 const std::unordered_map<std::string, int>&
uhNameIndex()
const {
return uh_name_to_idx_; }
153 std::unordered_map<std::string, int> uh_name_to_idx_;
154 std::vector<double> node_rdii_flow_;
157 double uhOrdinate(
const UnitHydParams& uh,
int month,
int response,
double t)
const;
std::vector< std::array< ExpDecayParams, 3 > > decay_params
Definition RDII.hpp:143
static int getMaxPeriods(const UnitHydParams &uh, int response, int rainInterval)
Compute max past periods for a UH response given a rain interval.
Definition RDII.cpp:98
void applyRdiiInflows(SimulationContext &ctx) const
Apply buffered RDII inflows to node lateral flows.
Definition RDII.cpp:504
void computeAll(SimulationContext &ctx, int month, double dt)
Compute RDII inflows for all groups (buffered, not added to lat_flow).
Definition RDII.cpp:378
void init(SimulationContext &ctx)
Definition RDII.cpp:133
std::vector< UnitHydParams > uh_params
Definition RDII.hpp:138
int findUnitHyd(const std::string &name) const
Look up unit hydrograph index by name.
Definition RDII.cpp:75
static int getRainInterval(const UnitHydParams &uh, double wet_step)
Compute rain processing interval for a UH (minimum limb duration, capped by wet_step).
Definition RDII.cpp:81
int addUnitHydParams(const std::string &name, const UnitHydParams ¶ms)
Register a unit hydrograph parameter set by name.
Definition RDII.cpp:62
const std::unordered_map< std::string, int > & uhNameIndex() const
Read-only access to the UH name → index map (for validation).
Definition RDII.hpp:118
Definition NodeCoupling.cpp:15
Central, reentrant simulation context.
Definition SimulationContext.hpp:274
double k_dep
Depletion rate (1/project-depth) — temperature-independent.
Definition RDII.hpp:51
double T_freeze
Recovery suppressed at or below this temperature (deg C)
Definition RDII.hpp:56
double k_T
Thermal recovery rate at T_ref (1/hr)
Definition RDII.hpp:53
double k_0
Base recovery rate (1/hr)
Definition RDII.hpp:52
double T_ref
Reference temperature (deg C)
Definition RDII.hpp:54
bool active
Definition RDII.hpp:50
double theta_rec
Temperature sensitivity (1/deg C)
Definition RDII.hpp:55
void resize(int n)
Definition RDII.cpp:21
std::vector< int > gage_idx
Rain gage index per UH group (legacy: UnitHyd[j].rainGage)
Definition RDII.hpp:85
std::vector< int > uh_idx
Unit hydrograph parameter index.
Definition RDII.hpp:84
std::vector< double > area
Contributing area (acres, project units)
Definition RDII.hpp:86
std::vector< int > node_idx
Target node index.
Definition RDII.hpp:83
std::vector< UHResponseData > uh_data
Per-response data: [group * 3 + response].
Definition RDII.hpp:89
std::vector< double > time_accum
Accumulated time (sec) within current interval.
Definition RDII.hpp:92
std::vector< int > rain_interval
Rain processing interval (sec) per group.
Definition RDII.hpp:91
int count
Definition RDII.hpp:82
std::vector< double > rain_at_start
Rainfall (in/hr) captured at start of interval.
Definition RDII.hpp:93
int has_past_rain
true if any non-zero past rain
Definition RDII.hpp:66
long dry_seconds
seconds since last non-zero rainfall
Definition RDII.hpp:68
std::vector< int > past_month
month for each past rainfall entry
Definition RDII.hpp:63
int period
current buffer write position
Definition RDII.hpp:64
int max_periods
buffer capacity
Definition RDII.hpp:65
std::vector< double > past_rain
circular buffer of past rainfall depths
Definition RDII.hpp:62
void allocate(int n)
Definition RDII.hpp:70
double ia_used
initial abstraction used so far
Definition RDII.hpp:67
double iaRecov[12][3]
IA recovery rate (linear model)
Definition RDII.hpp:39
double iaMax[12][3]
Initial abstraction max depth.
Definition RDII.hpp:38
double tPeak[12][3]
Time to peak (sec) per month × response.
Definition RDII.hpp:36
double tBase[12][3]
Base time (sec) per month × response.
Definition RDII.hpp:37
double r[12][3]
Rainfall fraction per month × response.
Definition RDII.hpp:35
double iaInit[12][3]
Initial IA used.
Definition RDII.hpp:40