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

A representation of a SoilLayer. More...

+ Inheritance diagram for SoilLayer:
+ Collaboration diagram for SoilLayer:

Detailed Description

A representation of a SoilLayer.

Public Member Functions

real conc (cmf::math::Time t, const cmf::water::solute &_Solute) const override
 Returns the current WaterQuality (concentration of all solutes)
 
real conc (const cmf::water::solute &_Solute) const
 Returns the concentration of the given solute.
 
void conc (const cmf::water::solute &_Solute, real NewConcetration)
 Sets a new concentration.
 
cmf::water::flux_connectionconnection_to (const cmf::water::flux_node &target)
 Returns the connection between this and target.
 
virtual real dxdt (const cmf::math::Time &time)
 Returns the derivate of the state variable at time time.
 
real flux_to (const cmf::water::flux_node &target, cmf::math::Time t)
 Returns the actual flux between this and target (positive sign means "from this into target")
 
cmf::geometry::point get_3d_flux (cmf::math::Time t)
 Returns the sum of all flux vectors.
 
virtual real get_capacity () const
 Returns the capacity of the water storage in m3.
 
real get_flow_crosssection (const cmf::upslope::SoilLayer &target, bool HorizontalLayers=false) const
 Calculates the shared crosssectional area of this and another soil water storage.
 
real get_gravitational_potential () const
 Gravitational get_potential in m, reference height is sea level.
 
real get_ice_fraction () const
 real (Ice_fraction)
 
real get_K () const
 Returns the actual isotropic conductivity using the function from soil \(\frac{m}{day}\).
 
virtual real get_K (cmf::geometry::point direction) const
 Returns the actual anisotropic conductivity along a direction \(K = (k_f \cdot d) K\).
 
virtual real get_lower_boundary () const
 Returns the lower boundary of the water storage below ground in m.
 
virtual real get_matrix_potential () const
 Calls RetentionCurve::Matrixpotential.
 
real get_porosity () const
 Returns the mean porosity in the layer.
 
real get_potential (cmf::math::Time t=cmf::math::never) const override
 Returns the total potential in m.
 
cmf::projectget_project () const
 Returns the project, this node is part of.
 
real get_rootfraction () const
 Returns the root fraction of the layer. If it is not explicitly set, it uses the parameters of the vegetation object of the cell.
 
virtual real get_saturated_depth () const
 Returns the depth for saturation.
 
virtual cmf::upslope::RetentionCurveget_soil () const
 Returns the soil properties of the water storage.
 
real get_state () const
 Returns the current state of the variable.
 
char get_state_variable_content () const
 A character indicating the integrated variable (either 'V' for Volume or 'h' for head)
 
double get_Tact (double Tpot)
 Returns a factor to indicate the draught stress to be multiplied with ETpot.
 
virtual real get_theta () const
 Returns the actual volumetric water content of the water storage.
 
virtual real get_upper_boundary () const
 Returns the upper boundary of the water storage below ground in m.
 
virtual real get_volume () const
 Returns the volume of water in this storage in m3
 
virtual real get_wetness () const
 Returns the wetness of the soil \( \frac{V_{H_2O}}{V_{pores}} \).
 
virtual bool is_connected (const cmf::math::StateVariable &other) const
 Returns True if this waterstorage is effected by another state.
 
bool is_storage () const override
 Returns true, since this is a storage.
 
real operator() (cmf::math::Time t) const
 returns the waterblance
 
bool remove_connection (cmf::water::flux_node::ptr To)
 Remove the connection.
 
void set_ice_fraction (real val)
 
virtual void set_potential (real waterhead)
 Sets the potential of this soil water storage.
 
void set_root_uptake_stress_function (const cmf::upslope::ET::RootUptakeStressFunction &stressfunction)
 Sets the root uptake stress function.
 
void set_rootfraction (real rootfraction)
 Sets the root fraction in this layer explicitly.
 
void set_state (real newState)
 Gives access to the state variable.
 
void set_state_variable_content (char content)
 A character indicating the integrated variable (either 'V' for Volume or 'h' for head)
 
virtual void set_volume (real newwatercontent)
 Sets the volume of water in this storage in m3
 
SoluteStorage & Solute (const cmf::water::solute _Solute)
 Returns the water quality of the water storage.
 
real waterbalance (cmf::math::Time t, const flux_connection *Without=0) const
 Returns the sum of all fluxes (positive and negative) at time t.
 

Public Attributes

std::string Name
 The Name of this node.
 
const int node_id
 The Id of the node.
 
cmf::geometry::point position
 The spatial position of the node.
 

Protected Member Functions

virtual real head_to_volume (real head) const
 Converts a head to the volume of stored water.
 
void MarkStateChangeHandled ()
 Sets the updated flag (m_StateIsNew) to false.
 
virtual void StateChangeAction ()
 Invalidates the saturated depth of the cell.
 
bool StateIsChanged ()
 Returns if the state was currently updated.
 
virtual real volume_to_head (real volume) const
 Converts a volume of stored water to the head.
 

Protected Attributes

std::unique_ptr< cmf::upslope::RetentionCurvem_retentioncurve
 The retention curve of the soil layer.
 
std::unique_ptr< cmf::upslope::ET::RootUptakeStressFunctionm_uptakefunction
 The uptake stress function of the soil layer.
 

Overrides of flux_node

virtual bool RecalcFluxes (cmf::math::Time t)
 Pure flux_nodes do not influence fluxes, therefore no recalculation of fluxes is required by flux_node.
 
virtual double is_empty () const
 Returns true if the node has no water.
 

Member Function Documentation

◆ get_flow_crosssection()

real get_flow_crosssection ( const cmf::upslope::SoilLayer & target,
bool HorizontalLayers = false ) const

Calculates the shared crosssectional area of this and another soil water storage.

If both layers belong to the same cell, the area of the cell is returned, if they belong to different cells the area of the vertical shared boundary is returned

Returns
get_area in m2
Parameters
targetThe other soil water storage
HorizontalLayersIf true, the layers are assumed to be parallel to the gravitational potential, otherwise they are assumed to be parallel to the ground topography

◆ get_gravitational_potential()

real get_gravitational_potential ( ) const

Gravitational get_potential in m, reference height is sea level.

If the layer is saturated, it returns the saturated depth above sea level, otherwise it returns the upperboundary of the layer

\[ \Psi_G=h \]

◆ get_potential()

real get_potential ( cmf::math::Time t = cmf::math::never) const
overridevirtual

Returns the total potential in m.

\[ \Psi = \Psi_M + \Psi_G \]

Reimplemented from flux_node.

◆ get_saturated_depth()

virtual real get_saturated_depth ( ) const
virtual

Returns the depth for saturation.

\[ z_{sat,this} = \left\{z_{cell}-\Psi_{tot} \mbox{ if } W<1 \\ z_{sat,upper layer} \right. \]

◆ get_Tact()

double get_Tact ( double Tpot)

Returns a factor to indicate the draught stress to be multiplied with ETpot.

1 = no stress, 0 = no uptake possible

◆ RecalcFluxes()

virtual bool RecalcFluxes ( cmf::math::Time t)
virtualinherited

Pure flux_nodes do not influence fluxes, therefore no recalculation of fluxes is required by flux_node.

WaterStorage overrides this, since state changes require an update of the fluxes

Reimplemented from flux_node.

◆ set_ice_fraction()

void set_ice_fraction ( real val)
Parameters
valIce_fraction (real)

◆ waterbalance()

real waterbalance ( cmf::math::Time t,
const flux_connection * Without = 0 ) const
inherited

Returns the sum of all fluxes (positive and negative) at time t.


Single fluxes can be excluded from the calculation

Parameters
tTime of the query
WithoutA flux_connection that is excluded from the waterbalance (e.g. to prevent closed circuits)