HydPy-SW1D (base model)¶
HydPy-SW1D provides features for implementing models for approximating the 1-dimensional shallow water equations in a “hydrodynamic” manner to account for situations like backwater effects that “hydrological” methods cannot handle well.
Method Features¶
- class hydpy.models.sw1d.sw1d_model.Model[source]¶
Bases:
SubstepModelHydPy-SW1D (base model).
- The following “inlet update methods” are called in the given sequence at the beginning of each simulation step:
Pick_Inflow_V1Pick the longitudinal inflow from an arbitrary number of inlet sequences.Pick_Outflow_V1Pick the longitudinal outflow from an arbitrary number of outlet sequences.Pick_LateralFlow_V1Pick the lateral inflow from an arbitrary number of inlet sequences.Pick_WaterLevelDownstream_V1Pick the water level downstream from a receiver sequence.
- The following “run methods” are called in the given sequence during each simulation step:
Calc_MaxTimeSteps_V1Order all submodels that follow theRoutingModel_V1,RoutingModel_V2, orRoutingModel_V3interface to estimate the highest possible computation time step.Calc_TimeStep_V1Determine the computation time step for which we can expect stability for a complete channel network.Send_TimeStep_V1Send the actual computation time step to all submodels following theStorageModel_V1,RoutingModel_V1,RoutingModel_V2, orRoutingModel_V3interface.Calc_Discharges_V1Let a network model order all routing submodels following theRoutingModel_V1,RoutingModel_V2, orRoutingModel_V3interface to determine their individual discharge values.Update_Storages_V1Let a network model order all storage submodels to update their storage contents and their dependent factors.Query_WaterLevels_V1Query the water levels from all submodels following theStorageModel_V1interface.
- The following “outlet update methods” are called in the given sequence at the end of each simulation step:
Pass_Discharge_V1Pass the calculated average discharge of the current simulation step to an arbitrary number of outlet sequences.Pass_WaterLevel_V1Pass the calculated water level to an arbitrary number of sender sequences.Calc_Discharges_V2Query the discharge volume of the complete external simulation step from all submodels following theRoutingModel_V1,RoutingModel_V2, orRoutingModel_V3interface and calculate the corresponding average discharges.
- The following interface methods are available to main models using the defined model as a submodel:
Determine_MaxTimeStep_V1Interface method for determining the highest possible computation time step at a central location.Determine_MaxTimeStep_V2Interface method for determining the highest possible computation time step at an inflow location.Determine_MaxTimeStep_V3Interface method for determining the highest possible computation time step at an outflow weir.Determine_MaxTimeStep_V4Interface method for determining the highest possible computation time step at an outflow location.Determine_MaxTimeStep_V5Interface method for determining the highest possible computation time step at an outflow gate.Determine_MaxTimeStep_V6Interface method for determining the highest possible computation time step at an inflow and outflow location.Determine_Discharge_V1Interface method for determining the discharge at a central location.Determine_Discharge_V2Interface method for determining the discharge at an inflow location.Determine_Discharge_V3Interface method for determining the discharge at an outflow weir.Determine_Discharge_V4Interface method for determining the discharge at an outflow location.Determine_Discharge_V5Interface method for determining the sluice-modified discharge at a central location considering.Determine_Discharge_V6Interface method for determining the discharge at an outflow gate.Determine_Discharge_V7Interface method for determining the discharge at a pumping station.Get_WaterVolume_V1Interface method for querying the water volume in 1000 m³.Get_WaterLevel_V1Interface method for querying the water level in m.Get_Discharge_V1Interface method for querying the discharge in m³/s.Get_DischargeVolume_V1Interface method for querying the discharge in m³.Get_MaxTimeStep_V1Interface method for querying the highest possible computation time step in s.Set_TimeStep_V1Interface method for setting the actual computation time step in s.Get_PartialDischargeUpstream_V1Return a partial discharge estimate suitable for a downstream model.Get_PartialDischargeDownstream_V1Return a partial discharge estimate suitable for an upstream model.Update_Storage_V1Interface method for updating the storage water content.
- 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_MaxTimeStep_V1Estimate the highest possible computation time step for which we can expect stability for a central LIAS-like routing model.Calc_MaxTimeStep_V2Estimate the highest possible computation time step for which we can expect stability for an inflow-providing routing model.Calc_MaxTimeStep_V3Estimate the highest possible computation time step for which we can expect stability for a weir-like routing model.Calc_MaxTimeStep_V4Estimate the highest possible computation time step for which we can expect stability for an outflow-providing routing model.Calc_MaxTimeStep_V5Estimate the highest possible computation time step for which we can expect stability for a gate-like routing model.Calc_MaxTimeStep_V6Estimate the highest possible computation time step for which we can expect stability for an inflow- and outflow-providing routing model.Calc_WaterVolumeUpstream_V1Query the water volume from an upstream submodel that follows theStorageModel_V1interface.Calc_WaterVolumeDownstream_V1Query the water volume from a downstream submodel that follows theStorageModel_V1interface.Calc_WaterLevelUpstream_V1Query the water level from an upstream submodel that follows theStorageModel_V1interface.Calc_WaterLevelDownstream_V1Query the water level from a downstream submodel that follows theStorageModel_V1interface.Calc_WaterLevel_V1Interpolate the water level based on the water levels of the adjacent channel segments.Calc_WaterLevel_V2Take the water level from the downstream channel segment.Calc_WaterLevel_V3Take the water level from the upstream channel segment.Calc_WaterLevel_V4Average the upstream and the downstream water level.Calc_WaterDepth_WaterLevel_CrossSectionModel_V2Let a submodel that follows theCrossSectionModel_V2submodel interface calculate the water depth and level based on the current water volume.Calc_WaterDepth_WaterLevel_V1Let a submodel that follows theCrossSectionModel_V2submodel interface calculate the water depth and level based on the current water volume.Calc_WaterDepth_WettedArea_CrossSectionModel_V2Let a submodel that follows theCrossSectionModel_V2submodel interface calculate the water depth and the wetted area based on the current water level.Calc_WaterDepth_WettedArea_V1Let a submodel that follows theCrossSectionModel_V2submodel interface calculate the water depth and the wetted area based on the current water level.Calc_WaterDepth_WettedArea_WettedPerimeter_CrossSectionModel_V2Let a submodel that follows theCrossSectionModel_V2submodel interface calculate the water depth, the wetted area, and the wetted perimeter based on the current water level.Calc_WaterDepth_WettedArea_WettedPerimeter_V1Let a submodel that follows theCrossSectionModel_V2submodel interface calculate the water depth, the wetted area, and the wetted perimeter based on the current water level.Calc_DischargeUpstream_V1Sum the (partial) discharge of all upstream routing submodels following theRoutingModel_V1orRoutingModel_V2interface.Calc_DischargeDownstream_V1Sum the (partial) discharge of all downstream routing submodels following theRoutingModel_V2orRoutingModel_V3interface.Calc_Discharge_V1Calculate the discharge according to Bates et al. (2010) and de Almeida et al. (2012).Calc_Discharge_V2Calculate the free weir flow after Poleni.Calc_Discharge_V3Calculate the flow under a gate.Calc_Discharge_V4Calculate the pumping rate.Update_Discharge_V1Reduce the already calculated discharge due to limited water availability in one of the adjacent channel segments.Update_Discharge_V2Sluice-like discharge reduction with separate control for low and high flow protection.Reset_DischargeVolume_V1Reset the discharge volume to zero (at the beginning of an external simulation step).Update_DischargeVolume_V1Update the total discharge volume of the current external simulation step.Calc_DischargeVolume_V1Calculate the total discharge volume of a complete external simulation step at once.Calc_DischargeVolume_V2Calculate the total discharge volume of a complete external simulation step at once.Calc_NetInflow_V1Calculate the net flow into a channel segment.Update_WaterVolume_V1Update the current water content of a channel segment.
- Users can hook submodels into the defined main model if they satisfy one of the following interfaces:
CrossSectionModel_V2Interface for calculating discharge-related properties at a channel cross-section.ChannelModel_V1Interface for handling routing and storage submodels.StorageModel_V1Interface for calculating the water amount stored in a single channel segment.RoutingModel_V1Interface for calculating the inflow into a channel.RoutingModel_V2Interface for calculating the discharge between two channel segments.RoutingModel_V3Interface for calculating the outflow of a channel.
- crosssection¶
Required submodel that complies with the following interface: CrossSectionModel_V2.
- crosssection_is_mainmodel¶
- crosssection_typeid¶
- channelmodels¶
Vector of submodels that comply with the following interface: ChannelModel_V1.
- storagemodels¶
Vector of submodels that comply with the following interface: StorageModel_V1.
- routingmodels¶
Vector of submodels that comply with the following interface: RoutingModel_V1.
- storagemodelupstream¶
Required submodel that complies with the following interface: StorageModel_V1.
- storagemodelupstream_is_mainmodel¶
- storagemodelupstream_typeid¶
- storagemodeldownstream¶
Required submodel that complies with the following interface: StorageModel_V1.
- storagemodeldownstream_is_mainmodel¶
- storagemodeldownstream_typeid¶
- routingmodelsupstream¶
Vector of submodels that comply with the following interfaces: RoutingModel_V1, RoutingModel_V2, or RoutingModel_V3.
- routingmodelsdownstream¶
Vector of submodels that comply with the following interfaces: RoutingModel_V2, RoutingModel_V3, or RoutingModel_V3.
- REUSABLE_METHODS: ClassVar[tuple[type[ReusableMethod], ...]] = ()¶
- class hydpy.models.sw1d.sw1d_model.Pick_Inflow_V1[source]¶
Bases:
MethodPick the longitudinal inflow from an arbitrary number of inlet sequences.
Example:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> inlets.longq.shape = 2 >>> inlets.longq = 2.0, 4.0 >>> model.pick_inflow_v1() >>> fluxes.inflow inflow(6.0)
- class hydpy.models.sw1d.sw1d_model.Pick_Outflow_V1[source]¶
Bases:
MethodPick the longitudinal outflow from an arbitrary number of outlet sequences.
Example:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> inlets.longq.shape = 2 >>> inlets.longq = 2.0, 4.0 >>> model.pick_outflow_v1() >>> fluxes.outflow outflow(6.0)
- class hydpy.models.sw1d.sw1d_model.Pick_LateralFlow_V1[source]¶
Bases:
MethodPick the lateral inflow from an arbitrary number of inlet sequences.
- Requires the inlet sequence:
- Calculates the flux sequence:
Example:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> inlets.latq.shape = 2 >>> inlets.latq = 2.0, 4.0 >>> model.pick_lateralflow_v1() >>> fluxes.lateralflow lateralflow(6.0)
- class hydpy.models.sw1d.sw1d_model.Pick_WaterLevelDownstream_V1[source]¶
Bases:
MethodPick the water level downstream from a receiver sequence.
- Requires the inlet sequence:
- Calculates the factor sequence:
Example:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> inlets.waterlevel = 2.0 >>> model.pick_waterleveldownstream_v1() >>> factors.waterleveldownstream waterleveldownstream(2.0)
- class hydpy.models.sw1d.sw1d_model.Pass_Discharge_V1[source]¶
Bases:
MethodPass the calculated average discharge of the current simulation step to an arbitrary number of outlet sequences.
- Requires the derived parameter:
- Requires the flux sequence:
- Calculates the outlet sequence:
- Basic equation:
\(QLong = DischargeVolume / Seconds\)
Example:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> derived.seconds(60.0) >>> fluxes.dischargevolume = 120.0 >>> outlets.longq.shape = 2 >>> model.pass_discharge_v1() >>> outlets.longq longq(2.0, 2.0)
- class hydpy.models.sw1d.sw1d_model.Pass_WaterLevel_V1[source]¶
Bases:
MethodPass the calculated water level to an arbitrary number of sender sequences.
- Requires the factor sequence:
- Calculates the sender sequence:
Example:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> factors.waterlevel = 2.0 >>> senders.waterlevel.shape = 3 >>> model.pass_waterlevel_v1() >>> senders.waterlevel waterlevel(2.0, 2.0, 2.0)
- class hydpy.models.sw1d.sw1d_model.Calc_MaxTimeStep_V1[source]¶
Bases:
MethodEstimate the highest possible computation time step for which we can expect stability for a central LIAS-like routing model.
- Required by the method:
- Requires the control parameter:
- Requires the derived parameter:
- Requires the fixed parameter:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation (Bates et al., 2010):
\(MaxTimeStep = TimeStepFactor \cdot \frac{1000 \cdot LengthMin}{GravitationalAcceleration \cdot WaterDepth}\)
Examples:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> timestepfactor(0.5) >>> derived.lengthmin(2.0) >>> factors.waterdepth = 4.0 >>> model.calc_maxtimestep_v1() >>> factors.maxtimestep maxtimestep(159.637714)
Calc_MaxTimeStep_V1handles the case of zero water depth by setting the maximum time step to infinity:>>> factors.waterdepth = 0.0 >>> model.calc_maxtimestep_v1() >>> factors.maxtimestep maxtimestep(inf)
- class hydpy.models.sw1d.sw1d_model.Calc_MaxTimeStep_V2[source]¶
Bases:
MethodEstimate the highest possible computation time step for which we can expect stability for an inflow-providing routing model.
- Required by the method:
- Requires the control parameters:
- Requires the factor sequence:
- Requires the flux sequence:
- Calculates the factor sequence:
- Basic equation:
\(MaxTimeStep = TimeStepFactor \cdot \frac{1000 \cdot LengthDownstream}{5 / 3 \cdot |Inflow| \cdot WettedArea}\)
Examples:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> timestepfactor(0.5) >>> lengthdownstream(2.0) >>> factors.wettedarea = 5.0 >>> fluxes.inflow = 6.0 >>> model.calc_maxtimestep_v2() >>> factors.maxtimestep maxtimestep(500.0)
For zero inflow values, the computation time step needs no restriction:
>>> fluxes.inflow = 0.0 >>> model.calc_maxtimestep_v2() >>> factors.maxtimestep maxtimestep(inf)
To prevent zero division,
Calc_MaxTimeStep_V2also sets the maximum time step to infinity if there is no wetted area:>>> fluxes.inflow = 6.0 >>> factors.wettedarea = 0.0 >>> model.calc_maxtimestep_v2() >>> factors.maxtimestep maxtimestep(inf)
- class hydpy.models.sw1d.sw1d_model.Calc_MaxTimeStep_V3[source]¶
Bases:
MethodEstimate the highest possible computation time step for which we can expect stability for a weir-like routing model.
- Required by the method:
- Requires the control parameters:
- Requires the fixed parameter:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation:
- \[\begin{split}MaxTimeStep = f \cdot \frac{1000 \cdot l}{c\cdot \sqrt{2 \cdot g \cdot h}} \\ \\ f = TimeStepFactor \\ l = LengthDownstream \\ c = FlowCoefficient \\ g = GravitationalAcceleration \\ h = WaterLevel - CrestHeight\end{split}\]
Examples:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> crestheight(5.0) >>> flowcoefficient(0.6) >>> timestepfactor(0.5) >>> lengthupstream(2.0) >>> factors.waterlevel = 7.0 >>> model.calc_maxtimestep_v3() >>> factors.maxtimestep maxtimestep(266.062857)
For water levels equal to or below the crest height, the flow over the weir is zero and thus cannot cause instability. Hence,
Calc_MaxTimeStep_V3setsMaxTimeStepto infinity in such cases:>>> factors.waterlevel = 5.0 >>> model.calc_maxtimestep_v3() >>> factors.maxtimestep maxtimestep(inf) >>> factors.waterlevel = 3.0 >>> model.calc_maxtimestep_v3() >>> factors.maxtimestep maxtimestep(inf)
- class hydpy.models.sw1d.sw1d_model.Calc_MaxTimeStep_V4[source]¶
Bases:
MethodEstimate the highest possible computation time step for which we can expect stability for an outflow-providing routing model.
- Required by the method:
- Requires the control parameters:
- Requires the factor sequence:
- Requires the flux sequence:
- Calculates the factor sequence:
- Basic equation:
\(MaxTimeStep = TimeStepFactor \cdot \frac{1000 \cdot LengthUpstream}{5 / 3 \cdot |Outflow| \cdot WettedArea}\)
Examples:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> timestepfactor(0.5) >>> lengthupstream(2.0) >>> factors.wettedarea = 5.0 >>> fluxes.outflow = 6.0 >>> model.calc_maxtimestep_v4() >>> factors.maxtimestep maxtimestep(500.0)
For zero outflow values, the computation time step needs no restriction:
>>> fluxes.outflow = 0.0 >>> model.calc_maxtimestep_v4() >>> factors.maxtimestep maxtimestep(inf)
To prevent zero division,
Calc_MaxTimeStep_V4also sets the maximum time step to infinity if there is no wetted area:>>> fluxes.outflow = 6.0 >>> factors.wettedarea = 0.0 >>> model.calc_maxtimestep_v4() >>> factors.maxtimestep maxtimestep(inf)
- class hydpy.models.sw1d.sw1d_model.Calc_MaxTimeStep_V5[source]¶
Bases:
MethodEstimate the highest possible computation time step for which we can expect stability for a gate-like routing model.
- Required by the method:
- Requires the control parameters:
LengthUpstreamBottomLevelGateHeightFlowCoefficientTimeStepFactor- Requires the fixed parameter:
- Requires the factor sequences:
- Calculates the factor sequence:
- Basic equation:
- \[\begin{split}MaxTimeStep = f \cdot \frac{1000 \cdot l}{c \cdot \big( min (h, \ l) - b \big) \cdot \sqrt{2 \cdot g \cdot (l_u - l_d)}} \\ \\ f = TimeStepFactor \\ c = FlowCoefficient \\ h = GateHeight \\ l = WaterLevel \\ l_u = WaterLevelUpstream \\ l_d = WaterLevelDownstream\\ b = BottomLevel \\ g = GravitationalAcceleration\end{split}\]
Examples:
The following examples all correspond to selected ones of
Calc_Discharge_V3.The case of a submerged gate and downstream flow:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> bottomlevel(4.0) >>> gateheight(6.0) >>> flowcoefficient(0.6) >>> lengthupstream(4.0) >>> timestepfactor(0.5) >>> factors.waterlevel = 8.0 >>> factors.waterlevelupstream = 9.0 >>> factors.waterleveldownstream = 7.0 >>> model.calc_maxtimestep_v5() >>> factors.maxtimestep maxtimestep(266.062857)
The case of a non-submerged gate and upstream flow:
>>> gateheight(8.0) >>> factors.waterlevelupstream = 7.0 >>> factors.waterleveldownstream = 9.0 >>> model.calc_maxtimestep_v5() >>> factors.maxtimestep maxtimestep(133.031429)
The case of a negative effective gate opening with zero discharge:
>>> gateheight(0.0) >>> factors.waterlevelupstream = 7.0 >>> factors.waterleveldownstream = 9.0 >>> model.calc_maxtimestep_v5() >>> factors.maxtimestep maxtimestep(inf)
The case of identical water levels:
>>> gateheight(8.0) >>> factors.waterlevelupstream = 6.0 >>> factors.waterleveldownstream = 6.0 >>> model.calc_maxtimestep_v5() >>> factors.maxtimestep maxtimestep(inf)
The case of a controlled gate opening:
>>> def sluice(model) -> None: ... con = model.parameters.control.fastaccess ... fac = model.sequences.factors.fastaccess ... if fac.waterlevelupstream < fac.waterleveldownstream: ... con.gateheight = 4.0 ... else: ... con.gateheight = 10.0 >>> gateheight(callback=sluice) >>> factors.waterlevelupstream = 9.0 >>> factors.waterleveldownstream = 7.0 >>> model.calc_maxtimestep_v5() >>> factors.maxtimestep maxtimestep(133.031429) >>> factors.waterlevelupstream = 7.0 >>> factors.waterleveldownstream = 9.0 >>> model.calc_maxtimestep_v5() >>> factors.maxtimestep maxtimestep(inf)
- class hydpy.models.sw1d.sw1d_model.Calc_MaxTimeStep_V6[source]¶
Bases:
MethodEstimate the highest possible computation time step for which we can expect stability for an inflow- and outflow-providing routing model.
- Required by the method:
- Requires the control parameter:
- Requires the derived parameter:
- Requires the factor sequence:
- Requires the state sequence:
- Calculates the factor sequence:
- Basic equation:
\(MaxTimeStep = TimeStepFactor \cdot \frac{1000 \cdot LengthMin}{5 / 3 \cdot |Discharge| \cdot WettedArea}\)
Examples:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> timestepfactor(0.5) >>> derived.lengthmin(2.0) >>> factors.wettedarea = 5.0 >>> states.discharge = -6.0 >>> model.calc_maxtimestep_v6() >>> factors.maxtimestep maxtimestep(500.0)
For zero outflow values, the computation time step needs no restriction:
>>> states.discharge = 0.0 >>> model.calc_maxtimestep_v6() >>> factors.maxtimestep maxtimestep(inf)
To prevent zero division,
Calc_MaxTimeStep_V4also sets the maximum time step to infinity if there is no wetted area:>>> states.discharge = 6.0 >>> factors.wettedarea = 0.0 >>> model.calc_maxtimestep_v6() >>> factors.maxtimestep maxtimestep(inf)
- class hydpy.models.sw1d.sw1d_model.Calc_MaxTimeSteps_V1[source]¶
Bases:
MethodOrder all submodels that follow the
RoutingModel_V1,RoutingModel_V2, orRoutingModel_V3interface to estimate the highest possible computation time step.Example:
>>> from hydpy.models.sw1d_channel import * >>> parameterstep() >>> nmbsegments(2) >>> with model.add_storagemodel_v1("sw1d_storage", position=0, update=False): ... factors.waterlevel = 6.0 >>> with model.add_routingmodel_v2("sw1d_lias", position=1, update=False): ... timestepfactor(0.5) ... derived.weightupstream(0.5) ... derived.lengthmin(2.0) ... factors.waterdepth = 4.0 >>> with model.add_storagemodel_v1("sw1d_storage", position=1, update=False): ... factors.waterlevel = 4.0 >>> model.calc_maxtimesteps_v1() >>> model.routingmodels[1].sequences.factors.maxtimestep maxtimestep(159.637714)
- class hydpy.models.sw1d.sw1d_model.Calc_TimeStep_V1[source]¶
Bases:
MethodDetermine the computation time step for which we can expect stability for a complete channel network.
- Calculates the factor sequence:
Examples:
Usually,
Calc_TimeStep_V1takes the minimum of the individual routing models’MaxTimeStepestimates:>>> from hydpy.models.sw1d_channel import * >>> parameterstep() >>> nmbsegments(2) >>> with model.add_routingmodel_v2("sw1d_lias", position=0, update=False): ... factors.maxtimestep = 6.0 >>> with model.add_routingmodel_v2("sw1d_lias", position=1, update=False): ... factors.maxtimestep = 7.0 >>> model.timeleft = 7.0 >>> model.calc_timestep_v1() >>> factors.timestep timestep(6.0) >>> from hydpy import round_ >>> round_(model.timeleft) 1.0
When appropriate, the timeleft argument synchronises the end of the next internal computation step with the end of the current external simulation step:
>>> model.timeleft = 5.0 >>> model.calc_timestep_v1() >>> factors.timestep timestep(5.0) >>> round_(model.timeleft) 0.0
- class hydpy.models.sw1d.sw1d_model.Send_TimeStep_V1[source]¶
Bases:
MethodSend the actual computation time step to all submodels following the
StorageModel_V1,RoutingModel_V1,RoutingModel_V2, orRoutingModel_V3interface.- Requires the factor sequence:
Example:
>>> from hydpy.models.sw1d_channel import * >>> parameterstep() >>> nmbsegments(1) >>> with model.add_routingmodel_v2("sw1d_lias", position=0, update=False): ... factors.maxtimestep = 6.0 >>> with model.add_storagemodel_v1("sw1d_storage", position=0, update=False): ... factors.maxtimestep = 6.0 >>> factors.timestep = 5.0 >>> model.send_timestep_v1() >>> model.routingmodels[0].sequences.factors.timestep timestep(5.0) >>> model.storagemodels[0].sequences.factors.timestep timestep(5.0)
- class hydpy.models.sw1d.sw1d_model.Calc_WaterLevelUpstream_V1[source]¶
Bases:
MethodQuery the water level from an upstream submodel that follows the
StorageModel_V1interface.- Required by the methods:
Determine_MaxTimeStep_V1Determine_MaxTimeStep_V3Determine_MaxTimeStep_V4Determine_MaxTimeStep_V5Determine_MaxTimeStep_V6- Calculates the factor sequence:
Example:
>>> from hydpy import prepare_model >>> main, sub = prepare_model("sw1d"), prepare_model("sw1d_storage") >>> sub.sequences.factors.waterlevel = 2.0 >>> main.storagemodelupstream = sub >>> main.storagemodelupstream_typeid = 1 >>> main.calc_waterlevelupstream_v1() >>> main.sequences.factors.waterlevelupstream waterlevelupstream(2.0)
- class hydpy.models.sw1d.sw1d_model.Calc_WaterLevelDownstream_V1[source]¶
Bases:
MethodQuery the water level from a downstream submodel that follows the
StorageModel_V1interface.- Required by the methods:
Determine_MaxTimeStep_V1Determine_MaxTimeStep_V2Determine_MaxTimeStep_V6- Calculates the factor sequence:
Example:
>>> from hydpy import prepare_model >>> main, sub = prepare_model("sw1d"), prepare_model("sw1d_storage") >>> sub.sequences.factors.waterlevel = 2.0 >>> main.storagemodeldownstream = sub >>> main.storagemodeldownstream_typeid = 1 >>> main.calc_waterleveldownstream_v1() >>> main.sequences.factors.waterleveldownstream waterleveldownstream(2.0)
- class hydpy.models.sw1d.sw1d_model.Calc_WaterVolumeUpstream_V1[source]¶
Bases:
MethodQuery the water volume from an upstream submodel that follows the
StorageModel_V1interface.- Required by the methods:
- Calculates the factor sequence:
Example:
>>> from hydpy import prepare_model >>> main, sub = prepare_model("sw1d"), prepare_model("sw1d_storage") >>> sub.sequences.states.watervolume = 2.0 >>> main.storagemodelupstream = sub >>> main.storagemodelupstream_typeid = 1 >>> main.calc_watervolumeupstream_v1() >>> main.sequences.factors.watervolumeupstream watervolumeupstream(2.0)
- class hydpy.models.sw1d.sw1d_model.Calc_WaterVolumeDownstream_V1[source]¶
Bases:
MethodQuery the water volume from a downstream submodel that follows the
StorageModel_V1interface.- Required by the methods:
- Calculates the factor sequence:
Example:
>>> from hydpy import prepare_model >>> main, sub = prepare_model("sw1d"), prepare_model("sw1d_storage") >>> sub.sequences.states.watervolume = 2.0 >>> main.storagemodeldownstream = sub >>> main.storagemodeldownstream_typeid = 1 >>> main.calc_watervolumedownstream_v1() >>> main.sequences.factors.watervolumedownstream watervolumedownstream(2.0)
- class hydpy.models.sw1d.sw1d_model.Calc_WaterLevel_V1[source]¶
Bases:
MethodInterpolate the water level based on the water levels of the adjacent channel segments.
- Required by the methods:
- Requires the derived parameter:
- Requires the factor sequences:
- Calculates the factor sequence:
- Basic equation:
- \[\begin{split}WaterLevel = \omega \cdot WaterLevelUpstream + (1 - \omega) \cdot WaterLevelDownstream \\ \\ \omega = WeightUpstream\end{split}\]
Example:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> derived.weightupstream(0.8) >>> factors.waterlevelupstream = 3.0 >>> factors.waterleveldownstream = 1.0 >>> model.calc_waterlevel_v1() >>> factors.waterlevel waterlevel(2.6)
- class hydpy.models.sw1d.sw1d_model.Calc_WaterLevel_V2[source]¶
Bases:
MethodTake the water level from the downstream channel segment.
- Required by the method:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation:
\(WaterLevel = WaterLevelDownstream\)
Example:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> factors.waterleveldownstream = 3.0 >>> model.calc_waterlevel_v2() >>> factors.waterlevel waterlevel(3.0)
- class hydpy.models.sw1d.sw1d_model.Calc_WaterLevel_V3[source]¶
Bases:
MethodTake the water level from the upstream channel segment.
- Required by the methods:
Determine_Discharge_V7Determine_MaxTimeStep_V3Determine_MaxTimeStep_V4- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation:
\(WaterLevel = WaterLevelUpstream\)
Example:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> factors.waterlevelupstream = 3.0 >>> model.calc_waterlevel_v3() >>> factors.waterlevel waterlevel(3.0)
- class hydpy.models.sw1d.sw1d_model.Calc_WaterLevel_V4[source]¶
Bases:
MethodAverage the upstream and the downstream water level.
- Required by the method:
- Requires the factor sequences:
- Calculates the factor sequence:
- Basic equation:
\(WaterLevel = (WaterLevelUpstream + WaterLevelUpstream) / 2\)
Example:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> factors.waterlevelupstream = 3.0 >>> factors.waterleveldownstream = 1.0 >>> model.calc_waterlevel_v4() >>> factors.waterlevel waterlevel(2.0)
- class hydpy.models.sw1d.sw1d_model.Calc_WaterDepth_WaterLevel_CrossSectionModel_V2[source]¶
Bases:
MethodLet a submodel that follows the
CrossSectionModel_V2submodel interface calculate the water depth and level based on the current water volume.- Required by the method:
- Requires the control parameter:
- Requires the state sequence:
- Calculates the factor sequences:
- class hydpy.models.sw1d.sw1d_model.Calc_WaterDepth_WaterLevel_V1[source]¶
Bases:
MethodLet a submodel that follows the
CrossSectionModel_V2submodel interface calculate the water depth and level based on the current water volume.- Required by the method:
- Required submethod:
- Requires the control parameter:
- Requires the state sequence:
- Calculates the factor sequences:
Example:
We use
wq_trapezeas an example submodel and configure it so that a wetted area of 18 m² corresponds to water depth of 4 m and a water level of 5 m:>>> from hydpy.models.sw1d_storage import * >>> parameterstep() >>> length(2.0) >>> with model.add_crosssection_v2("wq_trapeze"): ... nmbtrapezes(3) ... bottomlevels(1.0, 3.0, 4.0) ... bottomwidths(2.0, 0.0, 2.0) ... sideslopes(0.0, 2.0, 2.0) >>> states.watervolume = 36.0 >>> model.calc_waterdepth_waterlevel_v1() >>> factors.waterdepth waterdepth(4.0) >>> factors.waterlevel waterlevel(5.0)
- class hydpy.models.sw1d.sw1d_model.Calc_WaterDepth_WettedArea_CrossSectionModel_V2[source]¶
Bases:
MethodLet a submodel that follows the
CrossSectionModel_V2submodel interface calculate the water depth and the wetted area based on the current water level.- Required by the method:
- Requires the factor sequence:
- Calculates the factor sequences:
- class hydpy.models.sw1d.sw1d_model.Calc_WaterDepth_WettedArea_V1[source]¶
Bases:
MethodLet a submodel that follows the
CrossSectionModel_V2submodel interface calculate the water depth and the wetted area based on the current water level.- Required by the methods:
Determine_MaxTimeStep_V2Determine_MaxTimeStep_V4Determine_MaxTimeStep_V6- Required submethod:
- Requires the factor sequence:
- Calculates the factor sequences:
Example:
We use
wq_trapezeas an example submodel and configure it so that a water level of 5 m corresponds to a water depth of 4 m and a wetted area of 18 m²:>>> from hydpy.models.sw1d_pump import * >>> parameterstep() >>> with model.add_crosssection_v2("wq_trapeze"): ... nmbtrapezes(3) ... bottomlevels(1.0, 3.0, 4.0) ... bottomwidths(2.0, 0.0, 2.0) ... sideslopes(0.0, 2.0, 2.0) >>> factors.waterlevel = 5.0 >>> model.calc_waterdepth_wettedarea_v1() >>> factors.waterdepth waterdepth(4.0) >>> factors.wettedarea wettedarea(18.0)
- class hydpy.models.sw1d.sw1d_model.Calc_WaterDepth_WettedArea_WettedPerimeter_CrossSectionModel_V2[source]¶
Bases:
MethodLet a submodel that follows the
CrossSectionModel_V2submodel interface calculate the water depth, the wetted area, and the wetted perimeter based on the current water level.- Required by the method:
- Requires the factor sequence:
- Calculates the factor sequences:
- class hydpy.models.sw1d.sw1d_model.Calc_WaterDepth_WettedArea_WettedPerimeter_V1[source]¶
Bases:
MethodLet a submodel that follows the
CrossSectionModel_V2submodel interface calculate the water depth, the wetted area, and the wetted perimeter based on the current water level.- Required by the method:
- Required submethod:
Calc_WaterDepth_WettedArea_WettedPerimeter_CrossSectionModel_V2- Requires the factor sequence:
- Calculates the factor sequences:
Example:
We use
wq_trapezeas an example submodel and configure it so that a water level of 5 m corresponds to a water depth of 4 m, a wetted area of 18 m², and a wetted perimeter of nearly 23 m:>>> from hydpy.models.sw1d_lias import * >>> parameterstep() >>> with model.add_crosssection_v2("wq_trapeze"): ... nmbtrapezes(3) ... bottomlevels(1.0, 3.0, 4.0) ... bottomwidths(2.0, 0.0, 2.0) ... sideslopes(0.0, 2.0, 2.0) >>> factors.waterlevel = 5.0 >>> model.calc_waterdepth_wettedarea_wettedperimeter_v1() >>> factors.waterdepth waterdepth(4.0) >>> factors.wettedarea wettedarea(18.0) >>> factors.wettedperimeter wettedperimeter(22.944272)
- class hydpy.models.sw1d.sw1d_model.Calc_DischargeUpstream_V1[source]¶
Bases:
MethodSum the (partial) discharge of all upstream routing submodels following the
RoutingModel_V1orRoutingModel_V2interface.- Required by the method:
- Requires the state sequence:
- Calculates the flux sequence:
Examples:
If there is no upstream model,
DischargeUpstreamis zero:>>> from hydpy import prepare_model >>> c2 = prepare_model("sw1d_channel") >>> c2.parameters.control.nmbsegments(1) >>> with c2.add_storagemodel_v1("sw1d_storage", position=0, update=False): ... pass >>> with c2.add_routingmodel_v2("sw1d_lias", position=1, update=False) as r2: ... states.discharge = 5.0 >>> r2.calc_dischargeupstream_v1() >>> r2.sequences.fluxes.dischargeupstream dischargeupstream(0.0)
Otherwise,
Calc_DischargeUpstream_V1totals the individual (partial) discharge values:>>> from hydpy import Element, Node >>> n012 = Node("n012", variable="LongQ") >>> e2 = Element("e2", inlets=n012) >>> e2.model = c2 >>> e0, e1 = Element("e0", outlets=n012), Element("e1", outlets=n012) >>> for element, discharge in ((e0, 1.0), (e1, 3.0)): ... c = prepare_model("sw1d_channel") ... c.parameters.control.nmbsegments(1) ... with c.add_storagemodel_v1("sw1d_storage", position=0, update=False): ... pass ... with c.add_routingmodel_v2("sw1d_lias", position=1, update=False): ... states.discharge = discharge ... element.model = c >>> network = c2.couple_models(nodes=(n012,), elements=(e0, e1, e2)) >>> r2.calc_dischargeupstream_v1() >>> r2.sequences.fluxes.dischargeupstream dischargeupstream(4.0)
- class hydpy.models.sw1d.sw1d_model.Calc_DischargeDownstream_V1[source]¶
Bases:
MethodSum the (partial) discharge of all downstream routing submodels following the
RoutingModel_V2orRoutingModel_V3interface.- Required by the method:
- Requires the state sequence:
- Calculates the flux sequence:
Examples:
If there is no downstream model,
DischargeDownstreamis zero:>>> from hydpy import prepare_model >>> c0 = prepare_model("sw1d_channel") >>> c0.parameters.control.nmbsegments(1) >>> with c0.add_routingmodel_v2("sw1d_lias", position=0, update=False) as r0: ... states.discharge = 5.0 >>> with c0.add_storagemodel_v1("sw1d_storage", position=0, update=False): ... pass >>> r0.calc_dischargedownstream_v1() >>> r0.sequences.fluxes.dischargedownstream dischargedownstream(0.0)
Otherwise,
Calc_DischargeDownstream_V1totals the individual (partial) discharge values:>>> from hydpy import Element, Node >>> n012 = Node("n012", variable="LongQ") >>> e0 = Element("e0", outlets=n012) >>> e0.model = c0 >>> e1, e2 = Element("e1", inlets=n012), Element("e2", inlets=n012) >>> for element, discharge in ((e1, 1.0), (e2, 3.0)): ... c = prepare_model("sw1d_channel") ... c.parameters.control.nmbsegments(1) ... with c.add_routingmodel_v2("sw1d_lias", position=0, update=False): ... states.discharge = discharge ... with c.add_storagemodel_v1("sw1d_storage", position=0, update=False): ... pass ... element.model = c >>> network = c0.couple_models(nodes=(n012,), elements=(e0, e1, e2)) >>> r0.calc_dischargedownstream_v1() >>> r0.sequences.fluxes.dischargedownstream dischargedownstream(4.0)
- class hydpy.models.sw1d.sw1d_model.Calc_Discharge_V1[source]¶
Bases:
MethodCalculate the discharge according to Bates et al. (2010) and de Almeida et al. (2012).
- Required by the methods:
- Requires the control parameters:
- Requires the derived parameter:
- Requires the fixed parameter:
- Requires the factor sequences:
TimeStepWettedAreaWettedPerimeterWaterLevelUpstreamWaterLevelDownstream- Requires the flux sequences:
- Updates the state sequence:
- Basic equation (de Almeida et al., 2012):
- \[\begin{split}Q_{i-1/2}^{n+1} = \frac{\left[ (1-\theta) \cdot Q_{i-1/2}^n + \frac{\theta}{2} \cdot \left( Q_{i-3/2}^n + Q_{i+1/2}^n\right) \right] + g \cdot A_f \cdot \Delta t^n \cdot (y_{i-1}^n - y_i^n) / \Delta x} {1 + g \cdot \Delta t \cdot k_{st}^{-2} \cdot \left| Q_{i-1/2}^n \right| \cdot {P_f^n}^{\frac{4}{3}} \cdot {A_f^n}^{-\frac{7}{3}}} \\ \\ Q = Discharge \\ \theta = DiffusionFactor \\ g = GravitationalAcceleration \\ A_f = WettedArea \\ \Delta t = TimeStep \\ \Delta x = Length \\ y = WaterLevel \\ k_{st} = StricklerCoefficient \\ P_f = WettedPerimeter\end{split}\]
Examples:
The following channel configuration corresponds to a rectangular profile and a water surface slope of one meter per kilometre:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> diffusionfactor(0.2) >>> stricklercoefficient(50.0) >>> derived.lengthmean(2.0) >>> factors.timestep = 100.0 >>> factors.wettedarea = 6.0 >>> factors.wettedperimeter = 8.0 >>> factors.waterlevelupstream = 5.0 >>> factors.waterleveldownstream = 3.0
According to the Manning-Strickler equation, this configuration corresponds to a discharge of about 8 m³/s:
>>> dh = factors.waterlevelupstream - factors.waterleveldownstream >>> i = dh/ (1000.0 * derived.lengthmean) >>> r = factors.wettedarea / factors.wettedperimeter >>> v = stricklercoefficient * r**(2.0/3.0) * i**0.5 >>> q = factors.wettedarea * v >>> from hydpy import round_ >>> round_(q) 7.831208
If we use this value as the “old” discharge, relevant for the local inertial term,
Calc_Discharge_V1calculates the same value as the “new” discharge, demonstrating its agreement with Manning-Stricker for stationary conditions:>>> fluxes.dischargeupstream = q >>> fluxes.dischargedownstream = q >>> states.discharge = q >>> model.calc_discharge_v1() >>> states.discharge discharge(7.831208)
Reversing the surface water slope and the “old” discharge reverses the “new” discharge:
>>> factors.waterlevelupstream = -5.0 >>> factors.waterleveldownstream = -3.0 >>> fluxes.dischargeupstream = -q >>> fluxes.dischargedownstream = -q >>> states.discharge = -q >>> model.calc_discharge_v1() >>> states.discharge discharge(-7.831208)
With zero initial discharge, the estimated discharge becomes smaller:
>>> factors.waterlevelupstream = 5.0 >>> factors.waterleveldownstream = 3.0 >>> fluxes.dischargeupstream = 0.0 >>> fluxes.dischargedownstream = 0.0 >>> states.discharge = 0.0 >>> model.calc_discharge_v1() >>> states.discharge discharge(5.886)
For differences between the initial discharge at the upstream, the actual, and the downstream position, the extension introduced by de Almeida et al. (2012) to increase computational stability via numerical diffusion becomes relevant:
>>> states.discharge = q >>> model.calc_discharge_v1() >>> states.discharge discharge(6.937035)
Calc_Discharge_V1sets the discharge directly to zero for zero wetted cross-section areas to prevent zero division errors:>>> factors.wettedarea = 0.0 >>> model.calc_discharge_v1() >>> states.discharge discharge(0.0)
- class hydpy.models.sw1d.sw1d_model.Calc_Discharge_V2[source]¶
Bases:
MethodCalculate the free weir flow after Poleni.
- Required by the method:
- Requires the control parameters:
- Requires the fixed parameter:
- Requires the factor sequence:
- Updates the state sequence:
- Basic equation:
- \[\begin{split}Q = w \cdot 2 / 3 \cdot c \cdot \sqrt{2 \cdot g} \cdot h^{3/2} \\ \\ w = CrestWidth \\ c = FlowCoefficient \\ g = GravitationalAcceleration \\ h = max(WaterLevel - CrestHeight, \ 0)\end{split}\]
Examples:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> crestwidth(10.0) >>> crestheight(5.0) >>> flowcoefficient(0.6) >>> factors.waterlevel = 7.0 >>> model.calc_discharge_v2() >>> states.discharge discharge(50.113471)
>>> factors.waterlevel = 4.0 >>> model.calc_discharge_v2() >>> states.discharge discharge(0.0)
>>> factors.waterlevel = 5.0 >>> model.calc_discharge_v2() >>> states.discharge discharge(0.0)
- class hydpy.models.sw1d.sw1d_model.Calc_Discharge_V3[source]¶
Bases:
MethodCalculate the flow under a gate.
- Required by the method:
- Requires the control parameters:
BottomLevelGateWidthGateHeightFlowCoefficientDampingRadius- Requires the fixed parameter:
- Requires the factor sequences:
- Updates the state sequence:
- Basic equation:
- \[\begin{split}Q = d \cdot w \cdot c \cdot \big( min (h, \ l) - b \big) \cdot \sqrt{2 \cdot g \cdot (l_u - l_d)} \\ \\ d = f_{filter\_norm}(l_u, \ l_d, \ DampingRadius) \\ w = GateWidth \\ c = FlowCoefficient \\ h = GateHeight \\ l = WaterLevel \\ l_u = WaterLevelUpstream \\ l_d = WaterLevelDownstream\\ b = BottomLevel \\ g = GravitationalAcceleration\end{split}\]
Examples:
The first two examples deal with flow under a submerged gate:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> bottomlevel(4.0) >>> gateheight(6.0) >>> gatewidth(3.0) >>> flowcoefficient(0.6) >>> dampingradius(0.0) >>> factors.waterlevel = 8.0 >>> factors.waterlevelupstream = 9.0 >>> factors.waterleveldownstream = 7.0 >>> model.calc_discharge_v3() >>> states.discharge discharge(22.551062) >>> factors.waterlevelupstream = 7.0 >>> factors.waterleveldownstream = 9.0 >>> model.calc_discharge_v3() >>> states.discharge discharge(-22.551062)
The next two examples deal with a gate submerge “on one side”:
>>> gateheight(8.0) >>> factors.waterlevelupstream = 9.0 >>> factors.waterleveldownstream = 7.0 >>> model.calc_discharge_v3() >>> states.discharge discharge(45.102124) >>> factors.waterlevelupstream = 7.0 >>> factors.waterleveldownstream = 9.0 >>> model.calc_discharge_v3() >>> states.discharge discharge(-45.102124)
For non-submerged gates, the water level becomes the effective gate opening:
>>> gateheight(10.0) >>> factors.waterlevelupstream = 9.0 >>> factors.waterleveldownstream = 7.0 >>> model.calc_discharge_v3() >>> states.discharge discharge(45.102124) >>> factors.waterlevelupstream = 7.0 >>> factors.waterleveldownstream = 9.0 >>> model.calc_discharge_v3() >>> states.discharge discharge(-45.102124)
Negative effective gate openings result in zero discharge values:
>>> gateheight(0.0) >>> factors.waterlevelupstream = 9.0 >>> factors.waterleveldownstream = 7.0 >>> model.calc_discharge_v3() >>> states.discharge discharge(0.0) >>> factors.waterlevelupstream = 7.0 >>> factors.waterleveldownstream = 9.0 >>> model.calc_discharge_v3() >>> states.discharge discharge(0.0)
According to the given base equation, the change in flow rate with respect to changes in the water level gradient is highest for little water level gradients. For nearly zero gradients, these changes are so extreme that numerically solving this ordinary differential equation in combination with the ones of other routing models may introduce considerable artificial oscillations.
In the following example, a water level gradient of 1 mm corresponds to a discharge of only 0.3 m³/s, but also to a discharge increase of nearly 1600 m³/s per meter rise of the upstream water level:
>>> gateheight(10.0) >>> factors.waterlevelupstream = 8.0001 >>> factors.waterleveldownstream = 8.0 >>> model.calc_discharge_v3() >>> states.discharge discharge(0.31892) >>> from hydpy import NumericalDifferentiator, round_ >>> numdiff = NumericalDifferentiator( ... xsequence=factors.waterlevelupstream, ... ysequences=[states.discharge], ... methods=[model.calc_discharge_v3]) >>> numdiff() d_discharge/d_waterlevelupstream: 1594.591021
Principally, one could reduce the resulting oscillations by decreasing the internal calculation step size. However, this alone sometimes results in unacceptable increases in computation time. Hence, we suggest using the
DampingRadiusparameter to prevent such oscillations. Setting it, for example, to 1 mm reduces the change in discharge to 40 m³/s per meter:>>> dampingradius(0.001) >>> numdiff() d_discharge/d_waterlevelupstream: 39.685825
Be careful not to set larger values than necessary, as this stabilisation trick does not only reduce the discharge derivative but also the discharge itself:
>>> model.calc_discharge_v3() >>> states.discharge discharge(0.001591)
All of the above examples deal with fixed gate openings. However, in reality, gates are often controlled, so their opening degree depends on other properties. Therefore, parameter
GateHeightalternatively accepts a callback function for adjusting its values based on the current model state. One can, for example, define a “sluice” function that prevents any flow for reversed water level gradients:>>> def sluice(model) -> None: ... con = model.parameters.control.fastaccess ... fac = model.sequences.factors.fastaccess ... if fac.waterlevelupstream < fac.waterleveldownstream: ... con.gateheight = 4.0 ... else: ... con.gateheight = 10.0 >>> ();gateheight(callback=sluice);() (...)
Method
Calc_Discharge_V3applies this callback function before performing its further calculations. Hence, the following results agree with the “non-submerged gates” example for a positive water level gradient and the “negative effective gate opening” example for a negative one:>>> factors.waterlevelupstream = 9.0 >>> factors.waterleveldownstream = 7.0 >>> model.calc_discharge_v3() >>> states.discharge discharge(45.102124) >>> factors.waterlevelupstream = 7.0 >>> factors.waterleveldownstream = 9.0 >>> model.calc_discharge_v3() >>> states.discharge discharge(0.0)
- class hydpy.models.sw1d.sw1d_model.Calc_Discharge_V4[source]¶
Bases:
MethodCalculate the pumping rate.
- Required by the method:
- Requires the control parameters:
- Requires the factor sequences:
- Updates the state sequence:
- Basic equation:
- \[\]
- Basic equations:
- \[\begin{split}Discharge = \begin{cases} 0 &|\ h_u < t_1 \\ Q^* \cdot \frac{h_u - t_1}{t_2 - t_1} &|\ t_1 \leq h_u < t_2 \\ Q^* &|\ t_2 \leq h_u \end{cases} \\ \\ \\ Q^* = max \big( f_{gradient2pumpingrate}(h_d - h_u), \ 0 \big) \\ h_u = WaterLevelUpstream \\ h_d = WaterLevelDownstream \\ t_1 = TargetWaterLevel1 \\ t_2 = TargetWaterLevel2\end{split}\]
Examples:
The maximum pumping rate is 1 m³/s for equal water levels and decreases linearly with rising downstream water levels until it reaches 0 m³/s:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> gradient2pumpingrate(PPoly(Poly(x0=0.0, cs=[1.0, -0.1]), ... Poly(x0=10.0, cs=[0.0])))
We prepare a
UnitTestobject to demonstrate howCalc_Discharge_V4behaves when the upstream water level changes:>>> from hydpy import UnitTest >>> test = UnitTest( ... model, model.calc_discharge_v4, ... last_example=7, ... parseqs=(factors.waterlevelupstream, states.discharge))
We fix the downstream water level to 2 m and vary the upstream water level between 1.5 m to 4.5 m:
>>> factors.waterleveldownstream = 2.0 >>> test.nexts.waterlevelupstream = 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5
If we set both target water levels to the same value, the pump becomes fully activated or deactivated when the upstream water level exceeds or falls below this threshold:
>>> targetwaterlevel1(2.0) >>> targetwaterlevel2(2.0) >>> test() | ex. | waterlevelupstream | discharge | ---------------------------------------- | 1 | 1.5 | 0.0 | | 2 | 2.0 | 1.0 | | 3 | 2.5 | 0.95 | | 4 | 3.0 | 0.9 | | 5 | 3.5 | 0.85 | | 6 | 4.0 | 0.8 | | 7 | 4.5 | 0.75 |
Setting
TargetWaterLevel1andTargetWaterLevel2to the same value might result in situations with frequent “on-off switching”, which may eventually have adverse effects on computational efficiency or simulation accuracy. After settingTargetWaterLevel2to 4 m, the pump’s transition between on and off becomes smoother:>>> targetwaterlevel2(4.0) >>> test() | ex. | waterlevelupstream | discharge | ---------------------------------------- | 1 | 1.5 | 0.0 | | 2 | 2.0 | 0.0 | | 3 | 2.5 | 0.2375 | | 4 | 3.0 | 0.45 | | 5 | 3.5 | 0.6375 | | 6 | 4.0 | 0.8 | | 7 | 4.5 | 0.75 |
- class hydpy.models.sw1d.sw1d_model.Update_Discharge_V1[source]¶
Bases:
MethodReduce the already calculated discharge due to limited water availability in one of the adjacent channel segments.
- Required by the methods:
- Requires the factor sequences:
- Updates the state sequence:
- Basic equations:
- \[\begin{split}Q_{new} = \begin{cases} max(Q_{old}, \ 1000 \cdot max(V_u, \ 0) / \Delta &|\ Q_{old} > 0 \\ min(Q_{old}, \ -1000 \cdot max(V_d, \ 0) / \Delta &|\ Q_{old} < 0 \end{cases} \\ \\ \\ Q = Discharge \\ V_u = WaterVolumeUpstream \\ V_d = WaterVolumeDownstream \\ \Delta = TimeStep\end{split}\]
Examples:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> factors.timestep = 100.0 >>> factors.watervolumeupstream = 0.1 >>> factors.watervolumedownstream = 0.2
Update_Discharge_V1must consider the upstream segment’s water volume for positive discharge values:>>> states.discharge = 1.0 >>> model.update_discharge_v1() >>> states.discharge discharge(1.0) >>> states.discharge = 2.0 >>> model.update_discharge_v1() >>> states.discharge discharge(1.0)
Instead, it must consider the downstream segment’s water volume for negative discharge values:
>>> states.discharge = -2.0 >>> model.update_discharge_v1() >>> states.discharge discharge(-2.0) >>> states.discharge = -3.0 >>> model.update_discharge_v1() >>> states.discharge discharge(-2.0)
- class hydpy.models.sw1d.sw1d_model.Update_Discharge_V2[source]¶
Bases:
MethodSluice-like discharge reduction with separate control for low and high flow protection.
- Required by the method:
- Requires the control parameters:
BottomLowWaterThresholdUpperLowWaterThresholdBottomHighWaterThresholdUpperHighWaterThreshold- Requires the derived parameter:
- Requires the factor sequences:
- Updates the state sequence:
- Basic equations:
- \[\begin{split}Q_{new} = Q_{new} \cdot \begin{cases} free &|\ h_u \leq h_d \\ free + sluice &|\ h_d < h_u \\ \end{cases} \\ \\ \\ closed = \begin{cases} 1 &|\ h_u \leq t_{bl} \\ 1 - \frac{h_u - t_{bl}}{t_{ul} - t_{bl}} &|\ t_{bl} < h_u < t_{ul} \\ 0 &|\ t_{ul} \leq h_u \end{cases} \\ \\ sluice = \begin{cases} 0 &|\ h_u \leq t_{bh} \\ \frac{h_u - t_{bh}}{t_{uh} - t_{bh}} &|\ t_{bh} < h_u < t_{uh} \\ 1 &|\ t_{uh} \leq h_u \end{cases} \\ \\ free = 1 - closed - sluice \\ \\ Q = Discharge \\ h_u = WaterLevelUpstream \\ h_d = WaterLevelDownstream \\ t_{bl} = BottomLowWaterThreshold \\ t_{ul} = UpperLowWaterThreshold \\ t_{bh} = BottomHighWaterThreshold \\ t_{uh} = UpperHighWaterThreshold\end{split}\]
Examples:
All involved control parameters are subclasses of
SeasonalParameter, which allows the simulation of seasonal sluice control schemes. To show how this works, we first define a simulation period of four days:>>> from hydpy import pub >>> pub.timegrids = "2000-01-01", "2000-01-05", "1d"
We prepare a model and define different control schemes for four consecutive days:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> bottomlowwaterthreshold(_1_1_12=5.0, _1_2_12=2.0, _1_3_12=2.0, _1_4_12=2.0) >>> upperlowwaterthreshold(_1_1_12=5.0, _1_2_12=8.0, _1_3_12=5.0, _1_4_12=6.0) >>> bottomhighwaterthreshold(_1_1_12=5.0, _1_2_12=2.0, _1_3_12=5.0, _1_4_12=4.0) >>> upperhighwaterthreshold(_1_1_12=5.0, _1_2_12=8.0, _1_3_12=8.0, _1_4_12=8.0) >>> derived.toy.update()
We prepare a
UnitTestobject to demonstrate the dependency ofUpdate_Discharge_V2on the downstream water level:>>> from hydpy import UnitTest >>> test = UnitTest(model, model.update_discharge_v2, last_example=9, ... parseqs=(factors.waterlevelupstream, states.discharge)) >>> test.nexts.waterlevelupstream = 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0
We will discuss each day’s control scheme for a normal flow situation with a relatively low downstream water level and a reversed flow situation with a relatively high downstream water level.
For April 1, all threshold parameters have the same value of 5 m. So, gates are generally closed below an upstream water level of 5 m to prevent the source catchment from running dry during low flow periods (“closed gate”) and only allow normal flow above 5 m to maximise drainage during high flow periods (“sluice mode”):
>>> model.idx_sim = pub.timegrids.init["2000-01-01"] >>> factors.waterleveldownstream = 0.0 >>> test.inits.discharge = 1.0 >>> test() | ex. | waterlevelupstream | discharge | ---------------------------------------- | 1 | 1.0 | 0.0 | | 2 | 2.0 | 0.0 | | 3 | 3.0 | 0.0 | | 4 | 4.0 | 0.0 | | 5 | 5.0 | 1.0 | | 6 | 6.0 | 1.0 | | 7 | 7.0 | 1.0 | | 8 | 8.0 | 1.0 | | 9 | 9.0 | 1.0 |
>>> factors.waterleveldownstream = 10.0 >>> test.inits.discharge = -1.0 >>> test() | ex. | waterlevelupstream | discharge | ---------------------------------------- | 1 | 1.0 | 0.0 | | 2 | 2.0 | 0.0 | | 3 | 3.0 | 0.0 | | 4 | 4.0 | 0.0 | | 5 | 5.0 | 0.0 | | 6 | 6.0 | 0.0 | | 7 | 7.0 | 0.0 | | 8 | 8.0 | 0.0 | | 9 | 9.0 | 0.0 |
In the following examples, he transitions between the low and high water control schemes are not sharp but gradual, which is often more realistic and numerically favourable. For April 2, the values of
BottomLowWaterThresholdandBottomHighWaterThresholdand the values ofUpperLowWaterThresholdandUpperHighWaterThresholdare equal. Hence, we see a linear-interpolation-like transition from the “closed gate” to the “sluice mode” control schemes:>>> model.idx_sim = pub.timegrids.init["2000-01-02"] >>> factors.waterleveldownstream = 0.0 >>> test.inits.discharge = 1.0 >>> test() | ex. | waterlevelupstream | discharge | ---------------------------------------- | 1 | 1.0 | 0.0 | | 2 | 2.0 | 0.0 | | 3 | 3.0 | 0.166667 | | 4 | 4.0 | 0.333333 | | 5 | 5.0 | 0.5 | | 6 | 6.0 | 0.666667 | | 7 | 7.0 | 0.833333 | | 8 | 8.0 | 1.0 | | 9 | 9.0 | 1.0 |
>>> factors.waterleveldownstream = 10.0 >>> test.inits.discharge = -1.0 >>> test() | ex. | waterlevelupstream | discharge | ---------------------------------------- | 1 | 1.0 | 0.0 | | 2 | 2.0 | 0.0 | | 3 | 3.0 | 0.0 | | 4 | 4.0 | 0.0 | | 5 | 5.0 | 0.0 | | 6 | 6.0 | 0.0 | | 7 | 7.0 | 0.0 | | 8 | 8.0 | 0.0 | | 9 | 9.0 | 0.0 |
For April 3, the values of
UpperLowWaterThresholdandBottomHighWaterThresholdare equal. So, at this point, neither the “closed gate” nor the “sluice mode” control schemes apply, and the water can flow freely in both directions (“free discharge”):>>> model.idx_sim = pub.timegrids.init["2000-01-03"] >>> factors.waterleveldownstream = 0.0 >>> test.inits.discharge = 1.0 >>> test() | ex. | waterlevelupstream | discharge | ---------------------------------------- | 1 | 1.0 | 0.0 | | 2 | 2.0 | 0.0 | | 3 | 3.0 | 0.333333 | | 4 | 4.0 | 0.666667 | | 5 | 5.0 | 1.0 | | 6 | 6.0 | 1.0 | | 7 | 7.0 | 1.0 | | 8 | 8.0 | 1.0 | | 9 | 9.0 | 1.0 |
>>> factors.waterleveldownstream = 10.0 >>> test.inits.discharge = -1.0 >>> test() | ex. | waterlevelupstream | discharge | ---------------------------------------- | 1 | 1.0 | 0.0 | | 2 | 2.0 | 0.0 | | 3 | 3.0 | -0.333333 | | 4 | 4.0 | -0.666667 | | 5 | 5.0 | -1.0 | | 6 | 6.0 | -0.666667 | | 7 | 7.0 | -0.333333 | | 8 | 8.0 | 0.0 | | 9 | 9.0 | 0.0 |
For April 4, the “closed gate” and “sluice mode” parameter ranges are partly overlapping, so reversed flow can occur but only with reduced intensity:
>>> model.idx_sim = pub.timegrids.init["2000-01-04"] >>> factors.waterleveldownstream = 0.0 >>> test.inits.discharge = 1.0 >>> test() | ex. | waterlevelupstream | discharge | ---------------------------------------- | 1 | 1.0 | 0.0 | | 2 | 2.0 | 0.0 | | 3 | 3.0 | 0.25 | | 4 | 4.0 | 0.5 | | 5 | 5.0 | 0.75 | | 6 | 6.0 | 1.0 | | 7 | 7.0 | 1.0 | | 8 | 8.0 | 1.0 | | 9 | 9.0 | 1.0 |
>>> factors.waterleveldownstream = 10.0 >>> test.inits.discharge = -1.0 >>> test() | ex. | waterlevelupstream | discharge | ---------------------------------------- | 1 | 1.0 | 0.0 | | 2 | 2.0 | 0.0 | | 3 | 3.0 | -0.25 | | 4 | 4.0 | -0.5 | | 5 | 5.0 | -0.5 | | 6 | 6.0 | -0.5 | | 7 | 7.0 | -0.25 | | 8 | 8.0 | 0.0 | | 9 | 9.0 | 0.0 |
- class hydpy.models.sw1d.sw1d_model.Reset_DischargeVolume_V1[source]¶
Bases:
MethodReset the discharge volume to zero (at the beginning of an external simulation step).
- Calculates the flux sequence:
Example:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> fluxes.dischargevolume = 1.0 >>> model.reset_dischargevolume_v1() >>> fluxes.dischargevolume dischargevolume(0.0)
- class hydpy.models.sw1d.sw1d_model.Update_DischargeVolume_V1[source]¶
Bases:
MethodUpdate the total discharge volume of the current external simulation step.
- Required by the methods:
Determine_Discharge_V1Determine_Discharge_V3Determine_Discharge_V5Determine_Discharge_V6Determine_Discharge_V7- Requires the factor sequence:
- Requires the state sequence:
- Updates the flux sequence:
- Basic equation:
\(DischargeVolume_{new} = DischargeVolume_{old} + TimeStep \cdot Discharge\)
Example:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> fluxes.dischargevolume = 6.0 >>> factors.timestep = 60.0 >>> states.discharge = 0.2 >>> model.update_dischargevolume_v1() >>> fluxes.dischargevolume dischargevolume(18.0)
- class hydpy.models.sw1d.sw1d_model.Calc_DischargeVolume_V1[source]¶
Bases:
MethodCalculate the total discharge volume of a complete external simulation step at once.
- Requires the derived parameter:
- Requires the flux sequence:
- Updates the flux sequence:
- Basic equation:
\(DischargeVolume = Seconds \cdot Inflow\)
Example:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> derived.seconds(60.0) >>> fluxes.inflow = 2.0 >>> model.calc_dischargevolume_v1() >>> fluxes.dischargevolume dischargevolume(120.0)
- class hydpy.models.sw1d.sw1d_model.Calc_DischargeVolume_V2[source]¶
Bases:
MethodCalculate the total discharge volume of a complete external simulation step at once.
- Requires the derived parameter:
- Requires the flux sequence:
- Updates the flux sequence:
- Basic equation:
\(DischargeVolume = Seconds \cdot Outflow\)
Example:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> derived.seconds(60.0) >>> fluxes.outflow = 2.0 >>> model.calc_dischargevolume_v2() >>> fluxes.dischargevolume dischargevolume(120.0)
- class hydpy.models.sw1d.sw1d_model.Calc_Discharges_V1[source]¶
Bases:
MethodLet a network model order all routing submodels following the
RoutingModel_V1,RoutingModel_V2, orRoutingModel_V3interface to determine their individual discharge values.Example:
>>> from hydpy.models.sw1d_channel import * >>> parameterstep() >>> nmbsegments(2) >>> with model.add_routingmodel_v2("sw1d_lias", position=1, update=False) as r: ... diffusionfactor(0.2) ... stricklercoefficient(50.0) ... derived.lengthmean(2.0) ... factors.timestep = 100.0 ... factors.wettedarea = 6.0 ... factors.wettedperimeter = 8.0 ... factors.waterlevelupstream = 5.0 ... factors.waterleveldownstream = 3.0 ... states.discharge = 7.831208 ... fluxes.dischargeupstream = 7.831208 ... fluxes.dischargedownstream = 7.831208 >>> model.calc_discharges_v1() >>> r.sequences.states.discharge discharge(7.831208)
- class hydpy.models.sw1d.sw1d_model.Calc_Discharges_V2[source]¶
Bases:
MethodQuery the discharge volume of the complete external simulation step from all submodels following the
RoutingModel_V1,RoutingModel_V2, orRoutingModel_V3interface and calculate the corresponding average discharges.- Requires the derived parameter:
- Calculates the flux sequence:
- Basic equation:
\(Discharges_i = DischargeVolume / Seconds\)
Examples:
>>> from hydpy.models.sw1d_channel import * >>> parameterstep() >>> nmbsegments(2) >>> derived.seconds(60.0) >>> with model.add_routingmodel_v2("sw1d_lias", position=1, update=False): ... fluxes.dischargevolume = 120.0 >>> model.calc_discharges_v2() >>> fluxes.discharges discharges(0.0, 2.0, 0.0)
- class hydpy.models.sw1d.sw1d_model.Calc_NetInflow_V1[source]¶
Bases:
MethodCalculate the net flow into a channel segment.
- Required by the method:
- Requires the factor sequence:
- Requires the flux sequence:
- Calculates the flux sequence:
Examples:
Without adjacent routing models, net inflow equals lateral inflow:
>>> from hydpy import Element, Node, prepare_model >>> c = prepare_model("sw1d_channel") >>> c.parameters.control.nmbsegments(1) >>> with c.add_storagemodel_v1("sw1d_storage", position=0, update=False) as s: ... factors.timestep = 100.0 ... fluxes.lateralflow = 1.0 >>> s.calc_netinflow_v1() >>> s.sequences.fluxes.netinflow netinflow(0.1)
With adjacent routing models,
Calc_NetInflow_V1adds the discharge from the upper one and subtracts the discharge from the lower one:>>> n01, n12 = Node("n01", variable="LongQ"), Node("n12", variable="LongQ") >>> e1 = Element("e1", inlets=n01, outlets=n12) >>> e1.model = c >>> e0a, e0b = Element("e0a", outlets=n01), Element("e0b", outlets=n01) >>> e2a, e2b = Element("e2a", inlets=n12), Element("e2b", inlets=n12) >>> for element, position, discharge in ((e0a, 1, 1.0), (e0b, 1, 2.0), ... (e2a, 0, 2.0), (e2b, 0, 3.0)): ... c = prepare_model("sw1d_channel") ... c.parameters.control.nmbsegments(1) ... with c.add_routingmodel_v2( ... "sw1d_lias", position=position, update=False): ... states.discharge = discharge ... with c.add_storagemodel_v1("sw1d_storage", position=0, update=False): ... pass ... element.model = c >>> network = c.couple_models( ... nodes=(n01, n12), elements=(e0a, e0b, e1, e2a, e2b)) >>> s.calc_netinflow_v1() >>> s.sequences.fluxes.netinflow netinflow(-0.1)
- class hydpy.models.sw1d.sw1d_model.Update_WaterVolume_V1[source]¶
Bases:
MethodUpdate the current water content of a channel segment.
- Required by the method:
- Requires the flux sequence:
- Updates the state sequence:
Example:
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> states.watervolume = 2.0 >>> fluxes.netinflow = 1.0 >>> model.update_watervolume_v1() >>> states.watervolume watervolume(3.0)
- class hydpy.models.sw1d.sw1d_model.Update_Storages_V1[source]¶
Bases:
MethodLet a network model order all storage submodels to update their storage contents and their dependent factors.
Example:
>>> from hydpy.models.sw1d_channel import * >>> parameterstep() >>> nmbsegments(1) >>> with model.add_routingmodel_v2("sw1d_lias", position=0, update=False): ... states.discharge = 50.0 >>> with model.add_storagemodel_v1("sw1d_storage", position=0, update=False): ... length(2.0) ... states.watervolume = 2.0 ... factors.timestep = 100.0 ... fluxes.lateralflow = 1.0 >>> with model.add_routingmodel_v2("sw1d_lias", position=1, update=False): ... states.discharge = 60.0 >>> model.update_storages() >>> model.storagemodels[0].sequences.states.watervolume watervolume(1.1)
- class hydpy.models.sw1d.sw1d_model.Query_WaterLevels_V1[source]¶
Bases:
MethodQuery the water levels from all submodels following the
StorageModel_V1interface.- Calculates the factor sequence:
Example:
>>> from hydpy.models.sw1d_channel import * >>> parameterstep() >>> nmbsegments(2) >>> with model.add_storagemodel_v1("sw1d_storage", position=0, update=False): ... factors.waterlevel = 1.0 >>> with model.add_storagemodel_v1("sw1d_storage", position=1, update=False): ... factors.waterlevel = -1.0 >>> model.query_waterlevels_v1() >>> factors.waterlevels waterlevels(1.0, -1.0)
- class hydpy.models.sw1d.sw1d_model.Determine_MaxTimeStep_V1[source]¶
Bases:
AutoMethodInterface method for determining the highest possible computation time step at a central location.
- Required submethods:
Calc_WaterLevelUpstream_V1Calc_WaterLevelDownstream_V1Calc_WaterLevel_V1Calc_WaterDepth_WettedArea_WettedPerimeter_V1Calc_DischargeUpstream_V1Calc_DischargeDownstream_V1Calc_MaxTimeStep_V1- Requires the control parameter:
- Requires the derived parameters:
- Requires the fixed parameter:
- Requires the state sequence:
- Calculates the factor sequences:
WaterLevelUpstreamWaterLevelDownstreamWaterLevelWaterDepthWettedAreaWettedPerimeterMaxTimeStep- Calculates the flux sequences:
- class hydpy.models.sw1d.sw1d_model.Determine_MaxTimeStep_V2[source]¶
Bases:
AutoMethodInterface method for determining the highest possible computation time step at an inflow location.
- Required submethods:
Calc_WaterLevelDownstream_V1Calc_WaterLevel_V2Calc_WaterDepth_WettedArea_V1Calc_MaxTimeStep_V2- Requires the control parameters:
- Requires the flux sequence:
- Calculates the factor sequences:
WaterLevelDownstreamWaterLevelWaterDepthWettedAreaMaxTimeStep
- class hydpy.models.sw1d.sw1d_model.Determine_MaxTimeStep_V3[source]¶
Bases:
AutoMethodInterface method for determining the highest possible computation time step at an outflow weir.
- Required submethods:
Calc_WaterLevelUpstream_V1Calc_WaterLevel_V3Calc_MaxTimeStep_V3- Requires the control parameters:
- Requires the fixed parameter:
- Calculates the factor sequences:
- class hydpy.models.sw1d.sw1d_model.Determine_MaxTimeStep_V4[source]¶
Bases:
AutoMethodInterface method for determining the highest possible computation time step at an outflow location.
- Required submethods:
Calc_WaterLevelUpstream_V1Calc_WaterLevel_V3Calc_WaterDepth_WettedArea_V1Calc_MaxTimeStep_V4- Requires the control parameters:
- Requires the flux sequence:
- Calculates the factor sequences:
WaterLevelUpstreamWaterLevelWaterDepthWettedAreaMaxTimeStep
- class hydpy.models.sw1d.sw1d_model.Determine_MaxTimeStep_V5[source]¶
Bases:
AutoMethodInterface method for determining the highest possible computation time step at an outflow gate.
- Required submethods:
Calc_WaterLevelUpstream_V1Calc_WaterLevel_V4Calc_MaxTimeStep_V5- Requires the control parameters:
BottomLevelGateHeightFlowCoefficientLengthUpstreamTimeStepFactor- Requires the fixed parameter:
- Requires the factor sequence:
- Calculates the factor sequences:
- class hydpy.models.sw1d.sw1d_model.Determine_MaxTimeStep_V6[source]¶
Bases:
AutoMethodInterface method for determining the highest possible computation time step at an inflow and outflow location.
- Required submethods:
Calc_WaterLevelUpstream_V1Calc_WaterLevelDownstream_V1Calc_WaterLevel_V1Calc_WaterDepth_WettedArea_V1Calc_MaxTimeStep_V6- Requires the control parameter:
- Requires the derived parameters:
- Requires the state sequence:
- Calculates the factor sequences:
WaterLevelDownstreamWaterLevelUpstreamWaterLevelWaterDepthWettedAreaMaxTimeStep
- class hydpy.models.sw1d.sw1d_model.Determine_Discharge_V1[source]¶
Bases:
AutoMethodInterface method for determining the discharge at a central location.
- Required submethods:
Calc_WaterVolumeUpstream_V1Calc_WaterVolumeDownstream_V1Calc_Discharge_V1Update_Discharge_V1Update_DischargeVolume_V1- Requires the control parameters:
- Requires the derived parameter:
- Requires the fixed parameter:
- Requires the factor sequences:
WaterLevelUpstreamWaterLevelDownstreamWettedAreaWettedPerimeterTimeStep- Requires the flux sequences:
- Updates the flux sequence:
- Updates the state sequence:
- Calculates the factor sequences:
- class hydpy.models.sw1d.sw1d_model.Determine_Discharge_V2[source]¶
Bases:
MethodInterface method for determining the discharge at an inflow location.
- class hydpy.models.sw1d.sw1d_model.Determine_Discharge_V3[source]¶
Bases:
AutoMethodInterface method for determining the discharge at an outflow weir.
- Required submethods:
- Requires the control parameters:
- Requires the fixed parameter:
- Requires the factor sequences:
- Updates the flux sequence:
- Updates the state sequence:
- class hydpy.models.sw1d.sw1d_model.Determine_Discharge_V4[source]¶
Bases:
MethodInterface method for determining the discharge at an outflow location.
- class hydpy.models.sw1d.sw1d_model.Determine_Discharge_V5[source]¶
Bases:
AutoMethodInterface method for determining the sluice-modified discharge at a central location considering.
- Required submethods:
Calc_WaterVolumeUpstream_V1Calc_WaterVolumeDownstream_V1Calc_Discharge_V1Update_Discharge_V1Update_Discharge_V2Update_DischargeVolume_V1- Requires the control parameters:
StricklerCoefficientDiffusionFactorBottomLowWaterThresholdUpperLowWaterThresholdBottomHighWaterThresholdUpperHighWaterThreshold- Requires the derived parameters:
- Requires the fixed parameter:
- Requires the factor sequences:
WaterLevelUpstreamWaterLevelDownstreamWettedAreaWettedPerimeterTimeStep- Requires the flux sequences:
- Updates the flux sequence:
- Updates the state sequence:
- Calculates the factor sequences:
- class hydpy.models.sw1d.sw1d_model.Determine_Discharge_V6[source]¶
Bases:
AutoMethodInterface method for determining the discharge at an outflow gate.
- Required submethods:
- Requires the control parameters:
BottomLevelGateHeightGateWidthFlowCoefficientDampingRadius- Requires the fixed parameter:
- Requires the factor sequences:
- Updates the flux sequence:
- Updates the state sequence:
- class hydpy.models.sw1d.sw1d_model.Determine_Discharge_V7[source]¶
Bases:
AutoMethodInterface method for determining the discharge at a pumping station.
- Required submethods:
Calc_WaterLevel_V3Calc_Discharge_V4Update_DischargeVolume_V1- Requires the control parameters:
- Requires the factor sequences:
- Updates the flux sequence:
- Updates the state sequence:
- Calculates the factor sequence:
- class hydpy.models.sw1d.sw1d_model.Get_WaterVolume_V1[source]¶
Bases:
MethodInterface method for querying the water volume in 1000 m³.
- Requires the state sequence:
- class hydpy.models.sw1d.sw1d_model.Get_WaterLevel_V1[source]¶
Bases:
MethodInterface method for querying the water level in m.
- Requires the factor sequence:
- class hydpy.models.sw1d.sw1d_model.Get_Discharge_V1[source]¶
Bases:
MethodInterface method for querying the discharge in m³/s.
- Requires the state sequence:
- class hydpy.models.sw1d.sw1d_model.Get_DischargeVolume_V1[source]¶
Bases:
MethodInterface method for querying the discharge in m³.
- Requires the flux sequence:
- class hydpy.models.sw1d.sw1d_model.Get_MaxTimeStep_V1[source]¶
Bases:
MethodInterface method for querying the highest possible computation time step in s.
- Requires the factor sequence:
- class hydpy.models.sw1d.sw1d_model.Set_TimeStep_V1[source]¶
Bases:
MethodInterface method for setting the actual computation time step in s.
- Calculates the factor sequence:
- class hydpy.models.sw1d.sw1d_model.Get_PartialDischargeUpstream_V1[source]¶
Bases:
MethodReturn a partial discharge estimate suitable for a downstream model.
- Requires the state sequence:
- Basic equation:
\(PartialDischargeUpstream = Discharge_{server} \cdot \frac{|Discharge_{client}|}{\Sigma_{i=1}^{n_{downstream}} |Discharge_i|}\)
Examples:
If the client model (which is currently asking for the partial discharge) is the only downstream model,
Get_PartialDischargeUpstream_V1returns the total discharge without modification:>>> from hydpy import Element, Node, prepare_model, round_ >>> n01 = Node("n01", variable="LongQ") >>> e0 = Element("e0", outlets=n01) >>> e1a = Element("e1a", inlets=n01)
>>> c0 = prepare_model("sw1d_channel") >>> c0.parameters.control.nmbsegments(1) >>> with c0.add_routingmodel_v2("sw1d_lias", position=0, update=False) as r0: ... states.discharge = 5.0 >>> with c0.add_storagemodel_v1("sw1d_storage", position=0, update=False): ... pass >>> e0.model = c0
>>> c1a = prepare_model("sw1d_channel") >>> c1a.parameters.control.nmbsegments(1) >>> with c1a.add_routingmodel_v2("sw1d_lias", position=0, update=False) as r1a: ... states.discharge = 3.0 >>> with c1a.add_storagemodel_v1("sw1d_storage", position=0, update=False): ... pass >>> e1a.model = c1a
>>> network = c0.couple_models(nodes=[n01], elements=[e0, e1a]) >>> round_(r0.get_partialdischargeupstream_v1(3.0)) 5.0
For multiple downstream models, it returns the discharge portion that it attributes to the current client model:
>>> e1b = Element("e1b", inlets=n01) >>> c1b = prepare_model("sw1d_channel") >>> c1b.parameters.control.nmbsegments(1) >>> with c1b.add_routingmodel_v2("sw1d_lias", position=0, update=False) as r1b: ... states.discharge = 1.0 >>> with c1b.add_storagemodel_v1("sw1d_storage", position=0, update=False): ... pass >>> e1b.model = c1b
>>> network = c0.couple_models(nodes=[n01], elements=[e0, e1a, e1b]) >>> round_(r0.get_partialdischargeupstream_v1(3.0)) 3.75 >>> round_(r0.get_partialdischargeupstream_v1(1.0)) 1.25
To prevent zero divisions,
Get_PartialDischargeUpstream_V1returns zero if all downstream models’ (total) discharge is also zero:>>> r1a.sequences.states.discharge = 0.0 >>> r1b.sequences.states.discharge = 0.0 >>> round_(r0.get_partialdischargeupstream_v1(0.0)) 0.0
- class hydpy.models.sw1d.sw1d_model.Get_PartialDischargeDownstream_V1[source]¶
Bases:
MethodReturn a partial discharge estimate suitable for an upstream model.
- Requires the state sequence:
- Basic equation:
\(PartialDischargeDownstream = Discharge_{server} \cdot \frac{|Discharge_{client}|}{\Sigma_{i=1}^{n_{upstream}} |Discharge_i|}\)
Examples:
If the client model (which is currently asking for the partial discharge) is the only upstream model,
Get_PartialDischargeDownstream_V1returns the total discharge without modification:>>> from hydpy import Element, Node, prepare_model, round_ >>> n01 = Node("n01", variable="LongQ") >>> e1 = Element("e1", inlets=n01) >>> e0a = Element("e0a", outlets=n01)
>>> c1 = prepare_model("sw1d_channel") >>> c1.parameters.control.nmbsegments(1) >>> with c1.add_storagemodel_v1("sw1d_storage", position=0, update=False): ... pass >>> with c1.add_routingmodel_v2("sw1d_lias", position=1, update=False) as r1: ... states.discharge = 5.0 >>> e1.model = c1
>>> c0a = prepare_model("sw1d_channel") >>> c0a.parameters.control.nmbsegments(1) >>> with c0a.add_storagemodel_v1("sw1d_storage", position=0, update=False): ... pass >>> with c0a.add_routingmodel_v2("sw1d_lias", position=1, update=False) as r0a: ... states.discharge = 3.0 >>> e0a.model = c0a
>>> network = c1.couple_models(nodes=[n01], elements=[e1, e0a]) >>> round_(r1.get_partialdischargedownstream_v1(3.0)) 5.0
For multiple upstream models, it returns the discharge portion that it attributes to the current client model:
>>> e0b = Element("e0b", outlets=n01) >>> c0b = prepare_model("sw1d_channel") >>> c0b.parameters.control.nmbsegments(1) >>> with c0b.add_storagemodel_v1("sw1d_storage", position=0, update=False): ... pass >>> with c0b.add_routingmodel_v2("sw1d_lias", position=1, update=False) as r0b: ... states.discharge = 1.0 >>> e0b.model = c0b
>>> network = c1.couple_models(nodes=[n01], elements=[e1, e0a, e0b]) >>> round_(r1.get_partialdischargedownstream_v1(3.0)) 3.75 >>> round_(r1.get_partialdischargedownstream_v1(1.0)) 1.25
To prevent zero divisions,
Get_PartialDischargeDownstream_V1returns zero if all upstream models’ (total) discharge is also zero:>>> r0a.sequences.states.discharge = 0.0 >>> r0b.sequences.states.discharge = 0.0 >>> round_(r1.get_partialdischargedownstream_v1(0.0)) 0.0
- class hydpy.models.sw1d.sw1d_model.Update_Storage_V1[source]¶
Bases:
AutoMethodInterface method for updating the storage water content.
- Required submethods:
Calc_NetInflow_V1Update_WaterVolume_V1Calc_WaterDepth_WaterLevel_V1- Requires the control parameter:
- Requires the factor sequence:
- Requires the flux sequence:
- Updates the state sequence:
- Calculates the factor sequences:
- Calculates the flux sequence:
- class hydpy.models.sw1d.sw1d_model.Main_CrossSectionModel_V2[source]¶
Bases:
AdHocModelBase class for HydPy-SW1D models that use submodels named crosssection and comply with the
CrossSectionModel_V2interface.- crosssection: SubmodelProperty[CrossSectionModel_V2]¶
- crosssection_is_mainmodel¶
- crosssection_typeid¶
- add_crosssection_v2¶
Initialise the given submodel that follows the
CrossSectionModel_V1interface and is responsible for calculating discharge and related properties.>>> from hydpy.models.sw1d_storage import * >>> parameterstep() >>> with model.add_crosssection_v2("wq_trapeze"): ... nmbtrapezes(2) ... bottomlevels(1.0, 3.0) ... bottomwidths(2.0) ... sideslopes(2.0, 4.0)
>>> model.crosssection.parameters.control.nmbtrapezes nmbtrapezes(2) >>> model.crosssection.parameters.control.bottomlevels bottomlevels(1.0, 3.0)
- REUSABLE_METHODS: ClassVar[tuple[type[ReusableMethod], ...]] = ()¶
Parameter Features¶
Control parameters¶
- class hydpy.models.sw1d.ControlParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
SubParametersControl parameters of model sw1d.
- The following classes are selected:
Length()The length of a single channel segment [km].LengthUpstream()The upstream channel segment’s length [km].LengthDownstream()The downstream channel segment’s length [km].BottomLevel()The channel bottom elevation [m].StricklerCoefficient()The average Gauckler-Manning-Strickler coefficient [m^(1/3)/s].TimeStepFactor()A factor for reducing the estimated computation time step to increase numerical stability [-].DiffusionFactor()A factor for introducing numerical diffusion to increase numerical stability [-].DampingRadius()The radius of flow rate reductions around neuralgic water levels to prevent oscillations due to numerical inaccuracies [m].CrestHeight()The weir crest height [m].CrestWidth()The weir crest width [m].GateHeight()The gate lower edge’s height [m].GateWidth()The gate width [m].FlowCoefficient()The weir flow coefficient [-].TargetWaterLevel1()The lower target water level [m].TargetWaterLevel2()The upper target water level [m].BottomLowWaterThreshold()Water level below which gates are fully closed to stop drainage during low flow periods [m].UpperLowWaterThreshold()Water level below which gates are partly closed to reduce drainage during low flow periods [m].BottomHighWaterThreshold()Water level above which gate operation is partly sluice-like to increase drainage during high flow periods [m].UpperHighWaterThreshold()Water level above which gate operation is fully sluice-like to maximise drainage during high flow periods [m].Gradient2PumpingRate()An interpolation function describing the relationship between the water level height to be overcome and the maximum possible pumping rate [-].
- class hydpy.models.sw1d.sw1d_control.NmbSegments(subvars: SubParameters)[source]¶
Bases:
ParameterThe number of channel segments [-].
- class hydpy.models.sw1d.sw1d_control.Length(subvars: SubParameters)[source]¶
Bases:
ParameterThe length of a single channel segment [km].
- Required by the methods:
Calc_WaterDepth_WaterLevel_CrossSectionModel_V2Calc_WaterDepth_WaterLevel_V1Update_Storage_V1
- class hydpy.models.sw1d.sw1d_control.LengthUpstream(subvars: SubParameters)[source]¶
Bases:
ParameterThe upstream channel segment’s length [km].
- class hydpy.models.sw1d.sw1d_control.LengthDownstream(subvars: SubParameters)[source]¶
Bases:
ParameterThe downstream channel segment’s length [km].
- Required by the methods:
- class hydpy.models.sw1d.sw1d_control.BottomLevel(subvars: SubParameters)[source]¶
Bases:
ParameterThe channel bottom elevation [m].
- Required by the methods:
Calc_Discharge_V3Calc_MaxTimeStep_V5Determine_Discharge_V6Determine_MaxTimeStep_V5
- class hydpy.models.sw1d.sw1d_control.StricklerCoefficient(subvars: SubParameters)[source]¶
Bases:
ParameterThe average Gauckler-Manning-Strickler coefficient [m^(1/3)/s].
- Required by the methods:
Calc_Discharge_V1Determine_Discharge_V1Determine_Discharge_V5
The higher the coefficient’s value, the higher the calculated discharge. Typical values range from 20 to 80.
- class hydpy.models.sw1d.sw1d_control.TimeStepFactor(subvars: SubParameters)[source]¶
Bases:
ParameterA factor for reducing the estimated computation time step to increase numerical stability [-].
- class hydpy.models.sw1d.sw1d_control.DiffusionFactor(subvars: SubParameters)[source]¶
Bases:
ParameterA factor for introducing numerical diffusion to increase numerical stability [-].
- Required by the methods:
Calc_Discharge_V1Determine_Discharge_V1Determine_Discharge_V5
- class hydpy.models.sw1d.sw1d_control.DampingRadius(subvars: SubParameters)[source]¶
Bases:
ParameterThe radius of flow rate reductions around neuralgic water levels to prevent oscillations due to numerical inaccuracies [m].
- Required by the methods:
For a value of zero, the radius of action is zero, with no modification of the target equation and, thus, no artificial damping.
- class hydpy.models.sw1d.sw1d_control.CrestHeight(subvars: SubParameters)[source]¶
Bases:
ParameterThe weir crest height [m].
- Required by the methods:
Calc_Discharge_V2Calc_MaxTimeStep_V3Determine_Discharge_V3Determine_MaxTimeStep_V3
- class hydpy.models.sw1d.sw1d_control.CrestWidth(subvars: SubParameters)[source]¶
Bases:
ParameterThe weir crest width [m].
- Required by the methods:
- class hydpy.models.sw1d.sw1d_control.GateHeight(subvars: SubParameters)[source]¶
Bases:
CallbackParameterThe gate lower edge’s height [m].
- Required by the methods:
Calc_Discharge_V3Calc_MaxTimeStep_V5Determine_Discharge_V6Determine_MaxTimeStep_V5
Parameter
GateHeightoffers the possibility of assigning a callback function for calculating variable gate heights instead of setting a fixed one. See theCalc_Discharge_V3documentation for further information.
- class hydpy.models.sw1d.sw1d_control.GateWidth(subvars: SubParameters)[source]¶
Bases:
ParameterThe gate width [m].
- Required by the methods:
- class hydpy.models.sw1d.sw1d_control.FlowCoefficient(subvars: SubParameters)[source]¶
Bases:
ParameterThe weir flow coefficient [-].
- class hydpy.models.sw1d.sw1d_control.TargetWaterLevel1(subvars: SubParameters)[source]¶
Bases:
ParameterThe lower target water level [m].
- Required by the methods:
- trim(lower=None, upper=None) bool[source]¶
Trim
TargetWaterLevel1following \(TargetWaterLevel1 \leq TargetWaterLevel2\).>>> from hydpy.models.sw1d import * >>> parameterstep() >>> targetwaterlevel2(2.0) >>> targetwaterlevel1(3.0) >>> targetwaterlevel1 targetwaterlevel1(2.0)
- class hydpy.models.sw1d.sw1d_control.TargetWaterLevel2(subvars: SubParameters)[source]¶
Bases:
ParameterThe upper target water level [m].
- Required by the methods:
- trim(lower=None, upper=None) bool[source]¶
Trim
TargetWaterLevel2following \(TargetWaterLevel1 \leq TargetWaterLevel2\).>>> from hydpy.models.sw1d import * >>> parameterstep() >>> targetwaterlevel1(2.0) >>> targetwaterlevel2(1.0) >>> targetwaterlevel2 targetwaterlevel2(2.0)
- class hydpy.models.sw1d.sw1d_control.BottomLowWaterThreshold(subvars)[source]¶
Bases:
SeasonalParameterWater level below which gates are fully closed to stop drainage during low flow periods [m].
- Required by the methods:
- trim(lower=None, upper=None) bool[source]¶
Trim
BottomLowWaterThresholdfollowing \(BottomLowWaterThreshold \leq UpperLowWaterThreshold\) and \(BottomLowWaterThreshold \leq BottomHighWaterThreshold\) and \(BottomLowWaterThreshold \leq UpperHighWaterThreshold\).>>> from hydpy import pub, round_ >>> pub.timegrids = "2000-01-01", "2000-01-06", "1d" >>> from hydpy.models.sw1d import * >>> parameterstep() >>> bottomlowwaterthreshold(2.0) >>> bottomlowwaterthreshold bottomlowwaterthreshold(2.0)
>>> upperlowwaterthreshold.shape = 1 >>> upperlowwaterthreshold.values[:5] = 1.0, 2.0, 3.0, 4.0, 5.0 >>> bottomhighwaterthreshold.shape = 1 >>> bottomhighwaterthreshold.values[:5] = 5.0, 4.0, 3.0, 2.0, 1.0 >>> upperhighwaterthreshold.shape = 1 >>> upperhighwaterthreshold.values[:5] = 3.0, 2.0, 1.0, 2.0, 3.0 >>> bottomlowwaterthreshold(2.0) >>> round_(bottomlowwaterthreshold.values[:5]) 1.0, 2.0, 1.0, 2.0, 1.0 >>> from hydpy.core.testtools import warn_later >>> with pub.options.warntrim(True), warn_later(): ... bottomlowwaterthreshold bottomlowwaterthreshold(2.0) UserWarning: The "background values" of parameter `bottomlowwaterthreshold` of element `?` have been trimmed but not its original time of year-specific values. Using the latter without modification might result in inconsistencies.
- class hydpy.models.sw1d.sw1d_control.UpperLowWaterThreshold(subvars)[source]¶
Bases:
SeasonalParameterWater level below which gates are partly closed to reduce drainage during low flow periods [m].
- Required by the methods:
- trim(lower=None, upper=None) bool[source]¶
Trim
UpperLowWaterThresholdfollowing \(UpperLowWaterThreshold \geq BottomLowWaterThreshold\) and \(UpperLowWaterThreshold \leq UpperHighWaterThreshold\).>>> from hydpy import pub, round_ >>> pub.timegrids = "2000-01-01", "2000-01-06", "1d" >>> from hydpy.models.sw1d import * >>> parameterstep() >>> upperlowwaterthreshold(4.0) >>> upperlowwaterthreshold upperlowwaterthreshold(4.0)
>>> bottomlowwaterthreshold.shape = 1 >>> bottomlowwaterthreshold.values[:5] = 1.0, 2.0, 3.0, 4.0, 5.0 >>> upperhighwaterthreshold.shape = 1 >>> upperhighwaterthreshold.values[:5] = 3.0, 4.0, 5.0, 6.0, 7.0 >>> upperlowwaterthreshold(4.0) >>> round_(upperlowwaterthreshold.values[:5]) 3.0, 4.0, 4.0, 4.0, 5.0 >>> from hydpy.core.testtools import warn_later >>> with pub.options.warntrim(True), warn_later(): ... upperlowwaterthreshold upperlowwaterthreshold(4.0) UserWarning: The "background values" of parameter `upperlowwaterthreshold` of element `?` have been trimmed but not its original time of year-specific values. Using the latter without modification might result in inconsistencies.
- class hydpy.models.sw1d.sw1d_control.BottomHighWaterThreshold(subvars)[source]¶
Bases:
SeasonalParameterWater level above which gate operation is partly sluice-like to increase drainage during high flow periods [m].
- Required by the methods:
- trim(lower=None, upper=None) bool[source]¶
Trim
BottomHighWaterThresholdfollowing \(BottomHighWaterThreshold \geq BottomLowWaterThreshold\) and \(BottomHighWaterThreshold \leq UpperHighWaterThreshold\).>>> from hydpy import pub, round_ >>> pub.timegrids = "2000-01-01", "2000-01-06", "1d" >>> from hydpy.models.sw1d import * >>> parameterstep() >>> bottomhighwaterthreshold(4.0) >>> bottomhighwaterthreshold bottomhighwaterthreshold(4.0)
>>> bottomlowwaterthreshold.shape = 1 >>> bottomlowwaterthreshold.values[:5] = 1.0, 2.0, 3.0, 4.0, 5.0 >>> upperhighwaterthreshold.shape = 1 >>> upperhighwaterthreshold.values[:5] = 3.0, 4.0, 5.0, 6.0, 7.0 >>> bottomhighwaterthreshold(4.0) >>> round_(bottomhighwaterthreshold.values[:5]) 3.0, 4.0, 4.0, 4.0, 5.0 >>> from hydpy.core.testtools import warn_later >>> with pub.options.warntrim(True), warn_later(): ... bottomhighwaterthreshold bottomhighwaterthreshold(4.0) UserWarning: The "background values" of parameter `bottomhighwaterthreshold` of element `?` have been trimmed but not its original time of year-specific values. Using the latter without modification might result in inconsistencies.
- class hydpy.models.sw1d.sw1d_control.UpperHighWaterThreshold(subvars)[source]¶
Bases:
SeasonalParameterWater level above which gate operation is fully sluice-like to maximise drainage during high flow periods [m].
- Required by the methods:
- trim(lower=None, upper=None) bool[source]¶
Trim
UpperHighWaterThresholdfollowing \(UpperHighWaterThreshold \geq BottomLowWaterThreshold\) and \(UpperHighWaterThreshold \geq UpperLowWaterThreshold\) and \(UpperHighWaterThreshold \geq BottomHighWaterThreshold\).>>> from hydpy import pub, round_ >>> pub.timegrids = "2000-01-01", "2000-01-06", "1d" >>> from hydpy.models.sw1d import * >>> parameterstep() >>> upperhighwaterthreshold(4.0) >>> upperhighwaterthreshold upperhighwaterthreshold(4.0)
>>> bottomlowwaterthreshold.shape = 1 >>> bottomlowwaterthreshold.values[:5] = 1.0, 2.0, 3.0, 4.0, 5.0 >>> upperlowwaterthreshold.shape = 1 >>> upperlowwaterthreshold.values[:5] = 5.0, 4.0, 3.0, 2.0, 1.0 >>> bottomhighwaterthreshold.shape = 1 >>> bottomhighwaterthreshold.values[:5] = 3.0, 4.0, 5.0, 4.0, 3.0 >>> upperhighwaterthreshold(4.0) >>> round_(upperhighwaterthreshold.values[:5]) 5.0, 4.0, 5.0, 4.0, 5.0 >>> from hydpy.core.testtools import warn_later >>> with pub.options.warntrim(True), warn_later(): ... upperhighwaterthreshold upperhighwaterthreshold(4.0) UserWarning: The "background values" of parameter `upperhighwaterthreshold` of element `?` have been trimmed but not its original time of year-specific values. Using the latter without modification might result in inconsistencies.
- class hydpy.models.sw1d.sw1d_control.Gradient2PumpingRate(subvars: SubParameters)[source]¶
Bases:
SimpleInterpolatorAn interpolation function describing the relationship between the water level height to be overcome and the maximum possible pumping rate [-].
- Required by the methods:
- XLABEL = 'water level gradient [m]'¶
- YLABEL = 'maximum pumping rate [m³/s]'¶
Derived parameters¶
- class hydpy.models.sw1d.DerivedParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
SubParametersDerived parameters of model sw1d.
- The following classes are selected:
Seconds()The length of the actual simulation step size in seconds [s].TOY()References thetimeofyearindex array provided by the instance of classIndexeravailable in modulepub[-].WeightUpstream()A weighting coefficient for interpolating the water level from the centroids of two adjacent segments to their shared edge [-].LengthMin()The minimum length of the segments upstream and downstream of the relevant routing model [km].LengthMean()The mean length of the segments upstream and downstream of the relevant routing model [km].
- class hydpy.models.sw1d.sw1d_derived.Seconds(subvars: SubParameters)[source]¶
Bases:
SecondsParameterThe length of the actual simulation step size in seconds [s].
- Required by the methods:
Calc_DischargeVolume_V1Calc_DischargeVolume_V2Calc_Discharges_V2Pass_Discharge_V1
- class hydpy.models.sw1d.sw1d_derived.TOY(subvars: SubParameters)[source]¶
Bases:
TOYParameterReferences the
timeofyearindex array provided by the instance of classIndexeravailable in modulepub[-].- Required by the methods:
- class hydpy.models.sw1d.sw1d_derived.WeightUpstream(subvars: SubParameters)[source]¶
Bases:
ParameterA weighting coefficient for interpolating the water level from the centroids of two adjacent segments to their shared edge [-].
- Required by the methods:
Calc_WaterLevel_V1Determine_MaxTimeStep_V1Determine_MaxTimeStep_V6
- update() None[source]¶
Update the value according to \(WeightUpstream = LengthDownstream / (LengthUpstream + LengthDownstream)\).
>>> from hydpy.models.sw1d import * >>> parameterstep() >>> lengthupstream(1.0) >>> lengthdownstream(3.0) >>> derived.weightupstream.update() >>> derived.weightupstream weightupstream(0.75)
- class hydpy.models.sw1d.sw1d_derived.LengthMin(subvars: SubParameters)[source]¶
Bases:
ParameterThe minimum length of the segments upstream and downstream of the relevant routing model [km].
- Required by the methods:
Calc_MaxTimeStep_V1Calc_MaxTimeStep_V6Determine_MaxTimeStep_V1Determine_MaxTimeStep_V6
- update() None[source]¶
Take the minimum of
LengthUpstreamandLengthDownstream.>>> from hydpy.models.sw1d import * >>> parameterstep() >>> lengthupstream(2.0) >>> lengthdownstream(4.0) >>> derived.lengthmin.update() >>> derived.lengthmin lengthmin(2.0)
- class hydpy.models.sw1d.sw1d_derived.LengthMean(subvars: SubParameters)[source]¶
Bases:
ParameterThe mean length of the segments upstream and downstream of the relevant routing model [km].
- Required by the methods:
Calc_Discharge_V1Determine_Discharge_V1Determine_Discharge_V5
- update() None[source]¶
Take the mean of
LengthUpstreamandLengthDownstream.>>> from hydpy.models.sw1d import * >>> parameterstep() >>> lengthupstream(2.0) >>> lengthdownstream(4.0) >>> derived.lengthmean.update() >>> derived.lengthmean lengthmean(3.0)
Fixed parameters¶
- class hydpy.models.sw1d.FixedParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
SubParametersFixed parameters of model sw1d.
- The following classes are selected:
GravitationalAcceleration()Gravitational acceleration [m/s²].
- class hydpy.models.sw1d.sw1d_fixed.GravitationalAcceleration(subvars: SubParameters)[source]¶
Bases:
FixedParameterGravitational acceleration [m/s²].
- Required by the methods:
Calc_Discharge_V1Calc_Discharge_V2Calc_Discharge_V3Calc_MaxTimeStep_V1Calc_MaxTimeStep_V3Calc_MaxTimeStep_V5Determine_Discharge_V1Determine_Discharge_V3Determine_Discharge_V5Determine_Discharge_V6Determine_MaxTimeStep_V1Determine_MaxTimeStep_V3Determine_MaxTimeStep_V5
Sequence Features¶
Factor sequences¶
- class hydpy.models.sw1d.FactorSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
FactorSequencesFactor sequences of model sw1d.
- The following classes are selected:
MaxTimeStep()The highest possible computation time step according to local stability considerations [s].TimeStep()The actual computation step according to global stability considerations [s].WaterDepth()Water depth [m].WaterLevel()Water level [m].WaterLevels()The water level within all segments of a channel [m].WaterLevelUpstream()The upstream channel segment’s water level [m].WaterLevelDownstream()The downstream channel segment’s water level [m].WaterVolumeUpstream()The upstream channel segment’s water volume [1000 m³].WaterVolumeDownstream()The downstream channel segment’s water volume [1000 m³].WettedArea()The channel wetted area [m²].WettedPerimeter()The channel wetted perimeter [m].
- class hydpy.models.sw1d.sw1d_factors.MaxTimeStep(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FactorSequenceThe highest possible computation time step according to local stability considerations [s].
- Calculated by the methods:
Calc_MaxTimeStep_V1Calc_MaxTimeStep_V2Calc_MaxTimeStep_V3Calc_MaxTimeStep_V4Calc_MaxTimeStep_V5Calc_MaxTimeStep_V6Determine_MaxTimeStep_V1Determine_MaxTimeStep_V2Determine_MaxTimeStep_V3Determine_MaxTimeStep_V4Determine_MaxTimeStep_V5Determine_MaxTimeStep_V6- Required by the method:
- class hydpy.models.sw1d.sw1d_factors.TimeStep(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FactorSequenceThe actual computation step according to global stability considerations [s].
- Calculated by the methods:
- Required by the methods:
Calc_Discharge_V1Calc_NetInflow_V1Determine_Discharge_V1Determine_Discharge_V3Determine_Discharge_V5Determine_Discharge_V6Determine_Discharge_V7Send_TimeStep_V1Update_DischargeVolume_V1Update_Discharge_V1Update_Storage_V1
- class hydpy.models.sw1d.sw1d_factors.WaterDepth(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FactorSequenceWater depth [m].
- Calculated by the methods:
Calc_WaterDepth_WaterLevel_CrossSectionModel_V2Calc_WaterDepth_WaterLevel_V1Calc_WaterDepth_WettedArea_CrossSectionModel_V2Calc_WaterDepth_WettedArea_V1Calc_WaterDepth_WettedArea_WettedPerimeter_CrossSectionModel_V2Calc_WaterDepth_WettedArea_WettedPerimeter_V1Determine_MaxTimeStep_V1Determine_MaxTimeStep_V2Determine_MaxTimeStep_V4Determine_MaxTimeStep_V6Update_Storage_V1- Required by the method:
Difference between the elevations of the water surface and the channel bottom.
- class hydpy.models.sw1d.sw1d_factors.WaterLevel(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FactorSequenceWater level [m].
- Calculated by the methods:
Calc_WaterDepth_WaterLevel_CrossSectionModel_V2Calc_WaterDepth_WaterLevel_V1Calc_WaterLevel_V1Calc_WaterLevel_V2Calc_WaterLevel_V3Calc_WaterLevel_V4Determine_Discharge_V7Determine_MaxTimeStep_V1Determine_MaxTimeStep_V2Determine_MaxTimeStep_V3Determine_MaxTimeStep_V4Determine_MaxTimeStep_V5Determine_MaxTimeStep_V6Update_Storage_V1- Required by the methods:
Calc_Discharge_V2Calc_Discharge_V3Calc_MaxTimeStep_V3Calc_MaxTimeStep_V5Calc_WaterDepth_WettedArea_CrossSectionModel_V2Calc_WaterDepth_WettedArea_V1Calc_WaterDepth_WettedArea_WettedPerimeter_CrossSectionModel_V2Calc_WaterDepth_WettedArea_WettedPerimeter_V1Determine_Discharge_V3Determine_Discharge_V6Get_WaterLevel_V1Pass_WaterLevel_V1
The sum of the channel’s bottom elevation and water depth.
- class hydpy.models.sw1d.sw1d_factors.WaterLevels(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FactorSequenceThe water level within all segments of a channel [m].
- Calculated by the method:
- class hydpy.models.sw1d.sw1d_factors.WaterLevelUpstream(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FactorSequenceThe upstream channel segment’s water level [m].
- Calculated by the methods:
Calc_WaterLevelUpstream_V1Determine_MaxTimeStep_V1Determine_MaxTimeStep_V3Determine_MaxTimeStep_V4Determine_MaxTimeStep_V5Determine_MaxTimeStep_V6- Required by the methods:
Calc_Discharge_V1Calc_Discharge_V3Calc_Discharge_V4Calc_MaxTimeStep_V5Calc_WaterLevel_V1Calc_WaterLevel_V3Calc_WaterLevel_V4Determine_Discharge_V1Determine_Discharge_V5Determine_Discharge_V6Determine_Discharge_V7Update_Discharge_V2
- class hydpy.models.sw1d.sw1d_factors.WaterLevelDownstream(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FactorSequenceThe downstream channel segment’s water level [m].
- Calculated by the methods:
Calc_WaterLevelDownstream_V1Determine_MaxTimeStep_V1Determine_MaxTimeStep_V2Determine_MaxTimeStep_V6Pick_WaterLevelDownstream_V1- Required by the methods:
Calc_Discharge_V1Calc_Discharge_V3Calc_Discharge_V4Calc_MaxTimeStep_V5Calc_WaterLevel_V1Calc_WaterLevel_V2Calc_WaterLevel_V4Determine_Discharge_V1Determine_Discharge_V5Determine_Discharge_V6Determine_Discharge_V7Determine_MaxTimeStep_V5Update_Discharge_V2
- class hydpy.models.sw1d.sw1d_factors.WaterVolumeUpstream(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FactorSequenceThe upstream channel segment’s water volume [1000 m³].
- Calculated by the methods:
Calc_WaterVolumeUpstream_V1Determine_Discharge_V1Determine_Discharge_V5- Required by the method:
- class hydpy.models.sw1d.sw1d_factors.WaterVolumeDownstream(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FactorSequenceThe downstream channel segment’s water volume [1000 m³].
- Calculated by the methods:
Calc_WaterVolumeDownstream_V1Determine_Discharge_V1Determine_Discharge_V5- Required by the method:
- class hydpy.models.sw1d.sw1d_factors.WettedArea(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FactorSequenceThe channel wetted area [m²].
- Calculated by the methods:
Calc_WaterDepth_WettedArea_CrossSectionModel_V2Calc_WaterDepth_WettedArea_V1Calc_WaterDepth_WettedArea_WettedPerimeter_CrossSectionModel_V2Calc_WaterDepth_WettedArea_WettedPerimeter_V1Determine_MaxTimeStep_V1Determine_MaxTimeStep_V2Determine_MaxTimeStep_V4Determine_MaxTimeStep_V6- Required by the methods:
Calc_Discharge_V1Calc_MaxTimeStep_V2Calc_MaxTimeStep_V4Calc_MaxTimeStep_V6Determine_Discharge_V1Determine_Discharge_V5
- class hydpy.models.sw1d.sw1d_factors.WettedPerimeter(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FactorSequenceThe channel wetted perimeter [m].
- Calculated by the methods:
Calc_WaterDepth_WettedArea_WettedPerimeter_CrossSectionModel_V2Calc_WaterDepth_WettedArea_WettedPerimeter_V1Determine_MaxTimeStep_V1- Required by the methods:
Calc_Discharge_V1Determine_Discharge_V1Determine_Discharge_V5
Flux sequences¶
- class hydpy.models.sw1d.FluxSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
FluxSequencesFlux sequences of model sw1d.
- The following classes are selected:
Inflow()Longitudinal flow into the first channel segment [m³/s].Outflow()Longitudinal flow out of the last channel segment [m³/s].LateralFlow()Lateral flow into the first channel segment [m³/s].NetInflow()The net inflow into a channel segment [m³/T].DischargeUpstream()The summed (partial) of all upstream routing models [m³/s].DischargeDownstream()The summed (partial) of all downstream routing models [m³/s].DischargeVolume()The total amount of discharge of a simulation step [m³/T].Discharges()The discharges between all channel segments, including the flow into the first and out of the last one [m³/s].
- class hydpy.models.sw1d.sw1d_fluxes.Inflow(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FluxSequenceLongitudinal flow into the first channel segment [m³/s].
- Calculated by the method:
- Required by the methods:
Calc_DischargeVolume_V1Calc_MaxTimeStep_V2Determine_Discharge_V2Determine_MaxTimeStep_V2
- class hydpy.models.sw1d.sw1d_fluxes.Outflow(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FluxSequenceLongitudinal flow out of the last channel segment [m³/s].
- Calculated by the method:
- Required by the methods:
Calc_DischargeVolume_V2Calc_MaxTimeStep_V4Determine_Discharge_V4Determine_MaxTimeStep_V4
- class hydpy.models.sw1d.sw1d_fluxes.LateralFlow(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FluxSequenceLateral flow into the first channel segment [m³/s].
- Calculated by the method:
- Required by the methods:
- class hydpy.models.sw1d.sw1d_fluxes.NetInflow(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FluxSequenceThe net inflow into a channel segment [m³/T].
- Calculated by the methods:
- Required by the method:
- class hydpy.models.sw1d.sw1d_fluxes.DischargeUpstream(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FluxSequenceThe summed (partial) of all upstream routing models [m³/s].
- Calculated by the methods:
- Required by the methods:
Calc_Discharge_V1Determine_Discharge_V1Determine_Discharge_V5
- class hydpy.models.sw1d.sw1d_fluxes.DischargeDownstream(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FluxSequenceThe summed (partial) of all downstream routing models [m³/s].
- Calculated by the methods:
- Required by the methods:
Calc_Discharge_V1Determine_Discharge_V1Determine_Discharge_V5
- class hydpy.models.sw1d.sw1d_fluxes.DischargeVolume(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FluxSequenceThe total amount of discharge of a simulation step [m³/T].
- Calculated by the method:
- Updated by the methods:
Calc_DischargeVolume_V1Calc_DischargeVolume_V2Determine_Discharge_V1Determine_Discharge_V3Determine_Discharge_V5Determine_Discharge_V6Determine_Discharge_V7Update_DischargeVolume_V1- Required by the methods:
- class hydpy.models.sw1d.sw1d_fluxes.Discharges(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FluxSequenceThe discharges between all channel segments, including the flow into the first and out of the last one [m³/s].
- Calculated by the method:
- PLUS = 1¶
State sequences¶
- class hydpy.models.sw1d.StateSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
StateSequencesState sequences of model sw1d.
- The following classes are selected:
WaterVolume()Water volume [1000 m³].Discharge()Discharge [m³/s].
- class hydpy.models.sw1d.sw1d_states.WaterVolume(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
StateSequenceWater volume [1000 m³].
- Updated by the methods:
- Required by the methods:
Calc_WaterDepth_WaterLevel_CrossSectionModel_V2Calc_WaterDepth_WaterLevel_V1Get_WaterVolume_V1
Note that the water volume stored in a channel segment might be slightly negative due to numerical inaccuracies (see ref:sw1d_channel_internal_negative_volumes) or even vastly negative due to erroneous data or configurations (see Excessive water withdrawal).
- class hydpy.models.sw1d.sw1d_states.Discharge(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
StateSequenceDischarge [m³/s].
- Updated by the methods:
Calc_Discharge_V1Calc_Discharge_V2Calc_Discharge_V3Calc_Discharge_V4Determine_Discharge_V1Determine_Discharge_V2Determine_Discharge_V3Determine_Discharge_V4Determine_Discharge_V5Determine_Discharge_V6Determine_Discharge_V7Update_Discharge_V1Update_Discharge_V2- Required by the methods:
Calc_DischargeDownstream_V1Calc_DischargeUpstream_V1Calc_MaxTimeStep_V6Determine_MaxTimeStep_V1Determine_MaxTimeStep_V6Get_Discharge_V1Get_PartialDischargeDownstream_V1Get_PartialDischargeUpstream_V1Update_DischargeVolume_V1
Inlet sequences¶
- class hydpy.models.sw1d.InletSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
InletSequencesInlet sequences of model sw1d.
- The following classes are selected:
LongQ()The longitudinal inflow into the first channel segment [m³/s].LatQ()The lateral inflow into the first channel segment [m³/s].WaterLevel()Water level [m].
- class hydpy.models.sw1d.sw1d_inlets.LongQ(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
InletSequenceThe longitudinal inflow into the first channel segment [m³/s].
- Required by the methods:
- class hydpy.models.sw1d.sw1d_inlets.LatQ(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
InletSequenceThe lateral inflow into the first channel segment [m³/s].
- Required by the method:
- class hydpy.models.sw1d.sw1d_inlets.WaterLevel(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
InletSequenceWater level [m].
- Required by the method:
Outlet sequences¶
- class hydpy.models.sw1d.OutletSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
OutletSequencesOutlet sequences of model sw1d.
- The following classes are selected:
LongQ()The longitudinal outflow of the last channel segment [m³/s].
- class hydpy.models.sw1d.sw1d_outlets.LongQ(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
OutletSequenceThe longitudinal outflow of the last channel segment [m³/s].
- Calculated by the method:
Sender sequences¶
- class hydpy.models.sw1d.SenderSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
SenderSequencesSender sequences of model sw1d.
- The following classes are selected:
WaterLevel()The water level within the first channel segment [m].
- class hydpy.models.sw1d.sw1d_senders.WaterLevel(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
SenderSequenceThe water level within the first channel segment [m].
- Calculated by the method:
- class hydpy.models.sw1d.ControlParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
SubParametersControl parameters of model sw1d.
- The following classes are selected:
Length()The length of a single channel segment [km].LengthUpstream()The upstream channel segment’s length [km].LengthDownstream()The downstream channel segment’s length [km].BottomLevel()The channel bottom elevation [m].StricklerCoefficient()The average Gauckler-Manning-Strickler coefficient [m^(1/3)/s].TimeStepFactor()A factor for reducing the estimated computation time step to increase numerical stability [-].DiffusionFactor()A factor for introducing numerical diffusion to increase numerical stability [-].DampingRadius()The radius of flow rate reductions around neuralgic water levels to prevent oscillations due to numerical inaccuracies [m].CrestHeight()The weir crest height [m].CrestWidth()The weir crest width [m].GateHeight()The gate lower edge’s height [m].GateWidth()The gate width [m].FlowCoefficient()The weir flow coefficient [-].TargetWaterLevel1()The lower target water level [m].TargetWaterLevel2()The upper target water level [m].BottomLowWaterThreshold()Water level below which gates are fully closed to stop drainage during low flow periods [m].UpperLowWaterThreshold()Water level below which gates are partly closed to reduce drainage during low flow periods [m].BottomHighWaterThreshold()Water level above which gate operation is partly sluice-like to increase drainage during high flow periods [m].UpperHighWaterThreshold()Water level above which gate operation is fully sluice-like to maximise drainage during high flow periods [m].Gradient2PumpingRate()An interpolation function describing the relationship between the water level height to be overcome and the maximum possible pumping rate [-].
- class hydpy.models.sw1d.DerivedParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
SubParametersDerived parameters of model sw1d.
- The following classes are selected:
Seconds()The length of the actual simulation step size in seconds [s].TOY()References thetimeofyearindex array provided by the instance of classIndexeravailable in modulepub[-].WeightUpstream()A weighting coefficient for interpolating the water level from the centroids of two adjacent segments to their shared edge [-].LengthMin()The minimum length of the segments upstream and downstream of the relevant routing model [km].LengthMean()The mean length of the segments upstream and downstream of the relevant routing model [km].
- class hydpy.models.sw1d.FactorSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
FactorSequencesFactor sequences of model sw1d.
- The following classes are selected:
MaxTimeStep()The highest possible computation time step according to local stability considerations [s].TimeStep()The actual computation step according to global stability considerations [s].WaterDepth()Water depth [m].WaterLevel()Water level [m].WaterLevels()The water level within all segments of a channel [m].WaterLevelUpstream()The upstream channel segment’s water level [m].WaterLevelDownstream()The downstream channel segment’s water level [m].WaterVolumeUpstream()The upstream channel segment’s water volume [1000 m³].WaterVolumeDownstream()The downstream channel segment’s water volume [1000 m³].WettedArea()The channel wetted area [m²].WettedPerimeter()The channel wetted perimeter [m].
- class hydpy.models.sw1d.FixedParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
SubParametersFixed parameters of model sw1d.
- The following classes are selected:
GravitationalAcceleration()Gravitational acceleration [m/s²].
- class hydpy.models.sw1d.FluxSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
FluxSequencesFlux sequences of model sw1d.
- The following classes are selected:
Inflow()Longitudinal flow into the first channel segment [m³/s].Outflow()Longitudinal flow out of the last channel segment [m³/s].LateralFlow()Lateral flow into the first channel segment [m³/s].NetInflow()The net inflow into a channel segment [m³/T].DischargeUpstream()The summed (partial) of all upstream routing models [m³/s].DischargeDownstream()The summed (partial) of all downstream routing models [m³/s].DischargeVolume()The total amount of discharge of a simulation step [m³/T].Discharges()The discharges between all channel segments, including the flow into the first and out of the last one [m³/s].
- class hydpy.models.sw1d.InletSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
InletSequencesInlet sequences of model sw1d.
- The following classes are selected:
LongQ()The longitudinal inflow into the first channel segment [m³/s].LatQ()The lateral inflow into the first channel segment [m³/s].WaterLevel()Water level [m].
- class hydpy.models.sw1d.OutletSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
OutletSequencesOutlet sequences of model sw1d.
- The following classes are selected:
LongQ()The longitudinal outflow of the last channel segment [m³/s].
- class hydpy.models.sw1d.SenderSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
SenderSequencesSender sequences of model sw1d.
- The following classes are selected:
WaterLevel()The water level within the first channel segment [m].
- class hydpy.models.sw1d.StateSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
StateSequencesState sequences of model sw1d.
- The following classes are selected:
WaterVolume()Water volume [1000 m³].Discharge()Discharge [m³/s].