|
hydrobricks
|
#include <ProcessPercolationPrevah.h>
Public Member Functions | |
| ProcessPercolationPrevah (WaterContainer *container) | |
| bool | IsValid () const override |
| void | SetParameters (const ProcessSettings &processSettings) override |
| bool | NeedsGateBrickLinking () const override |
| void | AddGateBrick (Brick *brick) 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 | 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 bool | LinksMultipleTargets () const |
| virtual void | AddTargetBrickWithWeights (Brick *, const std::vector< Brick * > &) |
| virtual bool | IsLateralProcess () const noexcept |
| virtual bool | HasLinearResponse () const |
| virtual double | GetLinearResponseRate () const |
| virtual double | GetLinearResponseOffset () const |
| 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 | |
| double | GetSnowCoveredFraction () const |
| 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 | |
| vector< Brick * > | _gateBricks |
| vector< Snowpack * > | _snowpacks |
| const float * | _rate |
| const float * | _thresholdFraction |
| const float * | _conductivityFactor |
| const float * | _constantFraction |
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 |
PREVAH percolation: a constant maximum rate gated by the soil moisture state.
PERC = rate if SM >= FC PERC = rate × kwper × (SM/FC − θ) / (1 − θ) if θ×FC < SM < FC PERC = 0 if SM <= θ×FC
rate is the maximum percolation rate [mm/d], SM and FC the content and capacity of the gate bricks (the soil moisture stores) and θ the soil moisture fraction (PREVAH's CU, shared with the ET limit) below which percolation stops. The percolation draws from the process's own container (the upper zone) but is modulated by the soil state. kwper is PREVAH's hydraulic-conductivity factor (KWPER, 'conductivity_factor'); as in the original, it scales the ramp but not the rate at saturation.
PREVAH also percolates at the constant rate × kwper, whatever the soil moisture, where its ET limit (θ times the capacity from the soil map) is at least the capacity the land cover finally imposes: built-up and rock surfaces whose soil map promises more than their fixed 5 mm or 3 mm. That branch is off under snow (SWE above 0.1 mm), where the ET limit above the capacity stops the percolation altogether. 'constant_fraction' is the share of the unit following that branch (0 or 1 for a unit carrying a single land use); the snowpacks given as gate bricks tell its snow-covered part, each weighted by the area of its land cover.
With several soil gate bricks (one soil moisture store per land cover), the contents and the capacities are summed before the ratio is taken, which is the area-weighted mean saturation of the hydro unit: the stores are fed by their land cover, whose outgoing fluxes already carry its area fraction, so their contents are expressed over the whole unit.
|
overridevirtual |
Add a gate brick to the process (read-only state access; no flux). Called once per gate brick; a process reading several aggregates their states.
| brick | gate brick. |
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.
|
nodiscardprotected |
Snow-covered share of the unit, from the snowpack gate bricks (0 without any).
|
nodiscardoverridevirtual |
Check that everything is correctly defined.
Reimplemented from ProcessOutflow.
|
inlinenodiscardoverridevirtual |
Check if the process needs to link a gate brick (a brick whose state modulates the process rate without receiving its flux, e.g. the soil moisture store gating the PREVAH percolation).
Reimplemented from Process.
|
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.