|
hydrobricks
|
#include <ProcessRoutingHBV.h>
Public Member Functions | |
| ProcessRoutingHBV (WaterContainer *container) | |
| bool | IsValid () const override |
| void | SetParameters (const ProcessSettings &processSettings) override |
| void | Reset () override |
| void | Finalize () override |
| vecDouble | GetChangeRates () override |
| double * | GetValuePointer (std::string_view name) override |
Public Member Functions inherited from ProcessOutflow | |
| ProcessOutflow (WaterContainer *container) | |
| int | GetConnectionCount () const override |
Public Member Functions inherited from Process | |
| Process (WaterContainer *container) | |
| virtual void | Validate () const |
| virtual void | SetHydroUnitProperties (HydroUnit *unit, Brick *brick) |
| virtual void | AttachForcing (Forcing *) |
| void | AttachFluxOut (std::unique_ptr< Flux > flux) |
| int | GetOutputFluxCount () const |
| Flux * | GetOutputFlux (size_t index) const |
| virtual bool | ToAtmosphere () const |
| virtual bool | NeedsTargetBrickLinking () const |
| virtual void | StoreInOutgoingFlux (double *rate, int index) |
| void | ApplyChange (int connectionIndex, double rate, double timeStepInDays) |
| virtual vecDoublePt | GetStateVariables () |
| const string & | GetName () const |
| void | SetName (const string &name) |
| void | SetTimeMachine (TimeMachine *timeMachine) |
| WaterContainer * | GetWaterContainer () const |
| virtual void | SetTargetBrick (Brick *) |
| virtual bool | LinksMultipleTargets () const |
| virtual void | AddTargetBrickWithWeights (Brick *, const std::vector< Brick * > &) |
| virtual bool | IsLateralProcess () const noexcept |
| bool | HasOutputFluxes () const noexcept |
| bool | HasWaterContainer () const noexcept |
Static Public Member Functions | |
| static void | RegisterProcessSettings (SettingsModel *modelSettings) |
Static Public Member Functions inherited from ProcessOutflow | |
| static void | RegisterProcessSettings (SettingsModel *modelSettings) |
Static Public Member Functions inherited from Process | |
| static std::unique_ptr< Process > | Factory (const ProcessSettings &processSettings, Brick *brick) |
| static bool | RegisterSettings (SettingsModel *modelSettings, const string &processType) |
| static bool | HasParameter (const ProcessSettings &processSettings, std::string_view name) |
| static const float * | GetParameterValuePointer (const ProcessSettings &processSettings, std::string_view name) |
Protected Member Functions | |
| vecDouble | GetRates () override |
| void | _recomputeUH () |
Protected Member Functions inherited from Process | |
| double | GetSumChangeRatesOtherProcesses () const |
Static Protected Member Functions | |
| static double | _cumulativeWeight (double t, double maxbas) |
Protected Attributes | |
| const float * | _maxbas |
| vecDouble | _stuh |
| vecDouble | _uhOrd |
| double | _lastMaxbas |
| double | _previousContent |
| double | _processStorage |
Protected Attributes inherited from Process | |
| string | _name |
| WaterContainer * | _container |
| TimeMachine * | _timeMachine {nullptr} |
| std::vector< std::unique_ptr< Flux > > | _outputs |
HBV transformation function: triangular unit-hydrograph routing (MAXBAS).
The routing brick accumulates the runoff components (e.g. upper and lower zone outflows) each timestep. The total is convolved with a triangular weighting function of base maxbas [d]:
With maxbas <= 1 the inflow is passed through within the timestep.
The process maintains a delivery schedule (_stuh): each slot holds the water due to leave that many timesteps from now. GetRates() is read-only (the solver can call it multiple times without corrupting state) and returns the amount due this timestep plus the same-step share of the current inflow. The schedule is advanced exactly once per timestep in Finalize(), based on the committed amounts: the actually received inflow is distributed over the ordinates and any difference between the scheduled and the actual delivery (solver stage averaging, rate constraints) is carried over to the next timestep, so no water gets stranded in the routing container.
|
staticprotected |
Cumulative triangular weighting function.
|
protected |
Recompute the UH ordinates and resize the buffer based on the current maxbas.
|
overridevirtual |
Advance the delivery schedule once per timestep, using the committed amounts.
Reimplemented from Process.
|
inlinenodiscardoverridevirtual |
Get the change rates of the process.
Bypasses the empty-container shortcut of the base class: the scheduled delivery typically drains the whole container content within the timestep, which would zero the rates at later solver stages and halve the delivery. The container constraints still prevent any negative content.
Reimplemented from Process.
|
overrideprotectedvirtual |
Get the rates of the process.
Read-only: computes the scheduled delivery from the current schedule state without modifying it. Schedule advancement happens in Finalize().
Implements Process.
|
overridevirtual |
Get the value pointer for a given element.
| name | name of the element to get. |
Reimplemented from ProcessOutflow.
|
nodiscardoverridevirtual |
Check that everything is correctly defined.
Reimplemented from ProcessOutflow.
|
static |
Register the process settings (parameters and logging defaults) in the settings model.
| modelSettings | The settings model to register the parameters in. |
|
overridevirtual |
Reset all the fluxes connected to the process.
Reimplemented from Process.
|
overridevirtual |
Assign the parameters to the process.
| processSettings | settings of the process containing the parameters. |
Reimplemented from Process.