2.0.0b10
catchment modelling framework
Loading...
Searching...
No Matches
PowerLawConnection Class Reference

Calculates flux out of a storage as a linear function of its volume to a power. More...

+ Inheritance diagram for PowerLawConnection:
+ Collaboration diagram for PowerLawConnection:

Detailed Description

Calculates flux out of a storage as a linear function of its volume to a power.

This connection serves the same purpose as the old kinematic_wave connection, but the parameters are easier to explain.

\[ q = Q_0 {\left(\frac{V - V_{residual}}{V_0} \right)^\beta} \]

where:

  • \(V\) The actual volume of water stored in source
  • \(V_{residual} [m^3]\) The volume of water not flowing out (default = 0)
  • \(V_0\) A reference volume to scale the outflux. One can see \(V_0\) as the inflection point of the outflow curve
  • \(\beta\) A parameter to shape the response curve. \(Q_0\) is the outflow from the source in \(\frac{m^3}{day}\), when \(V = V_0\).
Warning
\(\beta < 0.5\) may lead to numerical troubles and have a dubious hydrological meaning. Please avoid.

Public Member Functions

 PowerLawConnection (WaterStorage::ptr source, flux_node::ptr target, real Q0, real V0, real beta=1.0, real residual=0.0)
 Creates a power law 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.
 

Public Attributes

real beta
 Shape parameter of the curve, \(\beta\).
 
real Q0
 outflow from the source in \(\frac{m^3}{day}\), when \(V = V_0\).
 
real residual
 residual volume of source
 
const std::string type
 A string describing the type of the connection.
 
real V0
 Reference volume \(V_0\).
 

Constructor & Destructor Documentation

◆ PowerLawConnection()

PowerLawConnection ( WaterStorage::ptr source,
flux_node::ptr target,
real Q0,
real V0,
real beta = 1.0,
real residual = 0.0 )

Creates a power law connection.

Parameters
sourceWater storage from which the water flows out. Flux is a function of source.volume
targetTarget node (boundary condition or storage). Does not influence the strength of the flow
Q0Reference flow \(Q_0 = q(V_0)\) Outflow when the source storage equals the reference volume
V0Reference volume \(V_0\) The reference volume to scale the exponent
beta\(\beta [-]\) An empirical exponent to shape the flux function (default = 1 (linear function))
residual\(V_{residual} [m^3]\) The volume of water not flowing out (default = 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