transferinterfaces¶
This module defines submodel interfaces for calculating water transfers into or out of main models like those of the HydPy-Dam model family.
Module transferinterfaces implements the following members:
TransferModel_V1Interface for calculating water transfers based on the main model’s current water volume and allowed discharge.
- class hydpy.interfaces.transferinterfaces.TransferModel_V1[source]¶
Bases:
SubmodelInterface,ABCInterface for calculating water transfers based on the main model’s current water volume and allowed discharge.
TransferModel_V1separates determining, querying, and setting the water transfer. This allows coupling with numerically solved main models likedam_llake, which let the submodel determine the transfer for multiple intermediate states within one simulation step (viadetermine_transfer()) and query the results (viaget_transfer()). At the end of the simulation step, the main model passes the step-averaged transfer back (viaset_transfer()), so the submodel can process the final value further, for example, by passing it to an outlet node.- typeid: ClassVar[Literal[1]] = 1¶
Type identifier for
TransferModel_V1submodels.
- determine_transfer(watervolume: float, alloweddischarge: float) None[source]¶
Determine the water transfer based on the water volume (million m³) and the highest discharge (m³/s) the main model can currently lose.
- get_transfer() float[source]¶
Return the water transfer in m³/s determined by the last call of
determine_transfer().Positive values indicate withdrawals; negative values indicate supplies.