hydrobricks
Loading...
Searching...
No Matches
ProcessRoutingGR4J.h
1#ifndef HYDROBRICKS_PROCESS_ROUTING_GR4J_H
2#define HYDROBRICKS_PROCESS_ROUTING_GR4J_H
3
4#include "Includes.h"
5#include "ProcessOutflow.h"
6
27 public:
28 explicit ProcessRoutingGR4J(WaterContainer* container);
29
30 ~ProcessRoutingGR4J() override = default;
31
35 static void RegisterProcessSettings(SettingsModel* modelSettings);
36
40 [[nodiscard]] bool RequiresDailyTimeStep() const override {
41 return true;
42 }
43
47 void SetParameters(const ProcessSettings& processSettings) override;
48
52 void Reset() override;
53
57 void Finalize() override;
58
62 double* GetValuePointer(std::string_view name) override;
63
64 protected:
65 const float* _exchangeFactor; // X2 [mm/d]
66 const float* _routingCapacity; // X3 [mm]
67 const float* _uhBaseTime; // X4 [d]
68
69 // Unit-hydrograph convolution buffers (length changes with X4)
70 vecDouble _stuh1;
71 vecDouble _stuh2;
72
73 // Pre-computed UH ordinates
74 vecDouble _uh1Ord;
75 vecDouble _uh2Ord;
76
77 // Routing store level [mm] — updated in Finalize()
78 double _r;
79
80 // Logged discharge components exposed via GetValuePointer
81 double _qr;
82 double _qd;
83
84 // Cached total process-internal water storage for water balance logging
85 double _processStorage;
86
93 const vecDouble& GetRates() override;
94
98 void _recomputeUH();
99
100 static double _sh1(double t, double x4);
101 static double _sh2(double t, double x4);
102};
103
104#endif // HYDROBRICKS_PROCESS_ROUTING_GR4J_H
Definition ProcessOutflow.h:8
Definition ProcessRoutingGR4J.h:26
void Reset() override
Definition ProcessRoutingGR4J.cpp:36
void SetParameters(const ProcessSettings &processSettings) override
Definition ProcessRoutingGR4J.cpp:28
bool RequiresDailyTimeStep() const override
Definition ProcessRoutingGR4J.h:40
const vecDouble & GetRates() override
Definition ProcessRoutingGR4J.cpp:67
double * GetValuePointer(std::string_view name) override
Definition ProcessRoutingGR4J.cpp:47
void _recomputeUH()
Definition ProcessRoutingGR4J.cpp:177
static void RegisterProcessSettings(SettingsModel *modelSettings)
Definition ProcessRoutingGR4J.cpp:19
void Finalize() override
Definition ProcessRoutingGR4J.cpp:130
Definition SettingsModel.h:74
Definition WaterContainer.h:10
Definition SettingsModel.h:32