hydrobricks
Loading...
Searching...
No Matches
ProcessLateralSnowRedistributionFrey Class Reference

#include <ProcessLateralSnowRedistributionFrey.h>

Inheritance diagram for ProcessLateralSnowRedistributionFrey:
ProcessLateral Process

Public Member Functions

 ProcessLateralSnowRedistributionFrey (WaterContainer *container, bool dynamicDensity=false)
 
bool IsValid () const override
 
void SetHydroUnitProperties (HydroUnit *unit, Brick *brick) override
 
void SetParameters (const ProcessSettings &processSettings) override
 
void AttachForcing (Forcing *forcing) override
 
void Reset () override
 
void Finalize () override
 
bool IsLateralProcess () const noexcept override
 
- Public Member Functions inherited from ProcessLateral
 ProcessLateral (WaterContainer *container)
 
int GetConnectionCount () const override
 
double * GetValuePointer (std::string_view name) override
 
void AttachFluxOutWithWeight (std::unique_ptr< Flux > flux, double weight=1.0)
 
double GetOriginLandCoverAreaFraction () const
 
double GetTargetLandCoverAreaFraction (Flux *flux)
 
double ComputeFractionAreas (Flux *flux)
 
- Public Member Functions inherited from Process
 Process (WaterContainer *container)
 
virtual void Validate () const
 
void AttachFluxOut (std::unique_ptr< Flux > flux)
 
int GetOutputFluxCount () const
 
FluxGetOutputFlux (size_t index) const
 
virtual bool ToAtmosphere () const
 
virtual bool NeedsTargetBrickLinking () const
 
virtual const vecDouble & GetChangeRates ()
 
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)
 
WaterContainerGetWaterContainer () const
 
virtual void SetTargetBrick (Brick *)
 
virtual bool LinksMultipleTargets () const
 
virtual void AddTargetBrickWithWeights (Brick *, const std::vector< Brick * > &)
 
bool HasOutputFluxes () const noexcept
 
bool HasWaterContainer () const noexcept
 

Static Public Member Functions

static void RegisterProcessSettings (SettingsModel *modelSettings)
 
static void RegisterProcessSettingsDynamic (SettingsModel *modelSettings)
 
- Static Public Member Functions inherited from Process
static std::unique_ptr< ProcessFactory (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

const vecDouble & GetRates () override
 
- Protected Member Functions inherited from Process
const vecDouble & StoreRates (std::initializer_list< double > rates)
 
double GetSumChangeRatesOtherProcesses () const
 

Protected Attributes

bool _dynamicDensity
 
float _slopeDeg
 
Forcing_temperature
 
const float * _correction
 
const float * _holdingCapacity
 
const float * _rhoMax
 
const float * _maxSnowDepth
 
const float * _snowDensity
 
const float * _rhoMin
 
const float * _rhoFreshMax
 
const float * _rhoSettling
 
const float * _rhoScale
 
const float * _tScale
 
double _density
 
double _prevSwe
 
- Protected Attributes inherited from ProcessLateral
vecDouble _weights
 
- Protected Attributes inherited from Process
string _name
 
WaterContainer_container
 
TimeMachine_timeMachine {nullptr}
 
std::vector< std::unique_ptr< Flux > > _outputs
 
vecDouble _changeRates
 

Detailed Description

Conceptual snow redistribution (Frey & Holzmann, 2015).

Moves snow exceeding a land-cover-based holding capacity (H_v) to downslope hydro units. The redistributed amount is scaled by a distribution coefficient f_rho that depends on the snow density and the slope angle, and by a calibratable correction coefficient C (paper Eqs. 12-13). Working in SWE (the only quantity the snowpack stores), with H_v given as a snow-depth threshold: excess = max(swe - H_v / sweToDepthFactor, 0) f_rho = ((rhoMax - rho) / rhoMax) * exp(-rho / rhoMax) * (slope / 90) redistributed = excess * f_rho * C

The excess SWE is distributed over the connected outputs by their weights (the lateral-connection fractions, which encode the 1/SUM(A) split among acceptors) and target area fractions, capped at 1000 mm and skipped where the target snowpack is already over-accumulated.

Two snow-density variants are supported:

  • constant: rho is a fixed parameter (snow_density); f_rho then depends only on the slope.
  • dynamic: rho is tracked per snowpack and evolves with air temperature (fresh-snow density, paper Eqs. 8-9) and settling toward rhoMax (a simplification of Eq. 10, since hydrobricks does not track the liquid water content the original settling relation uses). The density state is advanced exactly once per time step in Finalize().

Member Function Documentation

◆ AttachForcing()

void ProcessLateralSnowRedistributionFrey::AttachForcing ( Forcing * forcing)
overridevirtual

Attach forcing to the process.

Parameters
forcingforcing to attach.

Reimplemented from Process.

◆ Finalize()

void ProcessLateralSnowRedistributionFrey::Finalize ( )
overridevirtual

Finalize the process.

Reimplemented from Process.

◆ GetRates()

const vecDouble & ProcessLateralSnowRedistributionFrey::GetRates ( )
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.

Returns
reference to the reusable buffer holding the rates.

Implements Process.

◆ IsLateralProcess()

bool ProcessLateralSnowRedistributionFrey::IsLateralProcess ( ) const
inlinenodiscardoverridevirtualnoexcept

Check if the process is a lateral process.

Returns
true if the process is a lateral process.

Reimplemented from ProcessLateral.

◆ IsValid()

bool ProcessLateralSnowRedistributionFrey::IsValid ( ) const
nodiscardoverridevirtual

Check that everything is correctly defined.

Returns
true if everything is correctly defined.

Reimplemented from ProcessLateral.

◆ RegisterProcessSettings()

void ProcessLateralSnowRedistributionFrey::RegisterProcessSettings ( SettingsModel * modelSettings)
static

Register the process parameters for the constant-density variant.

Parameters
modelSettingsThe settings model to register the parameters in.

◆ RegisterProcessSettingsDynamic()

void ProcessLateralSnowRedistributionFrey::RegisterProcessSettingsDynamic ( SettingsModel * modelSettings)
static

Register the process parameters and forcing for the dynamic-density variant.

Parameters
modelSettingsThe settings model to register the parameters in.

◆ Reset()

void ProcessLateralSnowRedistributionFrey::Reset ( )
overridevirtual

Reset all the fluxes connected to the process.

Reimplemented from Process.

◆ SetHydroUnitProperties()

void ProcessLateralSnowRedistributionFrey::SetHydroUnitProperties ( HydroUnit * unit,
Brick * brick )
overridevirtual

Set the properties of the hydro unit.

Parameters
unitthe related hydro unit.
brickthe related brick.

Reimplemented from Process.

◆ SetParameters()

void ProcessLateralSnowRedistributionFrey::SetParameters ( const ProcessSettings & processSettings)
overridevirtual

Assign the parameters to the process.

Parameters
processSettingssettings of the process containing the parameters.

Reimplemented from Process.


The documentation for this class was generated from the following files: