hydrobricks
Loading...
Searching...
No Matches
ProcessRoutingHBV.h
1#ifndef HYDROBRICKS_PROCESS_ROUTING_HBV_H
2#define HYDROBRICKS_PROCESS_ROUTING_HBV_H
3
4#include "Includes.h"
5#include "ProcessOutflow.h"
6
33 public:
34 explicit ProcessRoutingHBV(WaterContainer* container);
35
36 ~ProcessRoutingHBV() override = default;
37
43 static void RegisterProcessSettings(SettingsModel* modelSettings);
44
48 [[nodiscard]] bool IsValid() const override;
49
53 void SetParameters(const ProcessSettings& processSettings) override;
54
58 void Reset() override;
59
63 void Finalize() override;
64
73 [[nodiscard]] const vecDouble& GetChangeRates() override {
74 return GetRates();
75 }
76
80 double* GetValuePointer(std::string_view name) override;
81
82 protected:
83 const float* _maxbas; // base of the triangular weighting function [d]
84
85 // Delivery schedule (slot j: water due j timesteps from now) and pre-computed ordinates
86 vecDouble _stuh;
87 vecDouble _uhOrd;
88 double _lastMaxbas;
89 // Time step the ordinates were built for. The structure is built before the timer is
90 // initialized, so the first computation falls back on a daily step; the ordinates are
91 // rebuilt as soon as the real step is known.
92 double _lastTimeStep;
93
94 // End-of-step container content of the previous timestep (to measure the committed inflow)
95 double _previousContent;
96
97 // In-transit water (scheduled, not yet delivered) for water balance logging
98 double _processStorage;
99
106 const vecDouble& GetRates() override;
107
111 void _recomputeUH();
112
116 static double _cumulativeWeight(double t, double maxbas);
117};
118
119#endif // HYDROBRICKS_PROCESS_ROUTING_HBV_H
Definition ProcessOutflow.h:8
Definition ProcessRoutingHBV.h:32
bool IsValid() const override
Definition ProcessRoutingHBV.cpp:25
void SetParameters(const ProcessSettings &processSettings) override
Definition ProcessRoutingHBV.cpp:37
const vecDouble & GetChangeRates() override
Definition ProcessRoutingHBV.h:73
const vecDouble & GetRates() override
Definition ProcessRoutingHBV.cpp:62
void Finalize() override
Definition ProcessRoutingHBV.cpp:82
void Reset() override
Definition ProcessRoutingHBV.cpp:43
void _recomputeUH()
Definition ProcessRoutingHBV.cpp:113
double * GetValuePointer(std::string_view name) override
Definition ProcessRoutingHBV.cpp:51
static double _cumulativeWeight(double t, double maxbas)
Definition ProcessRoutingHBV.cpp:140
static void RegisterProcessSettings(SettingsModel *modelSettings)
Definition ProcessRoutingHBV.cpp:18
Definition SettingsModel.h:74
Definition WaterContainer.h:10
Definition SettingsModel.h:32