HydPy-WQ (base model)¶
The HydPy-WQ base model provides features to implement small function-like submodels for calculating discharge based on information like the current water level.
Method Features¶
- class hydpy.models.wq.wq_model.Model[source]¶
Bases:
AdHocModel
,SubmodelInterface
HydPy-WQ (base model).
- The following interface methods are available to main models using the defined model as a submodel:
Calculate_Discharge_V1
Calculate the discharge based on the water depth given in m according to Brauer et al. (2014) and return it in mm/T.Set_WaterDepth_V1
Set the water depth in m.Set_WaterLevel_V1
Set the water level in m.Set_WettedArea_V1
Set the wetted area in m².Use_WaterDepth_V1
Set the water depth in m and use it to calculate all other properties.Use_WaterDepth_V2
Set the water depth in m and use it to calculate all other properties.Use_WaterDepth_V3
Set the water depth in m and use it to calculate all other properties.Use_WaterLevel_V1
Set the water level in m and use it to calculate all other properties.Use_WaterLevel_V2
Set the water level in m and use it to calculate all other properties.Use_WaterLevel_V3
Set the water level in m and use it to calculate all other properties.Use_WettedArea_V1
Set the wetted area in m² and use it to calculate all other properties.Get_WaterDepth_V1
Get the water depth in m.Get_WaterLevel_V1
Get the water level in m.Get_WettedArea_V1
Get the wetted area in m².Get_WettedArea_V2
Get the wetted area in m².Get_WettedPerimeter_V1
Get the wetted perimeter in m.Get_SurfaceWidth_V1
Get the surface width in m.Get_SurfaceWidth_V2
Get the surface width in m.Get_Discharge_V1
Get the discharge in m³/s.Get_Celerity_V1
Get the wave celerity in m/s.
- The following “additional methods” might be called by one or more of the other methods or are meant to be directly called by the user:
Calc_WaterDepth_V1
Calculate the water depth based on the current water level.Calc_WaterDepth_V2
Calculate the water depth based on the current wetted area.Calc_WaterDepth_V3
Calculate the water depth based on the current water level.Calc_WaterLevel_V1
Calculate the water level based on the current water depth.Calc_WaterLevel_V2
Calculate the water level based on the current water depth.Calc_Index_Excess_Weight_V1
Calculate some aide sequences that help to ease other calculations.Calc_WettedAreas_V1
Calculate the wetted area for each trapeze range.Calc_FlowAreas_V1
Calculate the sector-specific wetted areas of those subareas of the cross section involved in water routing.Calc_TotalAreas_V1
Calculate the sector-specific wetted areas of the total cross section.Calc_WettedArea_V1
Sum up the individual trapeze ranges’ wetted areas.Calc_FlowArea_V1
Sum up the individual cross-section sectors’ flow areas.Calc_TotalArea_V1
Sum up the individual cross-section sectors’ total wetted areas.Calc_WettedPerimeters_V1
Calculate the wetted perimeter for each trapeze range.Calc_FlowPerimeters_V1
Interpolate the sector-specific wetted perimeters of those subareas of the cross section involved in water routing.Calc_WettedPerimeter_V1
Sum up the individual trapeze ranges’ wetted perimeters.Calc_WettedPerimeterDerivatives_V1
Calculate the change in the wetted perimeter of each trapeze range with respect to the water level increase.Calc_FlowPerimeterDerivatives_V1
Take the sector-specific wetted perimeter derivatives of those subareas of the cross section involved in water routing.Calc_SurfaceWidths_V1
Calculate the surface width for each trapeze range.Calc_SurfaceWidth_V1
Sum the individual trapeze ranges’ surface widths.Calc_FlowWidths_V1
Interpolate the sector-specific widths of those subareas of the cross section involved in water routing.Calc_TotalWidths_V1
Interpolate the sector-specific widths of the total cross section.Calc_TotalWidth_V1
Sum the individual cross-section sectors’ water surface widths.Calc_Discharges_V1
Calculate the discharge for each trapeze range.Calc_Discharges_V2
Calculate the discharge for each cross-section sector.Calc_Discharge_V2
Sum the individual trapeze ranges’ discharges.Calc_Discharge_V3
Sum up the individual cross-section sectors’ discharges.Calc_DischargeDerivatives_V1
Calculate the discharge change for each trapeze range with respect to a water level increase.Calc_DischargeDerivatives_V2
Calculate the discharge change for each cross section-sector with respect to a water level increase.Calc_DischargeDerivative_V1
Sum the individual trapeze ranges’ discharge derivatives.Calc_DischargeDerivative_V2
Sum the individual cross-section sectors’ discharge derivatives.Calc_Celerity_V1
Calculate the kinematic wave celerity.Calc_Celerity_V2
Calculate the kinematic wave celerity.
- REUSABLE_METHODS: ClassVar[tuple[type[ReusableMethod], ...]] = ()¶
- class hydpy.models.wq.wq_model.Calculate_Discharge_V1[source]¶
Bases:
Method
Calculate the discharge based on the water depth given in m according to Brauer et al. (2014) and return it in mm/T.
- Requires the control parameters:
ChannelDepth
CrestHeight
BankfullDischarge
DischargeExponent
- Requires the derived parameter:
- Basic equation (discontinuous):
- \[\begin{split}q = q_{max} \cdot \left( \frac{max(h-h_{max}, \ 0)}{h_{max}-h_{min}} \right)^x \\ \\ q = Discharge \\ q_{max} = BankfullDischarge \\ h = waterdepth \\ h_{max} = ChannelDepth \\ h_{min} = CrestHeight \\ x = DischargeExponent\end{split}\]
Examples:
>>> from hydpy.models.wq_walrus import * >>> simulationstep("12h") >>> parameterstep("1d") >>> channeldepth(5.0) >>> crestheight(2.0) >>> bankfulldischarge(2.0) >>> dischargeexponent(2.0) >>> from hydpy import round_ >>> hs = 1.0, 1.9, 2.0, 2.1, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0
Without smoothing:
>>> crestheighttolerance(0.0) >>> derived.crestheightregularisation.update() >>> for h in hs: ... round_([h, model.calculate_discharge_v1(h)]) 1.0, 0.0 1.9, 0.0 2.0, 0.0 2.1, 0.001111 3.0, 0.111111 4.0, 0.444444 5.0, 1.0 6.0, 1.777778 7.0, 2.777778 8.0, 4.0
Without smooting:
>>> crestheighttolerance(0.1) >>> derived.crestheightregularisation.update() >>> for h in hs: ... round_([h, model.calculate_discharge_v1(h)]) 1.0, 0.0 1.9, 0.0 2.0, 0.00001 2.1, 0.001111 3.0, 0.111111 4.0, 0.444444 5.0, 1.0 6.0, 1.777778 7.0, 2.777778 8.0, 4.0
- class hydpy.models.wq.wq_model.Calc_WaterDepth_V1[source]¶
Bases:
Method
Calculate the water depth based on the current water level.
- Required by the methods:
- Requires the control parameter:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation:
- \[WaterDepth = max(WaterLevel - BottomLevels_{\,0}, \ 0)\]
Examples:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(2) >>> bottomlevels(2.0, 3.0) >>> factors.waterlevel(6.0) >>> model.calc_waterdepth_v1() >>> factors.waterdepth waterdepth(4.0)
>>> factors.waterlevel(1.0) >>> model.calc_waterdepth_v1() >>> factors.waterdepth waterdepth(0.0)
- class hydpy.models.wq.wq_model.Calc_WaterDepth_V2[source]¶
Bases:
Method
Calculate the water depth based on the current wetted area.
- Required by the method:
- Requires the control parameters:
- Requires the derived parameters:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation:
- \[\begin{split}WaterDepth = \begin{cases} a / w &|\ s = 0 \\ \left( \sqrt{4 \cdot s \cdot a + w^2} - w \right) / (2 \cdot s) &|\ s > 0 \\ \end{cases} \\ a = WettedArea \\ w = BottomWidth \\ s = SideSlope\end{split}\]
Examples:
One can understand
Calc_WaterDepth_V2
as an inverse method ofCalc_WettedAreas_V1
(andCalc_WettedArea_V1
). Hence, the following convenience function allows the creation of examples that are directly comparable to those on methodCalc_WettedAreas_V1
:>>> from hydpy import print_vector, round_ >>> def test(*wettedareas): ... derived.trapezeheights.update() ... derived.slopewidths.update() ... derived.trapezeareas.update() ... for a in wettedareas: ... factors.wettedarea = a ... model.calc_waterdepth_v2() ... print_vector([a, factors.waterdepth.value])
The first example deals with identical rectangular trapezes. We pass different wetted areas to the test function. These are the sums of the wetted areas of the different trapeze ranges calculated in the first example on method
Calc_WettedAreas_V1
. As expected, methodCalc_WaterDepth_V2
finds the water depths used as input data for this example. However, note that negative wetted areas result in zero water depths:>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(3) >>> bottomlevels(1.0, 2.0, 3.0) >>> bottomwidths(2.0) >>> sideslopes(0.0) >>> factors.wettedarea = 0.0 >>> test(-0.5, 0.0, 1.0, 2.0, 4.0, 6.0, 9.0, 12.0, 15.0, 18.0) -0.5, 0.0 0.0, 0.0 1.0, 0.5 2.0, 1.0 4.0, 1.5 6.0, 2.0 9.0, 2.5 12.0, 3.0 15.0, 3.5 18.0, 4.0
The second example deals with identical triangular trapezes and corresponds to the second example on method
Calc_WettedAreas_V1
:>>> bottomlevels(1.0, 2.0, 3.0) >>> bottomwidths(0.0) >>> sideslopes(2.0) >>> test(-0.5, 0.0, 0.5, 2.0, 4.5, 8.0, 12.5, 18.0, 24.5, 32.0) -0.5, 0.0 0.0, 0.0 0.5, 0.5 2.0, 1.0 4.5, 1.5 8.0, 2.0 12.5, 2.5 18.0, 3.0 24.5, 3.5 32.0, 4.0
The third example deals with identical “complete” trapezes and corresponds to the third example on method
Calc_WettedAreas_V1
:>>> bottomlevels(1.0, 2.0, 3.0) >>> bottomwidths(2.0) >>> sideslopes(2.0) >>> test(-0.5, 0.0, 1.5, 4.0, 8.5, 14.0, 21.5, 30.0, 39.5, 50.0) -0.5, 0.0 0.0, 0.0 1.5, 0.5 4.0, 1.0 8.5, 1.5 14.0, 2.0 21.5, 2.5 30.0, 3.0 39.5, 3.5 50.0, 4.0
The fourth example mixes three different geometries and corresponds to the fourth example on method
Calc_WettedAreas_V1
:>>> bottomlevels(1.0, 3.0, 4.0) >>> bottomwidths(2.0, 0.0, 2.0) >>> sideslopes(0.0, 2.0, 2.0) >>> test(-0.5, 0.0, 1.0, 2.0, 3.0, 4.0, 5.5, 8.0, 12.5, 18.0) -0.5, 0.0 0.0, 0.0 1.0, 0.5 2.0, 1.0 3.0, 1.5 4.0, 2.0 5.5, 2.5 8.0, 3.0 12.5, 3.5 18.0, 4.0
- class hydpy.models.wq.wq_model.Calc_WaterDepth_V3[source]¶
Bases:
Method
Calculate the water depth based on the current water level.
- Required by the method:
- Requires the control parameter:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation:
Examples:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbwidths(2) >>> heights(2.0, 3.0) >>> factors.waterlevel(6.0) >>> model.calc_waterdepth_v3() >>> factors.waterdepth waterdepth(4.0)
>>> factors.waterlevel(1.0) >>> model.calc_waterdepth_v3() >>> factors.waterdepth waterdepth(0.0)
- class hydpy.models.wq.wq_model.Calc_WaterLevel_V1[source]¶
Bases:
Method
Calculate the water level based on the current water depth.
- Required by the methods:
- Requires the control parameter:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation:
- \[WaterLevel = WaterDepth + BottomLevels_{\,0}\]
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(2) >>> bottomlevels(2.0, 3.0) >>> factors.waterdepth(4.0) >>> model.calc_waterlevel_v1() >>> factors.waterlevel waterlevel(6.0)
- class hydpy.models.wq.wq_model.Calc_WaterLevel_V2[source]¶
Bases:
Method
Calculate the water level based on the current water depth.
- Required by the method:
- Requires the control parameter:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation:
- \[WaterLevel = WaterDepth + Heights_0\]
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbwidths(2) >>> heights(2.0, 3.0) >>> factors.waterdepth(4.0) >>> model.calc_waterlevel_v2() >>> factors.waterlevel waterlevel(6.0)
- class hydpy.models.wq.wq_model.Calc_Index_Excess_Weight_V1[source]¶
Bases:
Method
Calculate some aide sequences that help to ease other calculations.
- Required by the methods:
- Requires the control parameters:
- Requires the factor sequence:
- Calculates the aide sequences:
- Basic equations:
- \[\begin{split}E = L - H_i \\ w = E / (H_{i+1} - H_i) \\ \\ L = WaterLevel \\ H = Heights \\ i = Index \\ E = Excess \\ w = Weight\end{split}\]
Example:
Index
corresponds to the measured height directly equal to or below the current height (and is zero if the current height is smaller than the lowest measured height).Excess
corresponds to the difference between the actual and the indexed height.Weight
serves as a linear weighting factor and grows from zero to one when increasing the current height from the next-lower to the next-upper height (and isnan
in case there is no next-upper height):>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbwidths(3) >>> heights(1.0, 5.0, 7.0) >>> from hydpy import print_vector >>> for waterlevel in range(10): ... factors.waterlevel = waterlevel ... model.calc_index_excess_weight_v1() ... print_vector([waterlevel, aides.index.value, aides.excess.value, ... aides.weight.value]) 0, 0.0, 0.0, 0.0 1, 0.0, 0.0, 0.0 2, 0.0, 1.0, 0.25 3, 0.0, 2.0, 0.5 4, 0.0, 3.0, 0.75 5, 1.0, 0.0, 0.0 6, 1.0, 1.0, 0.5 7, 2.0, 0.0, nan 8, 2.0, 1.0, nan 9, 2.0, 2.0, nan
- class hydpy.models.wq.wq_model.Calc_WettedAreas_V1[source]¶
Bases:
Method
Calculate the wetted area for each trapeze range.
- Required by the methods:
Use_WaterDepth_V1
Use_WaterDepth_V2
Use_WaterLevel_V1
Use_WaterLevel_V2
Use_WettedArea_V1
- Requires the control parameters:
- Requires the derived parameters:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation:
- \[\begin{split}WettedAreas_i = \begin{cases} 0 &|\ d < 0 \\ (W_B + S_S\cdot d) \cdot d &|\ 0 \leq d < H_T \\ (W_B + W_S / 2) \cdot H_T + (W_B + W_S) \cdot (d - H_T) &|\ H_T \leq d \\ \end{cases} \\ \\ d = WaterDepth - BottomDepth_i \\ H_T = TrapezeHeights_i \\ W_B = BottomWidths_i \\ S_S = SideSlopes_i \\ W_S = SlopeWidths_i\end{split}\]
Examples:
The following convenience function executes
Calc_WettedAreas_V1
for different water depths and prints the resulting wetted areas:>>> from hydpy import print_vector, round_ >>> def test(): ... derived.bottomdepths.update() ... derived.trapezeheights.update() ... derived.slopewidths.update() ... for d in [0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0]: ... factors.waterdepth = d ... model.calc_wettedareas_v1() ... round_(d, end=": ") ... print_vector(factors.wettedareas.values)
The first example deals with identical rectangular trapezes. There are no differences except those due to the different bottom levels:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(3) >>> bottomlevels(1.0, 2.0, 3.0) >>> bottomwidths(2.0) >>> sideslopes(0.0) >>> test() 0.0: 0.0, 0.0, 0.0 0.5: 1.0, 0.0, 0.0 1.0: 2.0, 0.0, 0.0 1.5: 3.0, 1.0, 0.0 2.0: 4.0, 2.0, 0.0 2.5: 5.0, 3.0, 1.0 3.0: 6.0, 4.0, 2.0 3.5: 7.0, 5.0, 3.0 4.0: 8.0, 6.0, 4.0
The second example deals with identical triangular trapezes. Here, the heights of the individual trapezes also matter because they mark where the triangular shape switches to a rectangular shape:
>>> bottomlevels(1.0, 2.0, 3.0) >>> bottomwidths(0.0) >>> sideslopes(2.0) >>> test() 0.0: 0.0, 0.0, 0.0 0.5: 0.5, 0.0, 0.0 1.0: 2.0, 0.0, 0.0 1.5: 4.0, 0.5, 0.0 2.0: 6.0, 2.0, 0.0 2.5: 8.0, 4.0, 0.5 3.0: 10.0, 6.0, 2.0 3.5: 12.0, 8.0, 4.5 4.0: 14.0, 10.0, 8.0
The third example deals with identical “complete” trapezes by combining the first two geometries:
>>> bottomlevels(1.0, 2.0, 3.0) >>> bottomwidths(2.0) >>> sideslopes(2.0) >>> test() 0.0: 0.0, 0.0, 0.0 0.5: 1.5, 0.0, 0.0 1.0: 4.0, 0.0, 0.0 1.5: 7.0, 1.5, 0.0 2.0: 10.0, 4.0, 0.0 2.5: 13.0, 7.0, 1.5 3.0: 16.0, 10.0, 4.0 3.5: 19.0, 13.0, 7.5 4.0: 22.0, 16.0, 12.0
The fourth example mixes three different geometries:
>>> bottomlevels(1.0, 3.0, 4.0) >>> bottomwidths(2.0, 0.0, 2.0) >>> sideslopes(0.0, 2.0, 2.0) >>> test() 0.0: 0.0, 0.0, 0.0 0.5: 1.0, 0.0, 0.0 1.0: 2.0, 0.0, 0.0 1.5: 3.0, 0.0, 0.0 2.0: 4.0, 0.0, 0.0 2.5: 5.0, 0.5, 0.0 3.0: 6.0, 2.0, 0.0 3.5: 7.0, 4.0, 1.5 4.0: 8.0, 6.0, 4.0
- class hydpy.models.wq.wq_model.Calc_FlowAreas_V1[source]¶
Bases:
Method
Calculate the sector-specific wetted areas of those subareas of the cross section involved in water routing.
- Required by the methods:
- Requires the control parameter:
- Requires the derived parameters:
- Requires the factor sequence:
- Requires the aide sequences:
- Calculates the factor sequence:
- Basic equation:
- \[\begin{split}A = AS_i + E \cdot (SW_i + W) / 2 \\ \\ i = Index \\ E = Excess \\ A = FlowAreas \\ W = FlowWidths \\ AS = SectorFlowAreas \\ WS = SectorFlowWidths\end{split}\]
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbwidths(9) >>> nmbsectors(4) >>> heights(1.0, 3.0, 4.0, 4.0, 4.0, 5.0, 6.0, 7.0, 8.0) >>> flowwidths(2.0, 4.0, 6.0, 14.0, 18.0, 18.0, 24.0, 28.0, 30.0) >>> transitions(2, 3, 5) >>> derived.sectorflowwidths.update() >>> derived.sectorflowareas.update() >>> from hydpy import print_vector >>> for waterlevel in range(11): ... factors.waterlevel = waterlevel ... model.calc_index_excess_weight_v1() ... model.calc_flowwidths_v1() ... model.calc_flowareas_v1() ... print_vector([waterlevel, *factors.flowareas.values]) 0, 0.0, 0.0, 0.0, 0.0 1, 0.0, 0.0, 0.0, 0.0 2, 2.5, 0.0, 0.0, 0.0 3, 6.0, 0.0, 0.0, 0.0 4, 11.0, 0.0, 0.0, 0.0 5, 17.0, 8.0, 4.0, 0.0 6, 23.0, 16.0, 8.0, 3.0 7, 29.0, 24.0, 12.0, 11.0 8, 35.0, 32.0, 16.0, 22.0 9, 41.0, 40.0, 20.0, 34.0 10, 47.0, 48.0, 24.0, 46.0
- class hydpy.models.wq.wq_model.Calc_TotalAreas_V1[source]¶
Bases:
Method
Calculate the sector-specific wetted areas of the total cross section.
- Required by the methods:
- Requires the control parameter:
- Requires the derived parameters:
- Requires the factor sequence:
- Requires the aide sequences:
- Calculates the factor sequence:
- Basic equation:
- \[\begin{split}A = AS_i + E \cdot (SW_i + W) / 2 \\ \\ i = Index \\ E = Excess \\ A = TotalAreas \\ W = TotalWidths \\ AS = SectorTotalAreas \\ WS = SectorTotalWidths\end{split}\]
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbwidths(9) >>> nmbsectors(4) >>> heights(1.0, 3.0, 4.0, 4.0, 4.0, 5.0, 6.0, 7.0, 8.0) >>> totalwidths(2.0, 4.0, 6.0, 14.0, 18.0, 18.0, 24.0, 28.0, 30.0) >>> transitions(2, 3, 5) >>> derived.sectortotalwidths.update() >>> derived.sectortotalareas.update() >>> from hydpy import print_vector >>> for waterlevel in range(11): ... factors.waterlevel = waterlevel ... model.calc_index_excess_weight_v1() ... model.calc_totalwidths_v1() ... model.calc_totalareas_v1() ... print_vector([waterlevel, *factors.totalareas.values]) 0, 0.0, 0.0, 0.0, 0.0 1, 0.0, 0.0, 0.0, 0.0 2, 2.5, 0.0, 0.0, 0.0 3, 6.0, 0.0, 0.0, 0.0 4, 11.0, 0.0, 0.0, 0.0 5, 17.0, 8.0, 4.0, 0.0 6, 23.0, 16.0, 8.0, 3.0 7, 29.0, 24.0, 12.0, 11.0 8, 35.0, 32.0, 16.0, 22.0 9, 41.0, 40.0, 20.0, 34.0 10, 47.0, 48.0, 24.0, 46.0
- class hydpy.models.wq.wq_model.Calc_WettedArea_V1[source]¶
Bases:
Method
Sum up the individual trapeze ranges’ wetted areas.
- Required by the methods:
Use_WaterDepth_V1
Use_WaterDepth_V2
Use_WaterLevel_V1
Use_WaterLevel_V2
Use_WettedArea_V1
- Requires the control parameter:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation:
\(WettedArea = \sum_{i=1}^{NmbTrapezes} WettedAreas_i\)
Examples:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(3) >>> factors.wettedareas(2.0, 3.0, 1.0) >>> model.calc_wettedarea_v1() >>> factors.wettedarea wettedarea(6.0)
- class hydpy.models.wq.wq_model.Calc_FlowArea_V1[source]¶
Bases:
Method
Sum up the individual cross-section sectors’ flow areas.
- Required by the methods:
- Requires the control parameter:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation:
\(FlowArea = \sum_{i=1}^{NmbSectors} FlowAreas_i\)
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbsectors(3) >>> factors.flowareas(2.0, 3.0, 1.0) >>> model.calc_flowarea_v1() >>> factors.flowarea flowarea(6.0)
- class hydpy.models.wq.wq_model.Calc_TotalArea_V1[source]¶
Bases:
Method
Sum up the individual cross-section sectors’ total wetted areas.
- Required by the methods:
- Requires the control parameter:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation:
\(TotalArea = \sum_{i=1}^{NmbSectors} TotalAreas_i\)
Examples:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbsectors(3) >>> factors.totalareas(2.0, 3.0, 1.0) >>> model.calc_totalarea_v1() >>> factors.totalarea totalarea(6.0)
- class hydpy.models.wq.wq_model.Calc_WettedPerimeters_V1[source]¶
Bases:
Method
Calculate the wetted perimeter for each trapeze range.
- Required by the methods:
Use_WaterDepth_V1
Use_WaterDepth_V2
Use_WaterLevel_V1
Use_WaterLevel_V2
Use_WettedArea_V1
- Requires the control parameters:
- Requires the derived parameters:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation:
- \[\begin{split}WettedPerimeters_i = \begin{cases} 0 &|\ d < 0 \\ W_B + 2 \cdot d \cdot \sqrt{S_S^2 + 1} &|\ 0 \leq d < H_T \\ W_B + 2 \cdot H_T \cdot \sqrt{S_S^2 + 1} + 2 \cdot (d - H_T) &|\ H_T \leq d \\ \end{cases} \\ \\ d = WaterDepth - BottomDepth_i \\ H_T = TrapezeHeights_i \\ W_B = BottomWidths_i \\ S_S = SideSlopes_i\end{split}\]
Examples:
The following convenience function executes
Calc_WettedPerimeters_V1
for different water depths and prints the resulting wetted perimeters:>>> from hydpy import print_vector, round_ >>> def test(): ... derived.bottomdepths.update() ... derived.trapezeheights.update() ... for d in [0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0]: ... factors.waterdepth = d ... model.calc_wettedperimeters_v1() ... round_(d, end=": ") ... print_vector(factors.wettedperimeters.values)
The first example deals with identical rectangular trapezes. Note that method
Calc_WettedPerimeters_V1
adds the contact surface between two adjacent trapeze ranges only to the wetted perimeter of the inner one:>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(3) >>> bottomlevels(1.0, 2.0, 3.0) >>> bottomwidths(2.0) >>> sideslopes(0.0) >>> test() 0.0: 2.0, 0.0, 0.0 0.5: 3.0, 0.0, 0.0 1.0: 4.0, 2.0, 0.0 1.5: 5.0, 3.0, 0.0 2.0: 6.0, 4.0, 2.0 2.5: 7.0, 5.0, 3.0 3.0: 8.0, 6.0, 4.0 3.5: 9.0, 7.0, 5.0 4.0: 10.0, 8.0, 6.0
The second example deals with identical triangular trapezes. Here, the heights of the individual trapezes also matter because they mark where the triangular shape switches to a rectangular shape:
>>> bottomlevels(1.0, 2.0, 3.0) >>> bottomwidths(0.0) >>> sideslopes(2.0) >>> test() 0.0: 0.0, 0.0, 0.0 0.5: 2.236068, 0.0, 0.0 1.0: 4.472136, 0.0, 0.0 1.5: 5.472136, 2.236068, 0.0 2.0: 6.472136, 4.472136, 0.0 2.5: 7.472136, 5.472136, 2.236068 3.0: 8.472136, 6.472136, 4.472136 3.5: 9.472136, 7.472136, 6.708204 4.0: 10.472136, 8.472136, 8.944272
The third example deals with identical “complete” trapezes by combining the first two geometries:
>>> bottomlevels(1.0, 2.0, 3.0) >>> bottomwidths(2.0) >>> sideslopes(2.0) >>> test() 0.0: 2.0, 0.0, 0.0 0.5: 4.236068, 0.0, 0.0 1.0: 6.472136, 2.0, 0.0 1.5: 7.472136, 4.236068, 0.0 2.0: 8.472136, 6.472136, 2.0 2.5: 9.472136, 7.472136, 4.236068 3.0: 10.472136, 8.472136, 6.472136 3.5: 11.472136, 9.472136, 8.708204 4.0: 12.472136, 10.472136, 10.944272
The fourth example mixes three different geometries:
>>> bottomlevels(1.0, 3.0, 4.0) >>> bottomwidths(2.0, 0.0, 2.0) >>> sideslopes(0.0, 2.0, 2.0) >>> test() 0.0: 2.0, 0.0, 0.0 0.5: 3.0, 0.0, 0.0 1.0: 4.0, 0.0, 0.0 1.5: 5.0, 0.0, 0.0 2.0: 6.0, 0.0, 0.0 2.5: 7.0, 2.236068, 0.0 3.0: 8.0, 4.472136, 2.0 3.5: 9.0, 5.472136, 4.236068 4.0: 10.0, 6.472136, 6.472136
- class hydpy.models.wq.wq_model.Calc_FlowPerimeters_V1[source]¶
Bases:
Method
Interpolate the sector-specific wetted perimeters of those subareas of the cross section involved in water routing.
- Required by the methods:
- Requires the control parameter:
- Requires the derived parameter:
- Requires the aide sequences:
- Calculates the factor sequence:
- Basic equations:
- \[\begin{split}P = \begin{cases} (1 - w) \cdot PS_i + w \cdot PS_{i+1} &|\ w \neq nan \\ PS_i + 2 \cdot E &|\ w = nan \end{cases} \\ \\ i = Index \\ w = Weight \\ E = Excess \\ P = FlowPerimeters \\ PS = SectorFlowPerimeters\end{split}\]
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbwidths(9) >>> nmbsectors(4) >>> heights(1.0, 3.0, 4.0, 4.0, 4.0, 5.0, 6.0, 7.0, 8.0) >>> flowwidths(2.0, 4.0, 6.0, 14.0, 18.0, 18.0, 24.0, 28.0, 30.0) >>> transitions(2, 3, 5) >>> derived.sectorflowwidths.update() >>> derived.sectorflowperimeters.update() >>> from hydpy import print_vector >>> for waterlevel in range(11): ... factors.waterlevel = waterlevel ... model.calc_index_excess_weight_v1() ... model.calc_flowwidths_v1() ... model.calc_flowperimeters_v1() ... print_vector([waterlevel, *factors.flowperimeters.values]) 0, 2.0, 0.0, 0.0, 0.0 1, 2.0, 0.0, 0.0, 0.0 2, 4.236068, 0.0, 0.0, 0.0 3, 6.472136, 0.0, 0.0, 0.0 4, 9.300563, 8.0, 4.0, 0.0 5, 11.300563, 10.0, 6.0, 0.0 6, 13.300563, 12.0, 8.0, 6.324555 7, 15.300563, 14.0, 10.0, 10.796691 8, 17.300563, 16.0, 12.0, 13.625118 9, 19.300563, 18.0, 14.0, 15.625118 10, 21.300563, 20.0, 16.0, 17.625118
- class hydpy.models.wq.wq_model.Calc_WettedPerimeter_V1[source]¶
Bases:
Method
Sum up the individual trapeze ranges’ wetted perimeters.
- Required by the methods:
- Requires the control parameter:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation:
\(WettedPerimeter = \sum_{i=1}^{NmbTrapezes} WettedPerimeters_i\)
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(3) >>> factors.wettedperimeters(2.0, 3.0, 1.0) >>> model.calc_wettedperimeter_v1() >>> factors.wettedperimeter wettedperimeter(6.0)
- class hydpy.models.wq.wq_model.Calc_WettedPerimeterDerivatives_V1[source]¶
Bases:
Method
Calculate the change in the wetted perimeter of each trapeze range with respect to the water level increase.
- Required by the methods:
- Requires the control parameter:
- Requires the derived parameters:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation:
- \[\begin{split}WettedPerimeterDerivatives_i = \begin{cases} 0 &|\ d < 0 \\ P' &|\ 0 \leq d < H_T \\ 2 &|\ H_T \leq d \\ \end{cases} \\ \\ d = WaterDepth - BottomDepth_i \\ H_T = TrapezeHeights_i \\ P' = PerimeterDerivatives_i\end{split}\]
Examples:
The following convenience function executes
Calc_WettedPerimeterDerivatives_V1
for different water depths and prints the resulting wetted perimeters:>>> from hydpy import print_vector, round_ >>> def test(): ... derived.bottomdepths.update() ... derived.trapezeheights.update() ... derived.perimeterderivatives.update() ... for d in [0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0]: ... factors.waterdepth = d ... model.calc_wettedperimeterderivatives_v1() ... round_(d, end=": ") ... print_vector(factors.wettedperimeterderivatives.values)
The first example deals with identical rectangular trapezes. Note that method
Calc_WettedPerimeterDerivatives_V1
adds the contact surface increase between two adjacent trapeze ranges only to the wetted perimeter derivative of the inner one:>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(3) >>> bottomlevels(1.0, 2.0, 3.0) >>> bottomwidths(2.0) >>> sideslopes(0.0) >>> test() 0.0: 2.0, 0.0, 0.0 0.5: 2.0, 0.0, 0.0 1.0: 2.0, 2.0, 0.0 1.5: 2.0, 2.0, 0.0 2.0: 2.0, 2.0, 2.0 2.5: 2.0, 2.0, 2.0 3.0: 2.0, 2.0, 2.0 3.5: 2.0, 2.0, 2.0 4.0: 2.0, 2.0, 2.0
The second example deals with identical triangular trapezes. Here, the heights of the individual trapezes also matter because they mark where the triangular shape switches to a rectangular shape:
>>> bottomlevels(1.0, 2.0, 3.0) >>> bottomwidths(0.0) >>> sideslopes(2.0) >>> test() 0.0: 4.472136, 0.0, 0.0 0.5: 4.472136, 0.0, 0.0 1.0: 2.0, 4.472136, 0.0 1.5: 2.0, 4.472136, 0.0 2.0: 2.0, 2.0, 4.472136 2.5: 2.0, 2.0, 4.472136 3.0: 2.0, 2.0, 4.472136 3.5: 2.0, 2.0, 4.472136 4.0: 2.0, 2.0, 4.472136
The third example deals with identical “complete” trapezes by combining the first two geometries:
>>> bottomlevels(1.0, 2.0, 3.0) >>> bottomwidths(2.0) >>> sideslopes(2.0) >>> test() 0.0: 4.472136, 0.0, 0.0 0.5: 4.472136, 0.0, 0.0 1.0: 2.0, 4.472136, 0.0 1.5: 2.0, 4.472136, 0.0 2.0: 2.0, 2.0, 4.472136 2.5: 2.0, 2.0, 4.472136 3.0: 2.0, 2.0, 4.472136 3.5: 2.0, 2.0, 4.472136 4.0: 2.0, 2.0, 4.472136
The fourth example mixes three different geometries:
>>> bottomlevels(1.0, 3.0, 4.0) >>> bottomwidths(2.0, 0.0, 2.0) >>> sideslopes(0.0, 2.0, 2.0) >>> test() 0.0: 2.0, 0.0, 0.0 0.5: 2.0, 0.0, 0.0 1.0: 2.0, 0.0, 0.0 1.5: 2.0, 0.0, 0.0 2.0: 2.0, 4.472136, 0.0 2.5: 2.0, 4.472136, 0.0 3.0: 2.0, 2.0, 4.472136 3.5: 2.0, 2.0, 4.472136 4.0: 2.0, 2.0, 4.472136
- class hydpy.models.wq.wq_model.Calc_FlowPerimeterDerivatives_V1[source]¶
Bases:
Method
Take the sector-specific wetted perimeter derivatives of those subareas of the cross section involved in water routing.
- Required by the methods:
- Requires the control parameter:
- Requires the derived parameter:
- Requires the aide sequence:
- Calculates the factor sequence:
- Basic equations:
- \[P = DS_i \ \ i = Index \ D = FlowPerimeterDerivatives \ DS = SectorFlowPerimeterDerivatives\]
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbwidths(9) >>> nmbsectors(4) >>> heights(1.0, 3.0, 4.0, 4.0, 4.0, 5.0, 6.0, 7.0, 8.0) >>> flowwidths(2.0, 4.0, 6.0, 14.0, 18.0, 18.0, 24.0, 28.0, 30.0) >>> transitions(2, 3, 5) >>> derived.sectorflowwidths.update() >>> derived.sectorflowperimeterderivatives.update() >>> from hydpy import print_vector >>> for waterlevel in range(11): ... factors.waterlevel = waterlevel ... model.calc_index_excess_weight_v1() ... model.calc_flowperimeterderivatives_v1() ... print_vector([waterlevel, *factors.flowperimeterderivatives.values]) 0, 2.236068, nan, nan, nan 1, 2.236068, nan, nan, nan 2, 2.236068, nan, nan, nan 3, 2.828427, nan, nan, nan 4, 2.0, 2.0, 2.0, nan 5, 2.0, 2.0, 2.0, 6.324555 6, 2.0, 2.0, 2.0, 4.472136 7, 2.0, 2.0, 2.0, 2.828427 8, 2.0, 2.0, 2.0, 2.0 9, 2.0, 2.0, 2.0, 2.0 10, 2.0, 2.0, 2.0, 2.0
- class hydpy.models.wq.wq_model.Calc_SurfaceWidths_V1[source]¶
Bases:
Method
Calculate the surface width for each trapeze range.
- Required by the methods:
- Requires the control parameters:
- Requires the derived parameters:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation:
- \[\begin{split}SurfaceWidths_i = \begin{cases} 0 &|\ d < 0 \\ W_B + 2 \cdot S_S \cdot d &|\ 0 \leq d < H_T \\ W_B + W_S &|\ H_T \leq d \\ \end{cases} \\ \\ d = WaterDepth - BottomDepth_i \\ H_T = TrapezeHeights_i \\ W_B = BottomWidths_i \\ S_S = SideSlopes_i \\ W_S = SlopeWidth_i\end{split}\]
Example:
The following convenience function executes
Calc_SurfaceWidths_V1
for different water depths and prints the surface widths:>>> from hydpy import print_vector, round_ >>> def test(): ... derived.bottomdepths.update() ... derived.trapezeheights.update() ... derived.slopewidths.update() ... for d in [0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0]: ... factors.waterdepth = d ... model.calc_surfacewidths_v1() ... round_(d, end=": ") ... print_vector(factors.surfacewidths.values)
The first example deals with identical rectangular trapezes. There are no differences except those due to the different bottom levels:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(3) >>> bottomlevels(1.0, 2.0, 3.0) >>> bottomwidths(2.0) >>> sideslopes(0.0) >>> test() 0.0: 2.0, 0.0, 0.0 0.5: 2.0, 0.0, 0.0 1.0: 2.0, 2.0, 0.0 1.5: 2.0, 2.0, 0.0 2.0: 2.0, 2.0, 2.0 2.5: 2.0, 2.0, 2.0 3.0: 2.0, 2.0, 2.0 3.5: 2.0, 2.0, 2.0 4.0: 2.0, 2.0, 2.0
The second example deals with identical triangular trapezes. Here, the heights of the individual trapezes also matter because they mark where the triangular shape switches to a rectangular shape:
>>> bottomlevels(1.0, 2.0, 3.0) >>> bottomwidths(0.0) >>> sideslopes(2.0) >>> test() 0.0: 0.0, 0.0, 0.0 0.5: 2.0, 0.0, 0.0 1.0: 4.0, 0.0, 0.0 1.5: 4.0, 2.0, 0.0 2.0: 4.0, 4.0, 0.0 2.5: 4.0, 4.0, 2.0 3.0: 4.0, 4.0, 4.0 3.5: 4.0, 4.0, 6.0 4.0: 4.0, 4.0, 8.0
The third example deals with identical “complete” trapezes by combining the first two geometries:
>>> bottomlevels(1.0, 2.0, 3.0) >>> bottomwidths(2.0) >>> sideslopes(2.0) >>> test() 0.0: 2.0, 0.0, 0.0 0.5: 4.0, 0.0, 0.0 1.0: 6.0, 2.0, 0.0 1.5: 6.0, 4.0, 0.0 2.0: 6.0, 6.0, 2.0 2.5: 6.0, 6.0, 4.0 3.0: 6.0, 6.0, 6.0 3.5: 6.0, 6.0, 8.0 4.0: 6.0, 6.0, 10.0
The fourth example mixes three different geometries:
>>> bottomlevels(1.0, 3.0, 4.0) >>> bottomwidths(2.0, 0.0, 2.0) >>> sideslopes(0.0, 2.0, 2.0) >>> test() 0.0: 2.0, 0.0, 0.0 0.5: 2.0, 0.0, 0.0 1.0: 2.0, 0.0, 0.0 1.5: 2.0, 0.0, 0.0 2.0: 2.0, 0.0, 0.0 2.5: 2.0, 2.0, 0.0 3.0: 2.0, 4.0, 2.0 3.5: 2.0, 4.0, 4.0 4.0: 2.0, 4.0, 6.0
- class hydpy.models.wq.wq_model.Calc_SurfaceWidth_V1[source]¶
Bases:
Method
Sum the individual trapeze ranges’ surface widths.
- Required by the methods:
- Requires the control parameter:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation:
\(SurfaceWidth = \sum_{i=1}^{NmbTrapezes} SurfaceWidths_i\)
Examples:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(3) >>> factors.surfacewidths(2.0, 3.0, 1.0) >>> model.calc_surfacewidth_v1() >>> factors.surfacewidth surfacewidth(6.0)
- class hydpy.models.wq.wq_model.Calc_FlowWidths_V1[source]¶
Bases:
Method
Interpolate the sector-specific widths of those subareas of the cross section involved in water routing.
- Required by the methods:
- Requires the control parameter:
- Requires the derived parameter:
- Requires the aide sequences:
- Calculates the factor sequence:
- Basic equation:
- \[\begin{split}W_i = \begin{cases} (1 - w) \cdot WS_i + w \cdot WS_{i+1} &|\ w \neq nan \\ WS_i &|\ w = nan \end{cases} \\ \\ i = Index \\ w = Weight \\ W = FlowWidths \\ WS = SectorFlowWidths\end{split}\]
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbwidths(9) >>> nmbsectors(4) >>> heights(1.0, 3.0, 4.0, 4.0, 4.0, 5.0, 6.0, 7.0, 8.0) >>> flowwidths(2.0, 4.0, 6.0, 14.0, 18.0, 18.0, 24.0, 28.0, 30.0) >>> transitions(2, 3, 5) >>> derived.sectorflowwidths.update() >>> from hydpy import print_vector >>> for waterlevel in range(11): ... factors.waterlevel = waterlevel ... model.calc_index_excess_weight_v1() ... model.calc_flowwidths_v1() ... print_vector([waterlevel, *factors.flowwidths.values]) 0, 2.0, 0.0, 0.0, 0.0 1, 2.0, 0.0, 0.0, 0.0 2, 3.0, 0.0, 0.0, 0.0 3, 4.0, 0.0, 0.0, 0.0 4, 6.0, 8.0, 4.0, 0.0 5, 6.0, 8.0, 4.0, 0.0 6, 6.0, 8.0, 4.0, 6.0 7, 6.0, 8.0, 4.0, 10.0 8, 6.0, 8.0, 4.0, 12.0 9, 6.0, 8.0, 4.0, 12.0 10, 6.0, 8.0, 4.0, 12.0
- class hydpy.models.wq.wq_model.Calc_TotalWidths_V1[source]¶
Bases:
Method
Interpolate the sector-specific widths of the total cross section.
- Required by the methods:
- Requires the control parameter:
- Requires the derived parameter:
- Requires the aide sequences:
- Calculates the factor sequence:
- Basic equation:
- \[\begin{split}W_i = \begin{cases} (1 - w) \cdot WS_i + w \cdot WS_{i+1} &|\ w \neq nan \\ WS_i &|\ w = nan \end{cases} \\ \\ i = Index \\ w = Weight \\ W = TotalWidths \\ WS = SectorTotalWidths\end{split}\]
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbwidths(9) >>> nmbsectors(4) >>> heights(1.0, 3.0, 4.0, 4.0, 4.0, 5.0, 6.0, 7.0, 8.0) >>> totalwidths(2.0, 4.0, 6.0, 14.0, 18.0, 18.0, 24.0, 28.0, 30.0) >>> transitions(2, 3, 5) >>> derived.sectortotalwidths.update() >>> from hydpy import print_vector >>> for waterlevel in range(11): ... factors.waterlevel = waterlevel ... model.calc_index_excess_weight_v1() ... model.calc_totalwidths_v1() ... print_vector([waterlevel, *factors.totalwidths.values]) 0, 2.0, 0.0, 0.0, 0.0 1, 2.0, 0.0, 0.0, 0.0 2, 3.0, 0.0, 0.0, 0.0 3, 4.0, 0.0, 0.0, 0.0 4, 6.0, 8.0, 4.0, 0.0 5, 6.0, 8.0, 4.0, 0.0 6, 6.0, 8.0, 4.0, 6.0 7, 6.0, 8.0, 4.0, 10.0 8, 6.0, 8.0, 4.0, 12.0 9, 6.0, 8.0, 4.0, 12.0 10, 6.0, 8.0, 4.0, 12.0
- class hydpy.models.wq.wq_model.Calc_TotalWidth_V1[source]¶
Bases:
Method
Sum the individual cross-section sectors’ water surface widths.
- Required by the methods:
- Requires the control parameter:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation:
\(TotalWidth = \sum_{i=1}^{NmbSectors} TotalWidths_i\)
Examples:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbsectors(3) >>> factors.totalwidths(2.0, 3.0, 1.0) >>> model.calc_totalwidth_v1() >>> factors.totalwidth totalwidth(6.0)
- class hydpy.models.wq.wq_model.Calc_Discharges_V1[source]¶
Bases:
Method
Calculate the discharge for each trapeze range.
- Required by the methods:
- Requires the control parameters:
- Requires the derived parameter:
- Requires the factor sequences:
- Calculates the flux sequence:
- Basic equation:
- \[\begin{split}Discharges_i = \begin{cases} 0 &|\ d < 0 \\ C \cdot A^{5/3} \cdot P^{-2/3} \cdot \sqrt{S_B} &|\ 0 \leq d \end{cases} \\ \\ d = WaterDepth - BottomDepth_i \\ C = StricklerCoefficient_i \\ A = WettedAreas_i \\ P = WettedPerimeters_i \\ S_B = BottomSlope\end{split}\]
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(4) >>> bottomslope(0.01) >>> stricklercoefficients(20.0, 40.0, 60.0, 80.0) >>> derived.bottomdepths = 1.0, 2.0, 3.0, 4.0 >>> factors.wettedareas = 1.0, 4.0, 8.0, 16.0 >>> factors.wettedperimeters = 2.0, 4.0, 6.0, 8.0 >>> factors.waterdepth = 4.0 >>> model.calc_discharges_v1() >>> fluxes.discharges discharges(1.259921, 16.0, 58.147859, 0.0)
- class hydpy.models.wq.wq_model.Calc_Discharges_V2[source]¶
Bases:
Method
Calculate the discharge for each cross-section sector.
- Required by the methods:
- Requires the control parameters:
- Requires the factor sequences:
- Calculates the flux sequence:
- Basic equation:
- \[\begin{split}Q = \begin{cases} 0 &|\ A < 0 \\ C \cdot A^{5/3} \cdot P^{-2/3} \cdot \sqrt{S} &|\ 0 \leq A \end{cases} \\ \\ Q = Discharges \\ C = StricklerCoefficient \\ A = FlowAreas \\ P = FlowPerimeters \\ S = BottomSlope\end{split}\]
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbsectors(4) >>> bottomslope(0.01) >>> stricklercoefficients(20.0, 40.0, 60.0, 80.0) >>> factors.flowareas = 1.0, 4.0, 8.0, 0.0 >>> factors.flowperimeters = 2.0, 4.0, 6.0, 8.0 >>> model.calc_discharges_v2() >>> fluxes.discharges discharges(1.259921, 16.0, 58.147859, 0.0)
- class hydpy.models.wq.wq_model.Calc_Discharge_V2[source]¶
Bases:
Method
Sum the individual trapeze ranges’ discharges.
- Required by the methods:
- Requires the control parameter:
- Requires the flux sequence:
- Calculates the flux sequence:
- Basic equation:
\(Discharge = \sum_{i=1}^{NmbTrapezes} Discharges_i\)
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(3) >>> fluxes.discharges(2.0, 3.0, 1.0) >>> model.calc_discharge_v2() >>> fluxes.discharge discharge(6.0)
- class hydpy.models.wq.wq_model.Calc_Discharge_V3[source]¶
Bases:
Method
Sum up the individual cross-section sectors’ discharges.
- Required by the methods:
- Requires the control parameter:
- Requires the flux sequence:
- Calculates the flux sequence:
- Basic equation:
\(Discharge = \sum_{i=1}^{NmbSector} Discharges_i\)
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbsectors(3) >>> fluxes.discharges(2.0, 3.0, 1.0) >>> model.calc_discharge_v3() >>> fluxes.discharge discharge(6.0)
- class hydpy.models.wq.wq_model.Calc_DischargeDerivatives_V1[source]¶
Bases:
Method
Calculate the discharge change for each trapeze range with respect to a water level increase.
- Required by the methods:
- Requires the control parameters:
- Requires the derived parameter:
- Requires the factor sequences:
WaterDepth
WettedAreas
WettedPerimeters
WettedPerimeterDerivatives
SurfaceWidths
- Calculates the factor sequence:
- Basic equation:
- \[\begin{split}DischargeDerivatives_i = \begin{cases} 0 &|\ d < 0 \\ C \cdot (A / P)^{5/3} \cdot \frac{5 \cdot P \cdot A' - 2 \cdot A \cdot P'}{3 \cdot P} \cdot \sqrt{S_B} &|\ 0 \leq d \end{cases} \\ \\ d = WaterDepth - BottomDepth_i \\ C = StricklerCoefficient_i \\ A = WettedAreas_i \\ A' = SurfaceWidth_i \\ P = WettedPerimeters_i \\ P' = WettedPerimeterDerivatives_i \\ S_B = BottomSlope\end{split}\]
Example:
The given basic equation assumes that the wetted area, the wetted perimeter, and their derivatives are calculated via methods
Calc_WettedAreas_V1
,Calc_SurfaceWidths_V1
,Calc_WettedPerimeters_V1
, andCalc_WettedPerimeterDerivatives_V1
. Hence, we apply these methods and check that, after also executingCalc_DischargeDerivatives_V1
, the results are sufficiently similar to the numerical approximations gained when applyingNumericalDifferentiator
to the mentioned methods and methodCalc_Discharges_V1
:>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(4) >>> bottomlevels(1.0, 3.0, 4.0, 5.0) >>> bottomwidths(2.0, 0.0, 2.0, 2.0) >>> sideslopes(0.0, 2.0, 2.0, 2.0) >>> bottomslope(0.01) >>> stricklercoefficients(20.0, 40.0, 60.0, 60.0) >>> factors.waterdepth = 3.5 >>> derived.bottomdepths.update() >>> derived.trapezeheights.update() >>> derived.slopewidths.update() >>> derived.perimeterderivatives.update() >>> model.calc_wettedareas_v1() >>> model.calc_surfacewidths_v1() >>> model.calc_wettedperimeters_v1() >>> model.calc_wettedperimeterderivatives_v1() >>> model.calc_dischargederivatives_v1() >>> factors.dischargederivatives dischargederivatives(3.884141, 18.475494, 16.850223, 0.0)
>>> from hydpy import NumericalDifferentiator, pub >>> numdiff = NumericalDifferentiator( ... xsequence=factors.waterdepth, ... ysequences=[fluxes.discharges], ... methods=[model.calc_wettedareas_v1, ... model.calc_surfacewidths_v1, ... model.calc_wettedperimeters_v1, ... model.calc_wettedperimeterderivatives_v1, ... model.calc_discharges_v1], ... dx=1e-8) >>> with pub.options.reprdigits(5): ... numdiff() d_discharges/d_waterdepth: 3.88414, 18.47549, 16.85022, 0.0
- class hydpy.models.wq.wq_model.Calc_DischargeDerivatives_V2[source]¶
Bases:
Method
Calculate the discharge change for each cross section-sector with respect to a water level increase.
- Required by the methods:
- Requires the control parameters:
NmbSectors
Transitions
Heights
BottomSlope
StricklerCoefficients
- Requires the factor sequences:
WaterLevel
FlowAreas
FlowWidths
FlowPerimeters
FlowPerimeterDerivatives
- Calculates the factor sequence:
- Basic equation:
- \[\begin{split}Q' = \begin{cases} 0 &|\ L \leq H \\ C \cdot (A / P)^{5/3} \cdot \frac{5 \cdot P \cdot A' - 2 \cdot A \cdot P'}{3 \cdot P} \cdot \sqrt{S} &|\ L > H \end{cases} \\ \\ Q' = DischargeDerivatives \\ L = WaterLevel \\ H = Heights \\ C = StricklerCoefficient \\ A = FlowAreas \\ A' = FlowWidth \\ P = FlowPerimeters \\ P' = FlowPerimeterDerivatives \\ S = BottomSlope\end{split}\]
Example:
The following example reuses the same cross-section configuration as the example on method
Calc_DischargeDerivatives_V1
and so results in the same derivative estimates:>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbwidths(7) >>> nmbsectors(4) >>> heights(1.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0) >>> flowwidths(2.0, 2.0, 6.0, 8.0, 12.0, 14.0, 16.0) >>> transitions(1, 2, 4) >>> bottomslope(0.01) >>> stricklercoefficients(20.0, 40.0, 60.0, 60.0) >>> derived.sectorflowwidths.update() >>> derived.sectorflowareas.update() >>> derived.sectorflowperimeterderivatives.update() >>> derived.sectorflowperimeters.update() >>> factors.waterlevel = 4.5 >>> model.calc_index_excess_weight_v1() >>> model.calc_flowwidths_v1() >>> model.calc_flowareas_v1() >>> model.calc_flowperimeters_v1() >>> model.calc_flowperimeterderivatives_v1() >>> model.calc_dischargederivatives_v2() >>> factors.dischargederivatives dischargederivatives(3.884141, 18.475494, 16.850223, 0.0)
- class hydpy.models.wq.wq_model.Calc_DischargeDerivative_V1[source]¶
Bases:
Method
Sum the individual trapeze ranges’ discharge derivatives.
- Required by the methods:
- Requires the control parameter:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation:
\(DischargeDerivative = \sum_{i=1}^{NmbTrapezes} DischargeDerivatives_i\)
Examples:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(3) >>> bottomslope(0.01) >>> factors.dischargederivatives(2.0, 3.0, 1.0) >>> model.calc_dischargederivative_v1() >>> factors.dischargederivative dischargederivative(6.0)
- class hydpy.models.wq.wq_model.Calc_DischargeDerivative_V2[source]¶
Bases:
Method
Sum the individual cross-section sectors’ discharge derivatives.
- Required by the methods:
- Requires the control parameter:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation:
\(DischargeDerivative = \sum_{i=1}^{NmbSectors} DischargeDerivatives_i\)
Examples:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbsectors(3) >>> bottomslope(0.01) >>> factors.dischargederivatives(2.0, 3.0, 1.0) >>> model.calc_dischargederivative_v2() >>> factors.dischargederivative dischargederivative(6.0)
- class hydpy.models.wq.wq_model.Calc_Celerity_V1[source]¶
Bases:
Method
Calculate the kinematic wave celerity.
- Required by the methods:
- Requires the factor sequences:
- Calculates the factor sequence:
- Basic equation:
\(Celerity = \frac{DischargeDerivative}{SurfaceWidth}\)
Examples:
>>> from hydpy.models.wq import * >>> parameterstep() >>> factors.dischargederivative = 6.0 >>> factors.surfacewidth = 2.0 >>> model.calc_celerity_v1() >>> factors.celerity celerity(3.0)
>>> factors.surfacewidth = 0.0 >>> model.calc_celerity_v1() >>> factors.celerity celerity(nan)
- class hydpy.models.wq.wq_model.Calc_Celerity_V2[source]¶
Bases:
Method
Calculate the kinematic wave celerity.
- Required by the methods:
- Requires the factor sequences:
- Calculates the factor sequence:
- Basic equation:
\(Celerity = \frac{DischargeDerivative}{TotalWidth}\)
Examples:
>>> from hydpy.models.wq import * >>> parameterstep() >>> factors.dischargederivative = 6.0 >>> factors.totalwidth = 2.0 >>> model.calc_celerity_v2() >>> factors.celerity celerity(3.0)
>>> factors.totalwidth = 0.0 >>> model.calc_celerity_v2() >>> factors.celerity celerity(nan)
- class hydpy.models.wq.wq_model.Set_WaterDepth_V1[source]¶
Bases:
Method
Set the water depth in m.
- Required by the methods:
- Calculates the factor sequence:
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> model.set_waterdepth_v1(2.0) >>> factors.waterdepth waterdepth(2.0)
- class hydpy.models.wq.wq_model.Set_WaterLevel_V1[source]¶
Bases:
Method
Set the water level in m.
- Required by the methods:
- Calculates the factor sequence:
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> model.set_waterlevel_v1(2.0) >>> factors.waterlevel waterlevel(2.0)
- class hydpy.models.wq.wq_model.Set_WettedArea_V1[source]¶
Bases:
Method
Set the wetted area in m².
- Required by the method:
- Calculates the factor sequence:
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> model.set_wettedarea_v1(2.0) >>> factors.wettedarea wettedarea(2.0)
- class hydpy.models.wq.wq_model.Use_WaterDepth_V1[source]¶
Bases:
SetAutoMethod
Set the water depth in m and use it to calculate all other properties.
- Required submethods:
Set_WaterDepth_V1
Calc_WaterLevel_V1
Calc_WettedAreas_V1
Calc_WettedArea_V1
Calc_WettedPerimeters_V1
Calc_WettedPerimeterDerivatives_V1
Calc_SurfaceWidths_V1
Calc_SurfaceWidth_V1
Calc_Discharges_V1
Calc_Discharge_V2
Calc_DischargeDerivatives_V1
Calc_DischargeDerivative_V1
Calc_Celerity_V1
- Requires the control parameters:
NmbTrapezes
BottomLevels
BottomWidths
SideSlopes
StricklerCoefficients
BottomSlope
- Requires the derived parameters:
BottomDepths
TrapezeHeights
SlopeWidths
PerimeterDerivatives
- Calculates the factor sequences:
WaterDepth
WaterLevel
WettedAreas
WettedArea
WettedPerimeters
WettedPerimeterDerivatives
SurfaceWidths
SurfaceWidth
DischargeDerivatives
DischargeDerivative
Celerity
- Calculates the flux sequences:
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(2) >>> bottomlevels(1.0, 3.0) >>> bottomwidths(2.0, 2.0) >>> sideslopes(0.0, 0.0) >>> bottomslope(0.01) >>> stricklercoefficients(20.0, 40.0) >>> derived.bottomdepths.update() >>> derived.trapezeheights.update() >>> derived.slopewidths.update() >>> derived.perimeterderivatives.update() >>> model.use_waterdepth_v1(3.0) >>> factors.waterdepth waterdepth(3.0) >>> factors.waterlevel waterlevel(4.0) >>> factors.wettedarea wettedarea(8.0) >>> fluxes.discharge discharge(14.945466) >>> factors.celerity celerity(2.642957)
- class hydpy.models.wq.wq_model.Use_WaterDepth_V2[source]¶
Bases:
SetAutoMethod
Set the water depth in m and use it to calculate all other properties.
- Required submethods:
Set_WaterDepth_V1
Calc_WaterLevel_V1
Calc_WettedAreas_V1
Calc_WettedArea_V1
Calc_WettedPerimeters_V1
Calc_WettedPerimeter_V1
- Requires the control parameters:
- Requires the derived parameters:
- Calculates the factor sequences:
WaterDepth
WaterLevel
WettedAreas
WettedArea
WettedPerimeters
WettedPerimeter
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(2) >>> bottomlevels(1.0, 3.0) >>> bottomwidths(2.0, 2.0) >>> sideslopes(0.0, 0.0) >>> derived.bottomdepths.update() >>> derived.trapezeheights.update() >>> derived.slopewidths.update() >>> model.use_waterdepth_v2(3.0) >>> factors.waterdepth waterdepth(3.0) >>> factors.waterlevel waterlevel(4.0) >>> factors.wettedarea wettedarea(8.0) >>> factors.wettedperimeter wettedperimeter(12.0)
- class hydpy.models.wq.wq_model.Use_WaterDepth_V3[source]¶
Bases:
SetAutoMethod
Set the water depth in m and use it to calculate all other properties.
- Required submethods:
Set_WaterDepth_V1
Calc_WaterLevel_V2
Calc_Index_Excess_Weight_V1
Calc_FlowWidths_V1
Calc_TotalWidths_V1
Calc_TotalWidth_V1
Calc_FlowAreas_V1
Calc_TotalAreas_V1
Calc_FlowPerimeters_V1
Calc_FlowPerimeterDerivatives_V1
Calc_FlowArea_V1
Calc_TotalArea_V1
Calc_Discharges_V2
Calc_Discharge_V3
Calc_DischargeDerivatives_V2
Calc_DischargeDerivative_V2
Calc_Celerity_V2
- Requires the control parameters:
NmbSectors
NmbWidths
Transitions
Heights
StricklerCoefficients
BottomSlope
- Requires the derived parameters:
SectorFlowWidths
SectorTotalWidths
SectorFlowAreas
SectorTotalAreas
SectorFlowPerimeters
SectorFlowPerimeterDerivatives
- Calculates the factor sequences:
WaterDepth
WaterLevel
FlowAreas
FlowArea
TotalAreas
TotalArea
FlowPerimeters
FlowPerimeterDerivatives
FlowWidths
TotalWidths
TotalWidth
DischargeDerivatives
DischargeDerivative
Celerity
- Calculates the flux sequences:
- Calculates the aide sequences:
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbsectors(2) >>> nmbwidths(3) >>> heights(1.0, 3.0, 3.0) >>> flowwidths(2.0, 2.0, 4.0) >>> totalwidths(2.0, 2.0, 4.0) >>> transitions(1) >>> stricklercoefficients(20.0, 40.0) >>> bottomslope(0.01) >>> derived.sectorflowwidths.update() >>> derived.sectortotalwidths.update() >>> derived.sectorflowareas.update() >>> derived.sectortotalareas.update() >>> derived.sectorflowperimeters.update() >>> derived.sectorflowperimeterderivatives.update() >>> model.use_waterdepth_v3(3.0) >>> factors.waterdepth waterdepth(3.0) >>> factors.waterlevel waterlevel(4.0) >>> factors.flowarea flowarea(8.0) >>> factors.totalarea totalarea(8.0) >>> fluxes.discharge discharge(14.945466) >>> factors.celerity celerity(2.642957)
- class hydpy.models.wq.wq_model.Use_WaterLevel_V1[source]¶
Bases:
SetAutoMethod
Set the water level in m and use it to calculate all other properties.
- Required submethods:
Set_WaterLevel_V1
Calc_WaterDepth_V1
Calc_WettedAreas_V1
Calc_WettedArea_V1
Calc_WettedPerimeters_V1
Calc_WettedPerimeterDerivatives_V1
Calc_SurfaceWidths_V1
Calc_SurfaceWidth_V1
Calc_Discharges_V1
Calc_Discharge_V2
Calc_DischargeDerivatives_V1
Calc_DischargeDerivative_V1
Calc_Celerity_V1
- Requires the control parameters:
NmbTrapezes
BottomLevels
BottomWidths
SideSlopes
StricklerCoefficients
BottomSlope
- Requires the derived parameters:
BottomDepths
TrapezeHeights
SlopeWidths
PerimeterDerivatives
- Calculates the factor sequences:
WaterLevel
WaterDepth
WettedAreas
WettedArea
WettedPerimeters
WettedPerimeterDerivatives
SurfaceWidths
SurfaceWidth
DischargeDerivatives
DischargeDerivative
Celerity
- Calculates the flux sequences:
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(2) >>> bottomlevels(1.0, 3.0) >>> bottomwidths(2.0, 2.0) >>> sideslopes(0.0, 0.0) >>> bottomslope(0.01) >>> stricklercoefficients(20.0, 40.0) >>> derived.bottomdepths.update() >>> derived.trapezeheights.update() >>> derived.slopewidths.update() >>> derived.perimeterderivatives.update() >>> model.use_waterlevel_v1(4.0) >>> factors.waterdepth waterdepth(3.0) >>> factors.waterlevel waterlevel(4.0) >>> factors.wettedarea wettedarea(8.0) >>> fluxes.discharge discharge(14.945466) >>> factors.celerity celerity(2.642957)
- class hydpy.models.wq.wq_model.Use_WaterLevel_V2[source]¶
Bases:
SetAutoMethod
Set the water level in m and use it to calculate all other properties.
- Required submethods:
Set_WaterLevel_V1
Calc_WaterDepth_V1
Calc_WettedAreas_V1
Calc_WettedArea_V1
Calc_WettedPerimeters_V1
Calc_WettedPerimeter_V1
- Requires the control parameters:
- Requires the derived parameters:
- Calculates the factor sequences:
WaterDepth
WaterLevel
WettedAreas
WettedArea
WettedPerimeters
WettedPerimeter
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(2) >>> bottomlevels(1.0, 3.0) >>> bottomwidths(2.0, 2.0) >>> sideslopes(0.0, 0.0) >>> derived.bottomdepths.update() >>> derived.trapezeheights.update() >>> derived.slopewidths.update() >>> model.use_waterlevel_v2(4.0) >>> factors.waterdepth waterdepth(3.0) >>> factors.waterlevel waterlevel(4.0) >>> factors.wettedarea wettedarea(8.0) >>> factors.wettedperimeter wettedperimeter(12.0)
- class hydpy.models.wq.wq_model.Use_WaterLevel_V3[source]¶
Bases:
SetAutoMethod
Set the water level in m and use it to calculate all other properties.
- Required submethods:
Set_WaterLevel_V1
Calc_WaterDepth_V3
Calc_Index_Excess_Weight_V1
Calc_FlowWidths_V1
Calc_TotalWidths_V1
Calc_TotalWidth_V1
Calc_FlowAreas_V1
Calc_TotalAreas_V1
Calc_FlowPerimeters_V1
Calc_FlowPerimeterDerivatives_V1
Calc_FlowArea_V1
Calc_TotalArea_V1
Calc_Discharges_V2
Calc_Discharge_V3
Calc_DischargeDerivatives_V2
Calc_DischargeDerivative_V2
Calc_Celerity_V2
- Requires the control parameters:
NmbSectors
NmbWidths
Transitions
Heights
StricklerCoefficients
BottomSlope
- Requires the derived parameters:
SectorFlowWidths
SectorTotalWidths
SectorFlowAreas
SectorTotalAreas
SectorFlowPerimeters
SectorFlowPerimeterDerivatives
- Calculates the factor sequences:
WaterDepth
WaterLevel
FlowAreas
FlowArea
TotalAreas
TotalArea
FlowPerimeters
FlowPerimeterDerivatives
FlowWidths
TotalWidths
TotalWidth
DischargeDerivatives
DischargeDerivative
Celerity
- Calculates the flux sequences:
- Calculates the aide sequences:
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbsectors(2) >>> nmbwidths(3) >>> heights(1.0, 3.0, 3.0) >>> flowwidths(2.0, 2.0, 4.0) >>> totalwidths(2.0, 2.0, 4.0) >>> transitions(1) >>> stricklercoefficients(20.0, 40.0) >>> bottomslope(0.01) >>> derived.sectorflowwidths.update() >>> derived.sectortotalwidths.update() >>> derived.sectorflowareas.update() >>> derived.sectortotalareas.update() >>> derived.sectorflowperimeters.update() >>> derived.sectorflowperimeterderivatives.update() >>> model.use_waterlevel_v3(4.0) >>> factors.waterdepth waterdepth(3.0) >>> factors.waterlevel waterlevel(4.0) >>> factors.flowarea flowarea(8.0) >>> factors.totalarea totalarea(8.0) >>> fluxes.discharge discharge(14.945466) >>> factors.celerity celerity(2.642957)
- class hydpy.models.wq.wq_model.Use_WettedArea_V1[source]¶
Bases:
SetAutoMethod
Set the wetted area in m² and use it to calculate all other properties.
- Required submethods:
Set_WettedArea_V1
Calc_WaterDepth_V2
Calc_WaterLevel_V1
Calc_WettedAreas_V1
Calc_WettedArea_V1
Calc_WettedPerimeters_V1
Calc_WettedPerimeter_V1
- Requires the control parameters:
- Requires the derived parameters:
- Calculates the factor sequences:
WaterDepth
WaterLevel
WettedAreas
WettedArea
WettedPerimeters
WettedPerimeter
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(2) >>> bottomlevels(1.0, 3.0) >>> bottomwidths(2.0, 2.0) >>> sideslopes(0.0, 0.0) >>> derived.bottomdepths.update() >>> derived.trapezeheights.update() >>> derived.slopewidths.update() >>> derived.trapezeareas.update() >>> model.use_wettedarea_v1(8.0) >>> factors.waterdepth waterdepth(3.0) >>> factors.waterlevel waterlevel(4.0) >>> factors.wettedarea wettedarea(8.0) >>> factors.wettedperimeter wettedperimeter(12.0)
- class hydpy.models.wq.wq_model.Get_WaterDepth_V1[source]¶
Bases:
Method
Get the water depth in m.
- Requires the factor sequence:
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> factors.waterdepth = 2.0 >>> model.get_waterdepth_v1() 2.0
- class hydpy.models.wq.wq_model.Get_WaterLevel_V1[source]¶
Bases:
Method
Get the water level in m.
- Requires the factor sequence:
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> factors.waterlevel = 2.0 >>> model.get_waterlevel_v1() 2.0
- class hydpy.models.wq.wq_model.Get_WettedArea_V1[source]¶
Bases:
Method
Get the wetted area in m².
- Requires the factor sequence:
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> factors.wettedarea = 2.0 >>> model.get_wettedarea_v1() 2.0
- class hydpy.models.wq.wq_model.Get_WettedArea_V2[source]¶
Bases:
Method
Get the wetted area in m².
- Requires the factor sequence:
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> factors.totalarea = 2.0 >>> model.get_wettedarea_v2() 2.0
- class hydpy.models.wq.wq_model.Get_WettedPerimeter_V1[source]¶
Bases:
Method
Get the wetted perimeter in m.
- Requires the factor sequence:
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> factors.wettedperimeter = 2.0 >>> model.get_wettedperimeter_v1() 2.0
- class hydpy.models.wq.wq_model.Get_SurfaceWidth_V1[source]¶
Bases:
Method
Get the surface width in m.
- Requires the factor sequence:
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> factors.surfacewidth = 2.0 >>> model.get_surfacewidth_v1() 2.0
- class hydpy.models.wq.wq_model.Get_SurfaceWidth_V2[source]¶
Bases:
Method
Get the surface width in m.
- Requires the factor sequence:
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> factors.totalwidth = 2.0 >>> model.get_surfacewidth_v2() 2.0
- class hydpy.models.wq.wq_model.Get_Discharge_V1[source]¶
Bases:
Method
Get the discharge in m³/s.
- Requires the flux sequence:
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> fluxes.discharge = 2.0 >>> model.get_discharge_v1() 2.0
- class hydpy.models.wq.wq_model.Get_Celerity_V1[source]¶
Bases:
Method
Get the wave celerity in m/s.
- Requires the factor sequence:
Example:
>>> from hydpy.models.wq import * >>> parameterstep() >>> factors.celerity = 2.0 >>> model.get_celerity_v1() 2.0
- class hydpy.models.wq.wq_model.TrapezeModel[source]¶
Bases:
AdHocModel
Base class for HydPy-WQ models that rely on trapezoidal geometries.
- plot(*, ymax: float | None = None, color: str | None = None, label: bool | str = False) Figure [source]¶
Plot the channel profile.
See the main documentation of the application model
wq_trapeze
for more information.
- get_depths_of_discontinuity() tuple[float, ...] [source]¶
Get the depths of all trapeze bottoms (except zero).
>>> from hydpy.models.wq_trapeze_strickler import * >>> parameterstep()
>>> nmbtrapezes(1) >>> bottomlevels(1.0) >>> model.get_depths_of_discontinuity() ()
>>> nmbtrapezes(3) >>> bottomlevels(1.0, 3.0, 4.0) >>> from hydpy import print_vector >>> print_vector(model.get_depths_of_discontinuity()) 2.0, 3.0
- REUSABLE_METHODS: ClassVar[tuple[type[ReusableMethod], ...]] = ()¶
- class hydpy.models.wq.wq_model.WidthsModel[source]¶
Bases:
AdHocModel
Base class for HydPy-WQ models that rely on width measurements.
- plot(*, ymax: float | None = None, color: str | None = None, label: bool | str = False) Figure [source]¶
Plot the channel profile.
The following tests closely resemble those of
wq_trapeze
for comparison and serve the same purpose: to clarify how individual parameter values translate into actual geometries. Like for thewq_trapeze
examples, we first create a test function that simplifies inserting generated figures into the online documentation:>>> from hydpy.core.testtools import save_autofig >>> def plot(example, label=False): ... figure = model.plot(label=label) ... save_autofig(f"wq_widths_{example}.png", figure=figure)
Basically, “width models” as
wq_widths_strickler
rely on cross-section widths measured (or otherwise estimated) at different heights. In the case of a simple rectangular profile, defining a single measurement suffices:>>> from hydpy.models.wq_widths_strickler import * >>> parameterstep() >>> nmbwidths(1)
Principally, one can define multiple subsectors within a cross-section, for example, to perform separate discharge estimations with different friction coefficients. Each transition from one sector to its neighbour must lie at a height/width pair. However, when defining only a single height/width pair, as in this example, we can only specify a single sector:
>>> nmbsectors(1)
wq_widths_strickler
uses the neutral term “height” because submodels should be able to handle water levels as well as water depths. Here, we set the single height to 1 m:>>> heights(1.0)
In contrast to “trapeze models”, “width models” allow for differentiation between active and passive areas within a cross-section profile. We set the rectangle’s “flow width”, which is actively involved in water routing, to 2 m:
>>> flowwidths(2.0)
We set the “total widths” to 3 m, so that a rest of 1 m, which contributes to storing but not to routing water, remains (this can be useful to approximately consider, for example, the effects of groynes):
>>> totalwidths(3.0)
The plot routine adds the cross-section’s active part in dashed lines:
>>> plot("rectangle")
Defining a triangular cross-section requires (at least) two height/width pairs. Above the highest height/value pair, the profile’s outlines are, somewhat in contrast to
wq_trapeze
, vertically oriented:>>> nmbwidths(2) >>> heights(1.0, 2.0) >>> flowwidths(0.0, 4.0) >>> totalwidths(0.0, 6.0) >>> plot("triangle")
For a simple trapeze, two height/width pairs are also sufficient:
>>> flowwidths(2.0, 6.0) >>> totalwidths(2.0, 8.0) >>> plot("one_trapeze")
Next, we define a three-trapeze profile identical to one in the documentation of
wq_trapeze
(except for the vertically oriented outlines above the highest height/width pair). Therefore, we need to define five height/width pairs:>>> nmbwidths(5)
It is allowed to define multiple widths for the same height. Here, we make use of this to model the upper trapeze’s bottom:
>>> heights(1.0, 3.0, 4.0, 4.0, 5.0) >>> flowwidths(2.0, 2.0, 6.0, 8.0, 12.0) >>> totalwidths(2.0, 2.0, 6.0, 10.0, 14.0)
Increasing the value of parameter
NmbSectors
to three and setting the suitable transition indices via the index parameterTransitions
results in a definition of separate sectors analogous to the definition of separate trapeze ranges in thewq_trapeze
example:>>> nmbsectors(3) >>> transitions(1, 2)
All transitions are marked via circles:
>>> from hydpy import Element >>> e = Element("three_trapezes_1") >>> e.model = model >>> plot("three_trapezes_1", label=True)
In the last example, most of the outline and all transition points of the total cross-section overlay the corresponding properties of the subarea that contributes actively to water routing. The following example shows that those properties are depicted by solid lines and filled circles and by dashed lines and empty circles, respectively:
>>> transitions(1, 3) >>> plot("three_trapezes_2", label="three_trapezes_2")
- get_depths_of_discontinuity() tuple[float, ...] [source]¶
Get all measurement heights (except the first one).
>>> from hydpy.models.wq_widths_strickler import * >>> parameterstep()
>>> nmbwidths(1) >>> heights(1.0) >>> model.get_depths_of_discontinuity() ()
>>> nmbwidths(3) >>> heights(1.0, 3.0, 4.0) >>> from hydpy import print_vector >>> print_vector(model.get_depths_of_discontinuity()) 2.0, 3.0
- REUSABLE_METHODS: ClassVar[tuple[type[ReusableMethod], ...]] = ()¶
- class hydpy.models.wq.wq_model.Base_DischargeModel_V2[source]¶
Bases:
DischargeModel_V2
Base class for HydPy-WQ models that comply with the
DischargeModel_V2
submodel interface.- prepare_channeldepth¶
Set the channel depth in m.
>>> from hydpy.models.wq_walrus import * >>> parameterstep() >>> model.prepare_channeldepth(2.0) >>> channeldepth channeldepth(2.0)
- prepare_tolerance¶
Set the depth-related smoothing parameter in m.
>>> from hydpy.models.wq_walrus import * >>> parameterstep() >>> model.prepare_tolerance(2.0) >>> crestheighttolerance crestheighttolerance(2.0)
- REUSABLE_METHODS: ClassVar[tuple[type[ReusableMethod], ...]] = ()¶
- cymodel: CyModelProtocol | None¶
- parameters: parametertools.Parameters¶
- sequences: sequencetools.Sequences¶
- masks: masktools.Masks¶
Variable Features¶
Variable tools¶
- class hydpy.models.wq.wq_variables.MixinTrapezes(subvars: SubVariables)[source]¶
-
Mixin class for 1-dimensional parameters and sequences whose shape depends on the value of the parameter
NmbTrapezes
.
- class hydpy.models.wq.wq_variables.MixinWidths(subvars: SubVariables)[source]¶
-
Mixin class for 1-dimensional parameters and sequences whose shape depends on the value of the parameter
NmbWidths
.
- class hydpy.models.wq.wq_variables.MixinSectorsAndWidths(subvars: SubVariables)[source]¶
-
Mixin class for 2-dimensional parameters and sequences whose shape depends on the values of the parameters
NmbSectors
andNmbWidths
.
- class hydpy.models.wq.wq_variables.MixinTrapezesOrSectors(subvars: SubVariables)[source]¶
-
Mixin class for 1-dimensional parameters and sequences whose shape depends on the value of parameter
NmbTrapezes
or parameterNmbSectors
.
Parameter Features¶
Control parameters¶
- class hydpy.models.wq.ControlParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
SubParameters
Control parameters of model wq.
- The following classes are selected:
NmbTrapezes()
Number of trapezes defining the cross section [-].NmbWidths()
Number of widths that define the cross section [-].NmbSectors()
Number of the separately calculated sectors of the cross section [-].Heights()
The measurement heights of the widths defining the cross section [m].FlowWidths()
The widths of those subareas of the cross section involved in water routing [m].TotalWidths()
The widths of the total cross section [m].Transitions()
Indexes that mark the transitions between separately calculated cross-section sectors [m].BottomLevels()
The bottom level for each trapeze [m].BottomWidths()
The bottom width for each trapeze [m].SideSlopes()
The side slope for each trapeze[-].StricklerCoefficients()
Manning-Strickler coefficient for each trapeze [m^(1/3)/s].BottomSlope()
Bottom slope [-].ChannelDepth()
Channel depth [m].CrestHeight()
The height of the weir’s crest above the channel bottom [m].CrestHeightTolerance()
Smoothing parameter related to the difference between the water depth and the crest height [m].BankfullDischarge()
Bankfull discharge [mm/T].DischargeExponent()
Exponent of the water depth-discharge relation [-].
- class hydpy.models.wq.wq_control.NmbTrapezes(subvars: SubParameters)[source]¶
Bases:
NmbParameter
Number of trapezes defining the cross section [-].
- Required by the methods:
Calc_DischargeDerivative_V1
Calc_DischargeDerivatives_V1
Calc_Discharge_V2
Calc_Discharges_V1
Calc_SurfaceWidth_V1
Calc_SurfaceWidths_V1
Calc_WaterDepth_V2
Calc_WettedArea_V1
Calc_WettedAreas_V1
Calc_WettedPerimeterDerivatives_V1
Calc_WettedPerimeter_V1
Calc_WettedPerimeters_V1
Use_WaterDepth_V1
Use_WaterDepth_V2
Use_WaterLevel_V1
Use_WaterLevel_V2
Use_WettedArea_V1
- class hydpy.models.wq.wq_control.NmbWidths(subvars: SubParameters)[source]¶
Bases:
NmbParameter
Number of widths that define the cross section [-].
- Required by the methods:
Calc_Index_Excess_Weight_V1
Use_WaterDepth_V3
Use_WaterLevel_V3
- trim(lower=None, upper=None) bool [source]¶
Check according to \(NmbWidths \geq NmbSectors\).
>>> from hydpy.models.wq import * >>> parameterstep()
>>> nmbwidths(5) >>> nmbwidths nmbwidths(5)
>>> nmbsectors(3) >>> nmbwidths(3) >>> nmbwidths nmbwidths(3)
>>> nmbwidths(2) Traceback (most recent call last): ... ValueError: The value `2` of parameter `nmbwidths` of element `?` is not valid.
- class hydpy.models.wq.wq_control.NmbSectors(subvars: SubParameters)[source]¶
Bases:
NmbParameter
Number of the separately calculated sectors of the cross section [-].
- Required by the methods:
Calc_DischargeDerivative_V2
Calc_DischargeDerivatives_V2
Calc_Discharge_V3
Calc_Discharges_V2
Calc_FlowArea_V1
Calc_FlowAreas_V1
Calc_FlowPerimeterDerivatives_V1
Calc_FlowPerimeters_V1
Calc_FlowWidths_V1
Calc_TotalArea_V1
Calc_TotalAreas_V1
Calc_TotalWidth_V1
Calc_TotalWidths_V1
Use_WaterDepth_V3
Use_WaterLevel_V3
- trim(lower=None, upper=None) bool [source]¶
Check according to \(NmbSectors \leq NmbWidths\).
>>> from hydpy.models.wq import * >>> parameterstep()
>>> nmbsectors(2) >>> nmbsectors nmbsectors(2)
>>> nmbwidths(4) >>> nmbsectors(4) >>> nmbsectors nmbsectors(4)
>>> nmbsectors(5) Traceback (most recent call last): ... ValueError: The value `5` of parameter `nmbsectors` of element `?` is not valid.
- class hydpy.models.wq.wq_control.Heights(subvars: SubParameters)[source]¶
Bases:
MixinWidths
,SortedParameter
The measurement heights of the widths defining the cross section [m].
If water levels are essential, we encourage using the sea level as a reference. If not (as for common hydrological routing approaches), one could also set the lowest tabulated level to zero.
- class hydpy.models.wq.wq_control.FlowWidths(subvars: SubParameters)[source]¶
Bases:
MixinWidths
,SortedParameter
The widths of those subareas of the cross section involved in water routing [m].
- trim(lower=None, upper=None) bool [source]¶
Trim according to \(FlowWidths \leq TotalWidths\).
>>> from hydpy.models.wq import * >>> parameterstep()
>>> nmbwidths(3) >>> flowwidths(1.0, 2.0, 3.0) >>> flowwidths flowwidths(1.0, 2.0, 3.0)
>>> totalwidths(3.0, 4.0, 5.0) >>> flowwidths(2.0, 4.0, 6.0) >>> flowwidths flowwidths(2.0, 4.0, 5.0)
- class hydpy.models.wq.wq_control.TotalWidths(subvars: SubParameters)[source]¶
Bases:
MixinWidths
,SortedParameter
The widths of the total cross section [m].
- trim(lower=None, upper=None) bool [source]¶
Trim according to \(TotalWidths \geq FlowWidths\).
>>> from hydpy.models.wq import * >>> parameterstep()
>>> nmbwidths(3) >>> totalwidths(4.0, 5.0, 6.0) >>> totalwidths totalwidths(4.0, 5.0, 6.0)
>>> flowwidths(3.0, 4.0, 5.0) >>> totalwidths(2.0, 4.0, 6.0) >>> totalwidths totalwidths(3.0, 4.0, 6.0)
- class hydpy.models.wq.wq_control.Transitions(subvars: SubParameters)[source]¶
Bases:
Parameter
Indexes that mark the transitions between separately calculated cross-section sectors [m].
- Required by the methods:
Calc_DischargeDerivatives_V2
Use_WaterDepth_V3
Use_WaterLevel_V3
According to the Python convention, the index \(0\) would mark the first, and the index \(n - 1\) would mark the last height/width pair. However, precisely these two values are disallowed for reasons we explain in the following.
Parameter
Transitions
defines the transitions between all neighbouring sectors. Hence, one does not need to specify any value if there is only one sector:>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbsectors(1) >>> transitions transitions()
In such cases, it is okay to pass nothing when using the usual parameter value setting syntax:
>>> transitions() >>> transitions transitions()
The number of the required values depends on
NmbSectors
, while the range of the allowed values depends onNmbWidths
:>>> nmbwidths(7) >>> nmbsectors(4) >>> transitions(1, 4, 5) >>> transitions transitions(1, 4, 5)
The index value \(0\) is not allowed because there is no sector below the “lowest” height/width pair:
>>> transitions(0, 4, 6) Traceback (most recent call last): ... ValueError: The smallest possible index value of parameter `transitions` of element `?` is 1, but 0 is given.
>>> transitions transitions(-999999)
The same logic holds for the “highest” height/width pair:
>>> transitions(1, 4, 6) Traceback (most recent call last): ... ValueError: The largest possible index value of parameter `transitions` of element `?` is 5 (NmbWidths - 2), but 6 is given.
>>> transitions transitions(-999999)
Besides this, one must ensure that the index values are correctly sorted:
>>> transitions(1, 4, 4) Traceback (most recent call last): ... ValueError: The index values given to parameter `transitions` of element `?` are not strictly rising (1, 4, and 4).
>>> transitions transitions(-999999)
- trim(lower=None, upper=None) bool [source]¶
Regular trimming is disabled in favour of the special checks described in the main documentation of parameter
Transitions
.
- class hydpy.models.wq.wq_control.BottomLevels(subvars: SubParameters)[source]¶
Bases:
MixinTrapezes
,SortedParameter
The bottom level for each trapeze [m].
If water levels are essential, we encourage using the sea level as a reference. If not (as for common hydrological routing approaches), one could also set the lowest trapeze’s bottom level to zero.
- class hydpy.models.wq.wq_control.BottomWidths(subvars: SubParameters)[source]¶
Bases:
MixinTrapezes
,Parameter
The bottom width for each trapeze [m].
For example, when dealing with the second trapeze, the corresponding value of
BottomWidths
represents the sum of the trapeze’s partial bottoms on the left and right sides of the first trapeze.
- class hydpy.models.wq.wq_control.SideSlopes(subvars: SubParameters)[source]¶
Bases:
MixinTrapezes
,Parameter
The side slope for each trapeze[-].
A value of zero corresponds to a rectangular shape. A value of two corresponds to a half-meter elevation increase for each additional meter distance from the trapeze’s centre.
- class hydpy.models.wq.wq_control.StricklerCoefficients(subvars: SubParameters)[source]¶
Bases:
MixinTrapezesOrSectors
,Parameter
Manning-Strickler coefficient for each trapeze [m^(1/3)/s].
The higher the coefficient’s value, the higher the calculated discharge. Typical values range from 20 to 80.
- class hydpy.models.wq.wq_control.BottomSlope(subvars: SubParameters)[source]¶
Bases:
Parameter
Bottom slope [-].
\(BottomSlope = \frac{elevation_{start} - elevation_{end}}{length}\)
- class hydpy.models.wq.wq_control.ChannelDepth(subvars: SubParameters)[source]¶
Bases:
Parameter
Channel depth [m].
- Required by the method:
- class hydpy.models.wq.wq_control.CrestHeight(subvars: SubParameters)[source]¶
Bases:
Parameter
The height of the weir’s crest above the channel bottom [m].
- Required by the method:
Set
CrestHeight
to zero for channels without weirs.
- class hydpy.models.wq.wq_control.CrestHeightTolerance(subvars: SubParameters)[source]¶
Bases:
Parameter
Smoothing parameter related to the difference between the water depth and the crest height [m].
- class hydpy.models.wq.wq_control.BankfullDischarge(subvars: SubParameters)[source]¶
Bases:
Parameter
Bankfull discharge [mm/T].
- Required by the method:
- class hydpy.models.wq.wq_control.DischargeExponent(subvars: SubParameters)[source]¶
Bases:
Parameter
Exponent of the water depth-discharge relation [-].
- Required by the method:
Derived parameters¶
- class hydpy.models.wq.DerivedParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
SubParameters
Derived parameters of model wq.
- The following classes are selected:
BottomDepths()
The cumulated depth of a trapeze and its lower neighbours [m].TrapezeHeights()
The individual height of each trapeze [m].SlopeWidths()
The total width of both side slopes of each trapeze.TrapezeAreas()
The individual area of each trapeze [m].PerimeterDerivatives()
Change of the perimeter of each trapeze relative to a water level increase within the trapeze’s range [-].SectorFlowWidths()
The sector-specific widths of those subareas of the cross section involved in water routing [m].SectorTotalWidths()
The sector-specific widths of the total cross section [m].SectorFlowAreas()
The sector-specific wetted areas of those subareas of the cross section involved in water routing [m²].SectorTotalAreas()
The sector-specific wetted areas of the total cross section [m²].SectorFlowPerimeters()
The sector-specific wetted perimeters of those subareas of the cross section involved in water routing [m].SectorFlowPerimeterDerivatives()
The sector-specific changes in the wetted perimeters of those subareas of the cross section involved in water routing with respect to water level increases [m].CrestHeightRegularisation()
Regularisation parameter related to the difference between the water depth and the crest height [m].
- class hydpy.models.wq.wq_derived.BottomDepths(subvars: SubParameters)[source]¶
Bases:
MixinTrapezes
,Parameter
The cumulated depth of a trapeze and its lower neighbours [m].
- Required by the methods:
Calc_DischargeDerivatives_V1
Calc_Discharges_V1
Calc_SurfaceWidths_V1
Calc_WettedAreas_V1
Calc_WettedPerimeterDerivatives_V1
Calc_WettedPerimeters_V1
Use_WaterDepth_V1
Use_WaterDepth_V2
Use_WaterLevel_V1
Use_WaterLevel_V2
Use_WettedArea_V1
- update() None [source]¶
Calculate the depth values based on \(BottomDepths_i = BottomLevels_i - BottomLevels_0\).
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(3) >>> bottomlevels(1.0, 4.0, 6.0) >>> derived.bottomdepths.update() >>> derived.bottomdepths bottomdepths(0.0, 3.0, 5.0)
- class hydpy.models.wq.wq_derived.TrapezeHeights(subvars: SubParameters)[source]¶
Bases:
MixinTrapezes
,Parameter
The individual height of each trapeze [m].
The highest trapeze has no upper neighbour and is thus infinitely high.
- update() None [source]¶
Calculate the height values based on \(TrapezeHeights_i = BottomLevels_{i+1} - BottomLevels_i\).
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(3) >>> bottomlevels(1.0, 4.0, 6.0) >>> derived.trapezeheights.update() >>> derived.trapezeheights trapezeheights(3.0, 2.0, inf)
- class hydpy.models.wq.wq_derived.SlopeWidths(subvars: SubParameters)[source]¶
Bases:
MixinTrapezes
,Parameter
The total width of both side slopes of each trapeze.
The highest trapeze has no upper neighbour and is thus infinitely high and potentially infinitely wide.
- update() None [source]¶
Calculate the slope width values based on \(SlopeWidths = 2 \cdot SideSlopes \cdot TrapezeHeights\).
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(3) >>> sideslopes(0.0, 2.0, 2.0) >>> derived.trapezeheights(2.0, 3.0, inf) >>> derived.slopewidths.update() >>> derived.slopewidths slopewidths(0.0, 12.0, inf)
- class hydpy.models.wq.wq_derived.TrapezeAreas(subvars: SubParameters)[source]¶
Bases:
MixinTrapezes
,Parameter
The individual area of each trapeze [m].
- Required by the methods:
The highest trapeze has no upper neighbour and is thus infinitely large.
- update() None [source]¶
Calculate the perimeter derivatives based on \((BottomWidths + SlopeWidths / 2) \cdot TrapezeHeights\).
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(4) >>> bottomlevels(1.0, 3.0, 4.0, 5.0) >>> bottomwidths(2.0, 0.0, 2.0, 2.0) >>> sideslopes(0.0, 2.0, 2.0, 2.0) >>> derived.trapezeheights.update() >>> derived.slopewidths.update() >>> derived.trapezeareas.update() >>> derived.trapezeareas trapezeareas(4.0, 4.0, 10.0, inf)
- class hydpy.models.wq.wq_derived.PerimeterDerivatives(subvars: SubParameters)[source]¶
Bases:
MixinTrapezes
,Parameter
Change of the perimeter of each trapeze relative to a water level increase within the trapeze’s range [-].
- Required by the methods:
Calc_WettedPerimeterDerivatives_V1
Use_WaterDepth_V1
Use_WaterLevel_V1
- update() None [source]¶
Calculate the perimeter derivatives based on \(2 \cdot \sqrt{1 + SideSlopes^2}\).
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbtrapezes(2) >>> sideslopes(0.0, 2.0) >>> derived.perimeterderivatives.update() >>> derived.perimeterderivatives perimeterderivatives(2.0, 4.472136)
- class hydpy.models.wq.wq_derived.SectorFlowWidths(subvars: SubParameters)[source]¶
Bases:
_SectorWidths
The sector-specific widths of those subareas of the cross section involved in water routing [m].
- Required by the methods:
Calc_FlowAreas_V1
Calc_FlowWidths_V1
Use_WaterDepth_V3
Use_WaterLevel_V3
- update() None [source]¶
Allocate the
FlowWidths
parts to the respective cross-section sectors.>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbwidths(9) >>> nmbsectors(4) >>> heights(1.0, 3.0, 4.0, 4.0, 4.0, 5.0, 6.0, 7.0, 8.0) >>> flowwidths(2.0, 4.0, 6.0, 14.0, 18.0, 18.0, 24.0, 28.0, 30.0) >>> transitions(2, 3, 5) >>> derived.sectorflowwidths.update() >>> derived.sectorflowwidths sectorflowwidths([[2.0, 4.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0], [0.0, 0.0, 0.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0], [0.0, 0.0, 0.0, 0.0, 4.0, 4.0, 4.0, 4.0, 4.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 6.0, 10.0, 12.0]])
- class hydpy.models.wq.wq_derived.SectorTotalWidths(subvars: SubParameters)[source]¶
Bases:
_SectorWidths
The sector-specific widths of the total cross section [m].
- Required by the methods:
Calc_TotalAreas_V1
Calc_TotalWidths_V1
Use_WaterDepth_V3
Use_WaterLevel_V3
- update() None [source]¶
Allocate the
TotalWidths
parts to the respective cross-section sectors.>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbwidths(9) >>> nmbsectors(4) >>> heights(1.0, 3.0, 4.0, 4.0, 4.0, 5.0, 6.0, 7.0, 8.0) >>> totalwidths(2.0, 4.0, 6.0, 14.0, 18.0, 18.0, 24.0, 28.0, 30.0) >>> transitions(2, 3, 5) >>> derived.sectortotalwidths.update() >>> derived.sectortotalwidths sectortotalwidths([[2.0, 4.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0], [0.0, 0.0, 0.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0], [0.0, 0.0, 0.0, 0.0, 4.0, 4.0, 4.0, 4.0, 4.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 6.0, 10.0, 12.0]])
- class hydpy.models.wq.wq_derived.SectorFlowAreas(subvars: SubParameters)[source]¶
Bases:
_SectorAreas
The sector-specific wetted areas of those subareas of the cross section involved in water routing [m²].
- Required by the methods:
- update() None [source]¶
Calculate the cumulative sum of the individual trapeze areas defined by the height-width pairs of the individual sectors.
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbwidths(9) >>> nmbsectors(4) >>> heights(1.0, 3.0, 4.0, 4.0, 4.0, 5.0, 6.0, 7.0, 8.0) >>> flowwidths(2.0, 4.0, 6.0, 14.0, 18.0, 18.0, 24.0, 28.0, 30.0) >>> transitions(2, 3, 5) >>> derived.sectorflowwidths.update() >>> derived.sectorflowareas.update() >>> derived.sectorflowareas sectorflowareas([[0.0, 6.0, 11.0, 11.0, 11.0, 17.0, 23.0, 29.0, 35.0], [0.0, 0.0, 0.0, 0.0, 0.0, 8.0, 16.0, 24.0, 32.0], [0.0, 0.0, 0.0, 0.0, 0.0, 4.0, 8.0, 12.0, 16.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, 11.0, 22.0]])
- class hydpy.models.wq.wq_derived.SectorTotalAreas(subvars: SubParameters)[source]¶
Bases:
_SectorAreas
The sector-specific wetted areas of the total cross section [m²].
- Required by the methods:
- update() None [source]¶
Calculate the cumulative sum of the individual trapeze areas defined by the height-width pairs of the individual sectors.
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbwidths(9) >>> nmbsectors(4) >>> heights(1.0, 3.0, 4.0, 4.0, 4.0, 5.0, 6.0, 7.0, 8.0) >>> totalwidths(2.0, 4.0, 6.0, 14.0, 18.0, 18.0, 24.0, 28.0, 30.0) >>> transitions(2, 3, 5) >>> derived.sectortotalwidths.update() >>> derived.sectortotalareas.update() >>> derived.sectortotalareas sectortotalareas([[0.0, 6.0, 11.0, 11.0, 11.0, 17.0, 23.0, 29.0, 35.0], [0.0, 0.0, 0.0, 0.0, 0.0, 8.0, 16.0, 24.0, 32.0], [0.0, 0.0, 0.0, 0.0, 0.0, 4.0, 8.0, 12.0, 16.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, 11.0, 22.0]])
- class hydpy.models.wq.wq_derived.SectorFlowPerimeters(subvars: SubParameters)[source]¶
Bases:
MixinSectorsAndWidths
,Parameter
The sector-specific wetted perimeters of those subareas of the cross section involved in water routing [m].
- Required by the methods:
- update() None [source]¶
Calculate the cumulative sum of the individual trapeze perimeters defined by the height-width pairs of the individual sectors.
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbwidths(9) >>> nmbsectors(4) >>> heights(1.0, 3.0, 4.0, 4.0, 4.0, 5.0, 6.0, 7.0, 8.0) >>> flowwidths(2.0, 4.0, 6.0, 14.0, 18.0, 18.0, 24.0, 28.0, 30.0) >>> transitions(2, 3, 5) >>> derived.sectorflowwidths.update() >>> derived.sectorflowperimeters.update() >>> derived.sectorflowperimeters sectorflowperimeters([[2.0, 6.472136, 9.300563, 9.300563, 9.300563, 11.300563, 13.300563, 15.300563, 17.300563], [0.0, 0.0, 0.0, 8.0, 8.0, 10.0, 12.0, 14.0, 16.0], [0.0, 0.0, 0.0, 0.0, 4.0, 6.0, 8.0, 10.0, 12.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 6.324555, 10.796691, 13.625118]])
- class hydpy.models.wq.wq_derived.SectorFlowPerimeterDerivatives(subvars: SubParameters)[source]¶
Bases:
MixinSectorsAndWidths
,Parameter
The sector-specific changes in the wetted perimeters of those subareas of the cross section involved in water routing with respect to water level increases [m].
- Required by the methods:
Calc_FlowPerimeterDerivatives_V1
Use_WaterDepth_V3
Use_WaterLevel_V3
- update() None [source]¶
Calculate the flow perimeter derivatives based on \(2 \cdot \sqrt{1 + (dw/dh/2)^2}\).
>>> from hydpy.models.wq import * >>> parameterstep() >>> nmbwidths(9) >>> nmbsectors(4) >>> heights(1.0, 3.0, 4.0, 4.0, 4.0, 5.0, 6.0, 7.0, 8.0) >>> flowwidths(2.0, 4.0, 6.0, 14.0, 18.0, 18.0, 24.0, 28.0, 30.0) >>> transitions(2, 3, 5) >>> derived.sectorflowwidths.update() >>> derived.sectorflowperimeterderivatives.update() >>> derived.sectorflowperimeterderivatives sectorflowperimeterderivatives([[2.236068, 2.828427, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0], [nan, nan, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0], [nan, nan, nan, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0], [nan, nan, nan, nan, nan, 6.324555, 4.472136, 2.828427, 2.0]])
- class hydpy.models.wq.wq_derived.CrestHeightRegularisation(subvars: SubParameters)[source]¶
Bases:
Parameter
Regularisation parameter related to the difference between the water depth and the crest height [m].
- Required by the method:
- update() None [source]¶
Calculate the smoothing parameter value.
The documentation on module
smoothtools
explains the following example in some detail:>>> from hydpy.models.wq import * >>> from hydpy.cythons.smoothutils import smooth_logistic2 >>> from hydpy import round_ >>> parameterstep() >>> crestheighttolerance(0.0) >>> derived.crestheightregularisation.update() >>> round_(smooth_logistic2(0.0, derived.crestheightregularisation)) 0.0 >>> crestheighttolerance(0.0025) >>> derived.crestheightregularisation.update() >>> round_(smooth_logistic2(0.0025, derived.crestheightregularisation)) 0.00251
Sequence Features¶
Factor sequences¶
- class hydpy.models.wq.FactorSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
FactorSequences
Factor sequences of model wq.
- The following classes are selected:
WaterDepth()
Water depth [m].WaterLevel()
Water level [m].WettedAreas()
Wetted area of each trapeze range [m²].WettedArea()
Total wetted area [m²].FlowAreas()
The sector-specific wetted areas of those subareas of the cross section involved in water routing [m²].FlowArea()
The total wetted area of those subareas of the cross section involved in water routing [m²].TotalAreas()
The sector-specific wetted areas of the total cross section [m²].TotalArea()
The total wetted area of the total cross section [m²].WettedPerimeters()
Wetted perimeter of each trapeze range [m].FlowPerimeters()
The sector-specific wetted perimeters of those subareas of the cross section involved in water routing [m].WettedPerimeter()
Total wetted perimeter [m].WettedPerimeterDerivatives()
Change in the wetted perimeter of each trapeze range with respect to a water level increase [-].FlowPerimeterDerivatives()
The sector-specific wetted perimeters of those subareas of the cross section involved in water routing [m].SurfaceWidths()
Surface width of each trapeze range [m].SurfaceWidth()
Total surface width [m].FlowWidths()
The sector-specific widths of those subareas of the cross section involved in water routing [m].TotalWidths()
The sector-specific widths of the total cross section [m].TotalWidth()
The total width of the total cross section [m].DischargeDerivatives()
Discharge change of each trapeze range with respect to a water level increase [m²/s].DischargeDerivative()
Total discharge change with respect to a water level increase [m²/s].Celerity()
Kinematic celerity (wave speed) [m/s].
- class hydpy.models.wq.wq_factors.WaterDepth(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FactorSequence
Water depth [m].
- Calculated by the methods:
Calc_WaterDepth_V1
Calc_WaterDepth_V2
Calc_WaterDepth_V3
Set_WaterDepth_V1
Use_WaterDepth_V1
Use_WaterDepth_V2
Use_WaterDepth_V3
Use_WaterLevel_V1
Use_WaterLevel_V2
Use_WaterLevel_V3
Use_WettedArea_V1
- Required by the methods:
Calc_DischargeDerivatives_V1
Calc_Discharges_V1
Calc_SurfaceWidths_V1
Calc_WaterLevel_V1
Calc_WaterLevel_V2
Calc_WettedAreas_V1
Calc_WettedPerimeterDerivatives_V1
Calc_WettedPerimeters_V1
Get_WaterDepth_V1
- class hydpy.models.wq.wq_factors.WaterLevel(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FactorSequence
Water level [m].
- Calculated by the methods:
Calc_WaterLevel_V1
Calc_WaterLevel_V2
Set_WaterLevel_V1
Use_WaterDepth_V1
Use_WaterDepth_V2
Use_WaterDepth_V3
Use_WaterLevel_V1
Use_WaterLevel_V2
Use_WaterLevel_V3
Use_WettedArea_V1
- Required by the methods:
Calc_DischargeDerivatives_V2
Calc_Index_Excess_Weight_V1
Calc_WaterDepth_V1
Calc_WaterDepth_V3
Get_WaterLevel_V1
- class hydpy.models.wq.wq_factors.WettedAreas(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
MixinTrapezes
,FactorSequence
Wetted area of each trapeze range [m²].
- Calculated by the methods:
Calc_WettedAreas_V1
Use_WaterDepth_V1
Use_WaterDepth_V2
Use_WaterLevel_V1
Use_WaterLevel_V2
Use_WettedArea_V1
- Required by the methods:
Calc_DischargeDerivatives_V1
Calc_Discharges_V1
Calc_WettedArea_V1
- class hydpy.models.wq.wq_factors.WettedArea(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FactorSequence
Total wetted area [m²].
- Calculated by the methods:
Calc_WettedArea_V1
Set_WettedArea_V1
Use_WaterDepth_V1
Use_WaterDepth_V2
Use_WaterLevel_V1
Use_WaterLevel_V2
Use_WettedArea_V1
- Required by the methods:
- class hydpy.models.wq.wq_factors.FlowAreas(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
MixinTrapezesOrSectors
,FactorSequence
The sector-specific wetted areas of those subareas of the cross section involved in water routing [m²].
- Calculated by the methods:
- Required by the methods:
Calc_DischargeDerivatives_V2
Calc_Discharges_V2
Calc_FlowArea_V1
- class hydpy.models.wq.wq_factors.FlowArea(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FactorSequence
The total wetted area of those subareas of the cross section involved in water routing [m²].
- Calculated by the methods:
- class hydpy.models.wq.wq_factors.TotalAreas(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
MixinTrapezesOrSectors
,FactorSequence
The sector-specific wetted areas of the total cross section [m²].
- Calculated by the methods:
- Required by the method:
- class hydpy.models.wq.wq_factors.TotalArea(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FactorSequence
The total wetted area of the total cross section [m²].
- Calculated by the methods:
- Required by the method:
- class hydpy.models.wq.wq_factors.WettedPerimeters(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
MixinTrapezes
,FactorSequence
Wetted perimeter of each trapeze range [m].
- Calculated by the methods:
Calc_WettedPerimeters_V1
Use_WaterDepth_V1
Use_WaterDepth_V2
Use_WaterLevel_V1
Use_WaterLevel_V2
Use_WettedArea_V1
- Required by the methods:
Calc_DischargeDerivatives_V1
Calc_Discharges_V1
Calc_WettedPerimeter_V1
- class hydpy.models.wq.wq_factors.FlowPerimeters(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
MixinTrapezesOrSectors
,FactorSequence
The sector-specific wetted perimeters of those subareas of the cross section involved in water routing [m].
- Calculated by the methods:
- Required by the methods:
- class hydpy.models.wq.wq_factors.WettedPerimeter(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FactorSequence
Total wetted perimeter [m].
- Calculated by the methods:
Calc_WettedPerimeter_V1
Use_WaterDepth_V2
Use_WaterLevel_V2
Use_WettedArea_V1
- Required by the method:
- class hydpy.models.wq.wq_factors.WettedPerimeterDerivatives(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
MixinTrapezes
,FactorSequence
Change in the wetted perimeter of each trapeze range with respect to a water level increase [-].
- Calculated by the methods:
Calc_WettedPerimeterDerivatives_V1
Use_WaterDepth_V1
Use_WaterLevel_V1
- Required by the method:
- class hydpy.models.wq.wq_factors.FlowPerimeterDerivatives(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
MixinTrapezesOrSectors
,FactorSequence
The sector-specific wetted perimeters of those subareas of the cross section involved in water routing [m].
- Calculated by the methods:
Calc_FlowPerimeterDerivatives_V1
Use_WaterDepth_V3
Use_WaterLevel_V3
- Required by the method:
- class hydpy.models.wq.wq_factors.SurfaceWidths(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
MixinTrapezes
,FactorSequence
Surface width of each trapeze range [m].
- Calculated by the methods:
- Required by the methods:
- class hydpy.models.wq.wq_factors.SurfaceWidth(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FactorSequence
Total surface width [m].
- Calculated by the methods:
- Required by the methods:
- class hydpy.models.wq.wq_factors.FlowWidths(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
MixinTrapezesOrSectors
,FactorSequence
The sector-specific widths of those subareas of the cross section involved in water routing [m].
- Calculated by the methods:
- Required by the methods:
- class hydpy.models.wq.wq_factors.TotalWidths(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
MixinTrapezesOrSectors
,FactorSequence
The sector-specific widths of the total cross section [m].
- Calculated by the methods:
- Required by the methods:
- class hydpy.models.wq.wq_factors.TotalWidth(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FactorSequence
The total width of the total cross section [m].
- Calculated by the methods:
- Required by the methods:
- class hydpy.models.wq.wq_factors.DischargeDerivatives(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
MixinTrapezesOrSectors
,FactorSequence
Discharge change of each trapeze range with respect to a water level increase [m²/s].
- Calculated by the methods:
Calc_DischargeDerivatives_V1
Calc_DischargeDerivatives_V2
Use_WaterDepth_V1
Use_WaterDepth_V3
Use_WaterLevel_V1
Use_WaterLevel_V3
- Required by the methods:
- class hydpy.models.wq.wq_factors.DischargeDerivative(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FactorSequence
Total discharge change with respect to a water level increase [m²/s].
- Calculated by the methods:
Calc_DischargeDerivative_V1
Calc_DischargeDerivative_V2
Use_WaterDepth_V1
Use_WaterDepth_V3
Use_WaterLevel_V1
Use_WaterLevel_V3
- Required by the methods:
- class hydpy.models.wq.wq_factors.Celerity(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FactorSequence
Kinematic celerity (wave speed) [m/s].
- Calculated by the methods:
Calc_Celerity_V1
Calc_Celerity_V2
Use_WaterDepth_V1
Use_WaterDepth_V3
Use_WaterLevel_V1
Use_WaterLevel_V3
- Required by the method:
Flux sequences¶
- class hydpy.models.wq.FluxSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
FluxSequences
Flux sequences of model wq.
- The following classes are selected:
Discharges()
The discharge of each trapeze range [m³/s].Discharge()
Total discharge [m³/s].
- class hydpy.models.wq.wq_fluxes.Discharges(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
MixinTrapezesOrSectors
,FluxSequence
The discharge of each trapeze range [m³/s].
- Calculated by the methods:
Calc_Discharges_V1
Calc_Discharges_V2
Use_WaterDepth_V1
Use_WaterDepth_V3
Use_WaterLevel_V1
Use_WaterLevel_V3
- Required by the methods:
- class hydpy.models.wq.wq_fluxes.Discharge(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FluxSequence
Total discharge [m³/s].
- Calculated by the methods:
Calc_Discharge_V2
Calc_Discharge_V3
Use_WaterDepth_V1
Use_WaterDepth_V3
Use_WaterLevel_V1
Use_WaterLevel_V3
- Required by the method:
Aide sequences¶
- class hydpy.models.wq.AideSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
AideSequences
Aide sequences of model wq.
- The following classes are selected:
Index()
Index of the measured height directly below the current height [-].Excess()
Difference between the current height and the next-lower measured height [m].Weight()
Linear weighting factor that is zero if the current height equals the next-lower measured height and one if it equals the next-higher measured height [-].
- class hydpy.models.wq.wq_aides.Index(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
AideSequence
Index of the measured height directly below the current height [-].
- Calculated by the methods:
Calc_Index_Excess_Weight_V1
Use_WaterDepth_V3
Use_WaterLevel_V3
- Required by the methods:
Calc_FlowAreas_V1
Calc_FlowPerimeterDerivatives_V1
Calc_FlowPerimeters_V1
Calc_FlowWidths_V1
Calc_TotalAreas_V1
Calc_TotalWidths_V1
- class hydpy.models.wq.wq_aides.Excess(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
AideSequence
Difference between the current height and the next-lower measured height [m].
- Calculated by the methods:
Calc_Index_Excess_Weight_V1
Use_WaterDepth_V3
Use_WaterLevel_V3
- Required by the methods:
- class hydpy.models.wq.wq_aides.Weight(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
AideSequence
Linear weighting factor that is zero if the current height equals the next-lower measured height and one if it equals the next-higher measured height [-].
- Calculated by the methods:
Calc_Index_Excess_Weight_V1
Use_WaterDepth_V3
Use_WaterLevel_V3
- Required by the methods:
Calc_FlowPerimeters_V1
Calc_FlowWidths_V1
Calc_TotalWidths_V1
- class hydpy.models.wq.AideSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
AideSequences
Aide sequences of model wq.
- The following classes are selected:
Index()
Index of the measured height directly below the current height [-].Excess()
Difference between the current height and the next-lower measured height [m].Weight()
Linear weighting factor that is zero if the current height equals the next-lower measured height and one if it equals the next-higher measured height [-].
- class hydpy.models.wq.ControlParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
SubParameters
Control parameters of model wq.
- The following classes are selected:
NmbTrapezes()
Number of trapezes defining the cross section [-].NmbWidths()
Number of widths that define the cross section [-].NmbSectors()
Number of the separately calculated sectors of the cross section [-].Heights()
The measurement heights of the widths defining the cross section [m].FlowWidths()
The widths of those subareas of the cross section involved in water routing [m].TotalWidths()
The widths of the total cross section [m].Transitions()
Indexes that mark the transitions between separately calculated cross-section sectors [m].BottomLevels()
The bottom level for each trapeze [m].BottomWidths()
The bottom width for each trapeze [m].SideSlopes()
The side slope for each trapeze[-].StricklerCoefficients()
Manning-Strickler coefficient for each trapeze [m^(1/3)/s].BottomSlope()
Bottom slope [-].ChannelDepth()
Channel depth [m].CrestHeight()
The height of the weir’s crest above the channel bottom [m].CrestHeightTolerance()
Smoothing parameter related to the difference between the water depth and the crest height [m].BankfullDischarge()
Bankfull discharge [mm/T].DischargeExponent()
Exponent of the water depth-discharge relation [-].
- class hydpy.models.wq.DerivedParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
SubParameters
Derived parameters of model wq.
- The following classes are selected:
BottomDepths()
The cumulated depth of a trapeze and its lower neighbours [m].TrapezeHeights()
The individual height of each trapeze [m].SlopeWidths()
The total width of both side slopes of each trapeze.TrapezeAreas()
The individual area of each trapeze [m].PerimeterDerivatives()
Change of the perimeter of each trapeze relative to a water level increase within the trapeze’s range [-].SectorFlowWidths()
The sector-specific widths of those subareas of the cross section involved in water routing [m].SectorTotalWidths()
The sector-specific widths of the total cross section [m].SectorFlowAreas()
The sector-specific wetted areas of those subareas of the cross section involved in water routing [m²].SectorTotalAreas()
The sector-specific wetted areas of the total cross section [m²].SectorFlowPerimeters()
The sector-specific wetted perimeters of those subareas of the cross section involved in water routing [m].SectorFlowPerimeterDerivatives()
The sector-specific changes in the wetted perimeters of those subareas of the cross section involved in water routing with respect to water level increases [m].CrestHeightRegularisation()
Regularisation parameter related to the difference between the water depth and the crest height [m].
- class hydpy.models.wq.FactorSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
FactorSequences
Factor sequences of model wq.
- The following classes are selected:
WaterDepth()
Water depth [m].WaterLevel()
Water level [m].WettedAreas()
Wetted area of each trapeze range [m²].WettedArea()
Total wetted area [m²].FlowAreas()
The sector-specific wetted areas of those subareas of the cross section involved in water routing [m²].FlowArea()
The total wetted area of those subareas of the cross section involved in water routing [m²].TotalAreas()
The sector-specific wetted areas of the total cross section [m²].TotalArea()
The total wetted area of the total cross section [m²].WettedPerimeters()
Wetted perimeter of each trapeze range [m].FlowPerimeters()
The sector-specific wetted perimeters of those subareas of the cross section involved in water routing [m].WettedPerimeter()
Total wetted perimeter [m].WettedPerimeterDerivatives()
Change in the wetted perimeter of each trapeze range with respect to a water level increase [-].FlowPerimeterDerivatives()
The sector-specific wetted perimeters of those subareas of the cross section involved in water routing [m].SurfaceWidths()
Surface width of each trapeze range [m].SurfaceWidth()
Total surface width [m].FlowWidths()
The sector-specific widths of those subareas of the cross section involved in water routing [m].TotalWidths()
The sector-specific widths of the total cross section [m].TotalWidth()
The total width of the total cross section [m].DischargeDerivatives()
Discharge change of each trapeze range with respect to a water level increase [m²/s].DischargeDerivative()
Total discharge change with respect to a water level increase [m²/s].Celerity()
Kinematic celerity (wave speed) [m/s].
- class hydpy.models.wq.FluxSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
FluxSequences
Flux sequences of model wq.
- The following classes are selected:
Discharges()
The discharge of each trapeze range [m³/s].Discharge()
Total discharge [m³/s].