2.0.0b10
catchment modelling framework
Loading...
Searching...
No Matches

Calculates snow melt using a simple degree day method. More...

+ Inheritance diagram for TempIndexSnowMelt:
+ Collaboration diagram for TempIndexSnowMelt:

Detailed Description

Calculates snow melt using a simple degree day method.

\[ q_{melt} [mm/day] = (T-T_{thres}) * r \]

Usage:

# Create a new snow water storage
snow = cell.add_storage('Snow','S')
# Split Rainfall and snow fall according to the current temperature
snowfall = cmf.Snowfall(snow,cell)
# Create a snowfall connection between snow and surfacewater)
snowmelt = cmf.SimpleTindexSnowMelt(snow,cell.surfacewater,cell,rate=7.0)

Public Member Functions

 TempIndexSnowMelt (cmf::water::WaterStorage::ptr snow, cmf::water::flux_node::ptr surface_water, cmf::upslope::Cell &cell, real rate=7.0)
 Creates a new snow melt connection.
 
real conc (cmf::math::Time t, const cmf::water::solute &_Solute)
 Returns the concentration of the flux.
 
flux_node::ptr get_target (const flux_node &inquirer)
 Returns the other end of a connection than the asking end.
 
flux_node::ptr get_target (int index) const
 With index 0, the left node is returned, with index 1 the right node of the connection.
 
real get_tracer_filter ()
 A value ranging from 0 to 1 to filter tracers out of the water flux.
 
real get_tracer_filter (solute S)
 A value ranging from 0 to 1 to filter tracers out of the water flux.
 
bool kill_me ()
 Deregisters this connection from its nodes. Returns true if only one reference is left.
 
flux_node::ptr left_node () const
 Returns the left node of this connection.
 
real q (const flux_node &inquirer, cmf::math::Time t)
 Returns the current flux through a connection. Negative signs mean out of the inquirer, positive are inflows to the inquirer.
 
void refresh (cmf::math::Time t)
 Performes a new calculation of the flux.
 
flux_node::ptr right_node () const
 returns the right node of this connection
 
void set_tracer_filter (real value)
 A value ranging from 0 to 1 to filter tracers out of the water flux.
 

Static Public Member Functions

static void use_for_cell (cmf::upslope::Cell &cell)
 Creates the connection between snow and surface water.
 

Public Attributes

real SnowMeltRate
 Rate of snow melt in mm/(degC day), default = 7.0.
 
const std::string type
 A string describing the type of the connection.
 

Constructor & Destructor Documentation

◆ TempIndexSnowMelt()

TempIndexSnowMelt ( cmf::water::WaterStorage::ptr snow,
cmf::water::flux_node::ptr surface_water,
cmf::upslope::Cell & cell,
real rate = 7.0 )

Creates a new snow melt connection.

Parameters
snowSnow storage, usually cel.snow
surface_watertarget of the melted water (usually cell.surfacewater)
cellThe cell, needed to get weather and area
rateThe rate of snow melt, given in mm/(degC day), default = 7.0

Member Function Documentation

◆ conc()

real conc ( cmf::math::Time t,
const cmf::water::solute & _Solute )
inherited

Returns the concentration of the flux.


If not overridden, it returns the concentration of the source of the flux (direction depending)

◆ get_tracer_filter()

real get_tracer_filter ( )
inherited

A value ranging from 0 to 1 to filter tracers out of the water flux.

1.0 is no filter and 0.0 means no solute is crossing this connection

◆ set_tracer_filter()

void set_tracer_filter ( real value)
inherited

A value ranging from 0 to 1 to filter tracers out of the water flux.

1.0 is no filter and 0.0 means no solute is crossing this connection

◆ use_for_cell()

static void use_for_cell ( cmf::upslope::Cell & cell)
static

Creates the connection between snow and surface water.

If no snow storage exists, it is created and precipitation is split up in Snow and Rain.