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 void SetParameters(const ProcessSettings& processSettings) override;
41
45 void Reset() override;
46
50 void Finalize() override;
51
55 double* GetValuePointer(std::string_view name) override;
56
57 protected:
58 const float* _exchangeFactor; // X2 [mm/d]
59 const float* _routingCapacity; // X3 [mm]
60 const float* _uhBaseTime; // X4 [d]
61
62 // Unit-hydrograph convolution buffers (length changes with X4)
63 vecDouble _stuh1;
64 vecDouble _stuh2;
65
66 // Pre-computed UH ordinates
67 vecDouble _uh1Ord;
68 vecDouble _uh2Ord;
69
70 // Routing store level [mm] — updated in Finalize()
71 double _r;
72
73 // Logged discharge components exposed via GetValuePointer
74 double _qr;
75 double _qd;
76
77 // Cached total process-internal water storage for water balance logging
78 double _processStorage;
79
86 vecDouble GetRates() override;
87
91 void _recomputeUH();
92
93 static double _sh1(double t, double x4);
94 static double _sh2(double t, double x4);
95};
96
97#endif // HYDROBRICKS_PROCESS_ROUTING_GR4J_H
Definition ProcessOutflow.h:8
Definition ProcessRoutingGR4J.h:26
void Reset() override
Definition ProcessRoutingGR4J.cpp:36
vecDouble GetRates() override
Definition ProcessRoutingGR4J.cpp:67
void SetParameters(const ProcessSettings &processSettings) override
Definition ProcessRoutingGR4J.cpp:28
double * GetValuePointer(std::string_view name) override
Definition ProcessRoutingGR4J.cpp:47
void _recomputeUH()
Definition ProcessRoutingGR4J.cpp:178
static void RegisterProcessSettings(SettingsModel *modelSettings)
Definition ProcessRoutingGR4J.cpp:19
void Finalize() override
Definition ProcessRoutingGR4J.cpp:131
Definition SettingsModel.h:69
Definition WaterContainer.h:9
Definition SettingsModel.h:29