|
hydrobricks
|
#include <ProcessOutflowLinearThreshold.h>
Public Member Functions | |
| ProcessOutflowLinearThreshold (WaterContainer *container) | |
| bool | IsValid () const override |
| void | SetParameters (const ProcessSettings &processSettings) override |
| bool | HasLinearResponse () const override |
| double | GetLinearResponseRate () const override |
| double | GetLinearResponseOffset () const override |
Public Member Functions inherited from ProcessOutflow | |
| ProcessOutflow (WaterContainer *container) | |
| int | GetConnectionCount () const override |
| double * | GetValuePointer (std::string_view name) override |
Public Member Functions inherited from Process | |
| Process (WaterContainer *container) | |
| virtual void | Reset () |
| virtual void | Validate () const |
| const float * | GetParameterValuePointer (const ProcessSettings &processSettings, std::string_view name) |
| void | SetParentContext (HydroUnit *unit, Brick *brick) |
| 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 | RequiresDailyTimeStep () const |
| virtual bool | NeedsTargetBrickLinking () const |
| virtual bool | NeedsGateBrickLinking () const |
| virtual bool | HasConstraintPriority () const |
| virtual const vecDouble & | GetChangeRates () |
| virtual void | StoreInOutgoingFlux (double *rate, int index) |
| void | ApplyChange (int connectionIndex, double rate, double timeStepInDays) |
| virtual void | Finalize () |
| virtual vecDoublePt | GetStateVariables () |
| const string & | GetName () const |
| void | SetName (const string &name) |
| void | SetTimeMachine (TimeMachine *timeMachine) |
| WaterContainer * | GetWaterContainer () const |
| virtual void | SetTargetBrick (Brick *) |
| virtual void | AddGateBrick (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) |
Protected Member Functions | |
| const vecDouble & | GetRates () override |
Protected Member Functions inherited from Process | |
| double | GetForcingRate (Forcing *forcing) const |
| double | GetTimeStepInDays () const |
| int | GetCurrentDayOfYear () const |
| const vecDouble & | StoreRates (std::initializer_list< double > rates) |
| double | GetSumChangeRatesOtherProcesses () const |
Protected Attributes | |
| const float * | _responseFactor |
| const float * | _threshold |
Protected Attributes inherited from Process | |
| string | _name |
| WaterContainer * | _container |
| TimeMachine * | _timeMachine {nullptr} |
| HydroUnit * | _hydroUnit {nullptr} |
| string | _parentBrickName |
| std::vector< std::unique_ptr< Flux > > | _outputs |
| vecDouble | _changeRates |
Linear reservoir outflow above a storage threshold (PREVAH surface runoff).
outflow = k × max(0, S − θ)
k is the response factor [1/d], S the storage content [mm] and θ the storage threshold [mm] below which no outflow occurs. With θ = 0 it reduces to a linear reservoir. This is the PREVAH upper-zone fast runoff Q0 = K0 × (SUZ − SGRLUZ).
|
inlinenodiscardoverridevirtual |
Get the constant term of the affine response (rate = k × S − offset), for the reservoirs that drain the content above a threshold θ (offset = k × θ). It is zero for a plain linear reservoir. Only valid when HasLinearResponse() returns true.
Reimplemented from Process.
|
inlinenodiscardoverridevirtual |
Get the linear response coefficient k of the process (rate = k × S − offset). Only valid when HasLinearResponse() returns true.
Reimplemented from Process.
|
overrideprotectedvirtual |
Get the rates of the process.
Implementations must store their result via StoreRates() (or directly in the _changeRates buffer) and return the reference, to avoid allocating on the hot path.
Implements Process.
|
nodiscardoverridevirtual |
Check if the process rate is affine in the container content (rate = k × S − offset). Processes reporting a linear response can be integrated exactly by the analytic solver.
The response is affine (k × (S − θ)) only while the store is above the threshold; below it the process is simply off, and reporting no linear response keeps it out of the analytic solver's decay coefficient.
Reimplemented from Process.
|
nodiscardoverridevirtual |
Check that everything is correctly defined.
Reimplemented from ProcessOutflow.
|
static |
Register the process parameters and forcing in the settings model.
| modelSettings | The settings model to register the parameters in. |
|
overridevirtual |
Assign the parameters to the process.
| processSettings | settings of the process containing the parameters. |
Reimplemented from Process.