Next Article in Journal
Novel Cosmic Ray Neutron Sensor Accurately Captures Field-Scale Soil Moisture Trends under Heterogeneous Soil Textures
Previous Article in Journal
Effects of Biochar Addition on Rill Flow Resistance
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

WRSS: An Object-Oriented R Package for Large-Scale Water Resources Operation

1
Unit of Environmental Engineering, Department of Infrastructure Engineering, Faculty of Engineering Sciences, University of Innsbruck, Technikerstrasse 13, 6020 Innsbruck, Austria
2
Department of Water Science and Engineering, University of Kurdistan, Sanandaj 66177-15175, Iran
*
Author to whom correspondence should be addressed.
Water 2021, 13(21), 3037; https://doi.org/10.3390/w13213037
Submission received: 21 September 2021 / Revised: 22 October 2021 / Accepted: 26 October 2021 / Published: 30 October 2021
(This article belongs to the Section Water Resources Management, Policy and Governance)

Abstract

:
Water resources systems, as facilities for storing water and supplying demands, have been critically important due to their operational requirements. This paper presents the applications of an R package in a large-scale water resources operation. The WRSS (Water Resources System Simulator) is an object-oriented open-source package for the modeling and simulation of water resources systems based on Standard Operation Policy (SOP). The package provides R users several functions and methods to build water supply and energy models, manipulate their components, create scenarios, and publish and visualize the results. WRSS is capable of incorporating various components of a complex supply–demand system, including numerous reservoirs, aquifers, diversions, rivers, junctions, and demand nodes, as well as hydropower analysis, which have not been presented in any other R packages. For the WRSS’s development, a novel coding system was devised, allowing the water resources components to interact with one another by transferring the mass in terms of seepage, leakage, spillage, and return-flow. With regard to the running time, as a key factor in complex models, WRSS outshone the existing commercial tools such as the Water Evaluation and Planning System (WEAP) significantly by reducing the processing time by 50 times for a single unit reservoir. Additionally, the WRSS was successfully applied to a large-scale water resources system comprising of 5 medium- to large-size dams with 11 demand nodes. The results suggested dams with larger capacity sizes may meet agriculture sector demand but smaller capacities to fulfill environmental water requirement. Additionally, large-scale approach modeling in the operation of one of the studied dams indicated its implication on the reservoirs supply resiliency by increasing 10 percent of inflow compared with single unit operation.

1. Introduction

Global concerns about water security have increasingly tackled the importance of water management and the operation efficiency of hydro resources. This could be even more critical under limited freshwater resources and growing populations in arid and semi-arid regions where there are frequent and extended periods of water supply deficiency. To make a water resource robust against such anomalies, suitable operational models must be used to incorporate the main functions of the system alongside the involved subsystems. To address this issue, there have been some efforts in the literature, in many of which modeling and simulation have been served as a basis for studying the water system’s characteristics and comprehending impacts of governing mechanisms [1,2,3,4,5,6,7,8]. Since most water resources systems are viewed as complex infrastructures, hydrological models emerged to simplify their evaluations and functions [9,10,11,12,13,14]. In many of the aforementioned studies, computers are hired to set up the models and evaluate the impact of factors shaping the system functions [15].
Hydrological models have been increasingly used in the water resources systems analysis and simulation. Figure 1a displays a sharp rise in the number of daily released software packages onto one of the most famous and more reliable R project’s repositories, also known as Comprehensive R Archive Network (CRAN). Similarly, on the same repository, libraries dedicated to hydrological analyses have experienced an increasing trend in the number of releases between 2006 and 2019 (see Figure 1b). MODIStsp, Evapotranspiration, dynatopmodel, soil physics, rtop, hydroPSO, and ClimDown are examples of the recent open-source developments in this field [16,17,18,19,20,21,22].
For water resource evaluation purposes, there is currently a limited number of simulators, most of which are commercial or non-open source, such as the water evaluation and planning system (WEAP), MODSIM, and HEC-ResSim [9,11,23]. In terms of free and open-source tools, the available options are mostly dedicated to the hydrological cycle and atmospheric studies. For instance, “Evapotranspiration”, developed by Guo et al. (2011) [24], estimates station-based potential evapotranspiration using 21 methods, or the “airGR” and “TUWmodel” packages developed by Coron et al. (2017) [25] and Parajka et al. (2013) [26], respectively, are rainfall-runoff simulators. In one case, an R package named as “reservoir”, developed by Turner and Galelli (2016) [27], was devised for single-unit reservoir optimization and simulation; however, it is unable to handle large-scale systems. On R’s data wrangling rival platform—Python—there have been recent endeavors to develop tools to address different aspects of water resources processes and paradigms such as tracer hydrology, soil moisture retention functions, water economy, hydrological data sharing, as well as a water resources systems simulation and optimization [28,29,30,31,32]. Table 1 shows a selected list of available software/libraries dedicated to water resources systems simulation and analysis compared with the R package introduced in this paper. Including WRSS 7, commercial/non-commercial software packages have been chosen and compared in terms of execution speed and a selected number of other capabilities. These criteria were categorized into general characteristics, i.e., supporting large-scale model or optimization, hydroelectric, and other capabilities such as execution speed, objects prioritization, and supporting various hydro-infrastructures. The table shows that most of tools are not supporting open-source platforms, except WRSS, RSSOP, and reservoir, while many of them are allowing large-scale modeling. In addition, most of the toolkits have possibilities to simulate hydro-electrical energy generation while a few of them are supporting systems optimization. In terms of simulation speed, most of the software packages propose a promising short execution time such as WRSS and RSSOP.
The execution speed categories present the running time for a single unit storage reservoir for 10 years of monthly simulation periods. The simulations were conducted on a computer with an Intel (R) Core (TM) i7-4790 CPU (4.00 GHz) CPU and 32 GB installed memory (RAM).
In the present study, R is selected as the platform for the development of a package due to its libraries’ ecosystem diversity and richness, through which hydrologists can synergize the results of data processing. In addition, developing open source tools provides scientists and engineers faster features development and bug fixing, quicker and more effective global software product promotion, and, ultimately, technological advancement [33]. In spite of the availability of software out there to analyze and simulate large-scale water resources systems, there is no open-source interface and freely accessible tool to handle the job. In this context, large-scale water resources signify a system comprised of two or more interconnected subsystems. Large-scale water resources systems have been frequently studied by researchers such as cascade reservoirs or complex reservoir-supply networks [34,35,36,37]. These systems may interact with each other through hydrological processes including, but not limited to, seepage, leakage, spillage, etc.
Although R packages developed for hydrology and water resources are proposing great advantages, there is no library in R supporting large-scale water resources evaluation. To bridge this gap, an R-based package is introduced in this study to handle large-scale water systems simulation. The package is titled Water Resources System Simulator (WRSS), which assists water resources experts in both sizing and operating a complex water resources system.
To handle the complexities raised from large-scale water system operation, WRSS uses Object-Oriented Programming (OOP). What makes WRSS distinctive from existing developments within R libraries, specifically from the “reservoir” package, is its capability in multiple hydro-structures operation (e.g., aquifers, reservoirs, etc.) with the possibility of object interaction and prioritization. In contrast to the “reservoir” package that is limited to an isolated reservoir object, WRSS supports a range of features capable of interacting with each other through mechanisms such as allocation, return-flow, leakage, seepage, and spillage. Such interplay between features is of high importance due to the complex and interdependent nature of water resources systems [38].
In addition, while energy generation by “reservoir” package is available, there are still some nuances making WRSS preferable in practice for hydroelectric simulation. For instance, the energy losses associated with the penstock and the turbine are not considered in “reservoir”, while WRSS is able to calculate both losses separately. Furthermore, WRSS considers extra energy-related specifications for a power plant facility such as turbine-axis-elevation, submergence condition, and tailwater discharge-elevation-function, while these are not included in “reservoir”.
This paper aims to review the functionalities of the WRSS, an R package dedicated to large-scale water resources systems operation and assessment. The proposed package implementation in R can be of a profound advantage to water resources modelers since there has not yet been developed any other R packages to handle complex water supply–demand networks. Additionally, given WRSS’s capabilities and R’s growing world of complex computational methods, its users can make more sophisticated models much simpler to address hydro-environmental problems. For instance, tedious and technically challenging tasks such as making a coupled water resources–statistical model goes straight as all of these are available under a unified platform. Therefore, WRSS aims to enhance water resources management practices by providing solutions and methods for large-scale systems simulation and analyses.

2. Methodologies

2.1. Platform Environment

Scientists and engineers concerned with water resources topics have the opportunity to benefit from already developed R packages for water resources studies [39,40,41,42,43]. To implement WRSS, R platform was chosen because it is a high-level programming language running on various types of operating systems and easy to understand with widely used, freely available, and trusted packages [44]. R is an environment and a language for graphics and statistical computing. According to only R’s main repository (checked on 30 January 2020 (CRAN Packages)), there are 8060 packages, which is far higher than any other data wrangling platforms (e.g., SAS, SPSS, and Python), not to mention R’s popularity among both developers and users. An extensive investigation by the Data Science Service [45] indicates that R has a rising trend in popularity, and about half of data science jobs call for R experts. The same blog, additionally, reports R as the second software platform used by scientists in the scholarly articles. In 2009, The New York Times ran an article displaying R’s growth, and the reason why it is popular among scholars and reports, imposing the threat to commercial packages such as SPSS and SAS [46].

2.2. Governing Equations

While there are multiple release policies used for different conditions, a similar procedure to that of Rippl (1883) [47], Standard Operating Policy (SOP), is considered for supplying specific target in WRSS. SOP is the simplest and easiest policy used for water evaluation models, which aims to release a quantity of water equal to that needed for water demand, if possible [48].
SOP delivers the claimed demand, if enough water is available, retains extra water before reservoir is full while the target is fully supplied, and surpluses the exceeded water when the temporal capacity exceeds the top storage (see Figure 2a thick line) [49]. As a result, it is an optimal operation method when the reservoir objective is to minimize deficits over the decision space [50].
In contrast to the SOP, if the delivering amount falls between zero and the demand, it establishes a hedging rule which does not fully satisfy the demands and saves some water for the future (see Figure 2a dashed line). Hedging rules are very useful during long-lasting droughts, which can significantly enhance a system’s performance such as reducing vulnerability [51]. Although SOP does not rationalize releases in the future demand, it is practical, easy to understand, and the most often used approach for feasibility studies in development projects [52].

2.2.1. Mass Balance

SOP is implemented by mass balance as the core equation for water resources components simulation. Let k be the index of a feature under operation, i be the index of inflow representing the flow released from ith feature to kth feature, and j be the index of outflow released from kth feature to jth feature in tth time step; therefore, the mass balance equation for a component being operated will be as follows:
S t + 1 k = S t k + i Q t , k i j O t , j k
where the equation represents the system future state based on the current/past state. For a given storage system, k, in tth time step, the equation demonstrates that the storage in the future, S t + 1 k , is equal to the storage in the past, S t k , plus all inflows, Q t , k i , and all outflows, O t , j k , with a negative sign.
Since features such as junctions, diversions, and reaches are assumed to have a negligible storage capacity (S) within two subsequent time steps, Equation (1) can be simplified as follows:
i Q t , k i = j O t , j k
where outflow matrix, O, can be established from different sources including water supply withdrawals, seepage, or evaporation losses, etc. Equations (1) and (2) are the basis used for operating all objects available in WRSS. For an impounding facility, Equation (1) is rewritten as grouped Equation (3):
S t + 1 k = S t k + i Q t , k i S p t k E V ¯ t k d R e t , d k S e t k       s . t : S m i n k < S t k < S m a x k       &       E V ¯ t k = A t k + A t + 1 k 2 E t k       &       S e t k = S t k + S t + 1 k 2 ω k
where it estimates the reservoir’s future/current state by subtracting all losses, i.e., evaporation and seepage, from the available water in the current/past state. See the annotation section for terms definition in the equations.
Similarly, for aquifer systems, Equation (1) is rewritten as below:
S t + 1 k = S t k + i Q t , k i d R e t , d k S e t k       s . t : 0 < S t k < S m a x k       &       S m a x k = V k × φ k       &       S e t k = S t k + S t + 1 k 2 ω k
where the total available water in the storage is defined as a product of wetted volume and the aquifer-specific storage. Similar to the reservoirs, the seepage volume is defined as the product between the seepage ratio and the average storage between two subsequent time steps as follows:
δ t k = i Q t , k i E x t k R V t k       s . t :   E x t k = m a x ( 0   , i Q t , k i D t k )       &       R V t k = δ t k × R F k
Equation (5) represents the mass balance in a demand node where, for every temporal step, an effective supplied water is calculated as the difference between the total inflows and excess/return flows, where the excess flow is calculated as the difference between the total inflow and demand, while the return flow is defined as a linear function of return flow fraction and the effective supplied water.
Assuming negligible storage/losses for a diversion facility, Equation (1) will be simplified as Equation (6), where the system outflow is computed as the difference between the total inflow and the diverted volume:
O t k = i Q t , k i D v t k             s . t :   D v t k = m i n ( C a p k , i Q t , k i )
To simulate rivers/channels system outflow, where applicable, all losses and seepages are subtracted from inflows. The seepage is computed as a fraction of total inflows:
O t k = q Q t , q k R e t k S e t k         s . t :   S e t k = ω k i Q t , k i
In WRSS, similar to diversion facilities, losses and storage are assumed to be negligible in junctions, so Equation (1) simplified as below:
O t k = i Q t , k i
where the outflow is set to be equal to the inflow.

2.2.2. Objects Prioritization

To incorporate targets/resources supplying/operation priorities, an integer value in [1, 99] interval was defined for every feature, presenting allocation/operation superiority, where the smaller value is translated to a higher allocation/operation order and vice-versa. To consider objects interactions, a method was developed to detect priorities of not only basin features simulation from upstream to downstream but also supply and demand operation. Accordingly, let α i be a vector of objects unique numbers, β i be α i ’s downstream objects unique number, and γ i be a vector of priorities corresponding to the α i , k group (s), g of the object (s) in the same level of simulation priority could be established as follows:
g k = {   α i   β j | i , j { 1 , 2 , ,   | α | } }       &       g k + 1 = {   α i   β j | i , j   { 1 , 2 , , | α | g k } }
  1   i N     | { i N | g a k = g i k } | = | { i N | γ a = g i k } |
Equation (9) detects and groups objects from upstream to downstream; then, using the priorities given in γ , the objects within g k are sorted in ascending order. To control the algorithm flow, it is assumed that all targets and objects recharging from external source(s) are located downstream of their corresponding supplier(s)/recharger(s). The following pseudo-code (see Algorithm 1) represents the mathematical approach described above:
Algorithm 1
  Populate a reference matrix code whose columns correspond to objects and rows are attributes of the objects as follows:
    1- label 2- downstream label 3- priority
Loop
    Check which label(s) in the first row of reference matrix is/are not duplicated in the second row and select them as upstream feature(s)
    Loop
      Select a feature from the upstream set with higher priority as current_object
        If the current_object is a water resource, then:
          Simulate the feature and allocate water to demand site(s) supplied by current_object according to their priority(ies))
          Route the outflows to the downstream of the current_object
     End If
        If the current_object is a demand site:
          Compute the return-flow fraction volume and route it to the downstream of the current_object
     End If
        Terminate the loop if the criterion (number of iterations > the number of upstream feature(s)) is met
   End Loop
   Remove upstream features from the reference matrix
   Terminate the loop if the criterion (number of columns in reference matrix is zero) is met
End Loop
The algorithm detects objects from upstream to downstream. Then, those objects in the most upstream location and with the highest priority are selected for operation (current_object). If the current_object is a water resource, then the algorithm simulates the feature and allocates water to demand site (s) connected to the current_object according to their priority (ies) then routes the outflows to the downstream. If the current_object is a demand node, algorithm calculates return-flow fraction volume, where applicable, and routes it to the downstream. The process is performed until all objects in the model are simulated at least once.
For shared water resources supplying multiple targets with equal priority, the allocation is conducted based on each demand’s volume. Let R e t k be the released volume from the kth resources in tth time step and { D e t 1 , D e t 2 ,   ,   D e t d } be the target values, all with equal priority being supplied by the kth resources, the allocation for each target, R e t , d k is calculated as below:
R e t , d k = D e t d d D e t d R e t k

2.2.3. Hydroelectric Energy Generation

Hydropower energy generation has been implemented in WRSS version 2.0 and above, however, it is limited to reservoirs. The most common type of hydroelectric power plant is an impoundment facility in which water is released from the reservoir by a large pipe known as “penstock”, flowing through a turbine, spinning it, which in turn activates a generator to produce electricity (see Figure 2b). The following equation calculates the energy generated by a power plant:
P t = ρ g Q t H t φ t       s . t : H = H t ( 1 ) + H t ( 2 ) 2 h t t a i l h f t h t t a i l = { m a x ( T A E ,   h t t w )       s u b m e r g e d T A E ! s u b m e r g e d } = h f t T + h f t P = h f f T + 10.67 L D 4.804 ( Q t C ) 1.852 φ t =   ( Q t )
In Equation (12), there are two terms with unknown values, Q t and H t 2 , needed to be determined using trial and error procedure. First, an assumption of release value is considered; then, H t 2 and P t are calculated. Next, the constraints are checked, and the procedure is repeated until an insignificant change between the generated power and installed capacity is observed. The following equation represents the trial and error procedure as an optimization problem:
m i n { | P t P I n s t a l l e d | }             s . t : P t             < P I n s t a l l e d { H t 1 , H t 2 }   [ m i n ( D H ) ,     m a x ( D H ) ]     Q t                   [ m i n ( D Q ) ,                   m a x ( D Q ) ]
To solve Equation (13), WRSS uses the Improved Stochastic Ranking Evolution Strategy optimization algorithm, whose details can be found in [53].

2.2.4. Performance Indices

The performance of a water resources system is defined as its ability to meet the downstream requirements and, if possible, store water for future. Performance indices are categorized into yield-based and risk-based approaches (refer to [54]). WRSS uses the risk-based approach, implemented in the risk function, which includes measures known as reliability, vulnerability, and resiliency [50]. The measure formulations and definitions are as below:
The probability of a reservoir to release water ( R e t , d k ) equal to D t k is defined as reliability, which can be defined in both temporal and volumetric scales. The temporal method considers the total number of periods R e t , d k , which meets the D t k   by a defined threshold ( α ). The volumetric reliability is the same as temporal reliability in which the fluid volumes are considered instead. The reliability indices for both temporal and volumetric criteria are presented in Equations (14) and (15), respectively:
r e l t m p = N ( R e t , d k > α . D t k ) T                                                                                       :   t   [ 1 ,   T ]
r e l v o l = t = 1 T ( | R e t , d k < α . D t k   &   α . D t k | R e t , d k α . D t k ) T . α . D t k                   :   t   [ 1 ,   T ]
The speed that a hydro-system is recovered from a temporal failure is defined as resiliency. The following is the resiliency mathematical expression:
r e s = N   ( R e t , d k < α . D t k | R e t + 1 , d k α . D t k )   T . α . D t k                                                       :   t   [ 1 ,   T ]
To measure the magnitude of failures, the vulnerability index is used as expressed in Equation (17):
v u l = t ( α . D t k R e t , d k | R e t , d k < α . D t k , 0 | R e t , d k α . D t k )   T                     :   t   [ 1 ,   T ]

2.3. Package Skeleton

WRSS uses OOP concepts to simulate any given project layouts. OOP simplifies processes through some definitions known as “objects”, designed in such a way that they can interact with one another. Figure 3 represents objects, classes, and methods implemented in WRSS shown by Unified Modelling Language (UML). As shown in Figure 3, the package includes six classes for feature construction, namely: createRiver, createReservoir, createAquifer, createJunction, createDiversion, and createDemandSite. For instance, the class of createArea signifies the basin object construction, in which, addObjectToArea method adds all constructed features to the basin. Consequently, basin object could be passed to sim class where plot and risk methods for the simulation, visualizations, and extra analyses can be performed, respectively.
The classes and functions of WRSS have been categorized into three groups, including object manipulation, analysis, and visualization as presented in Table 2, where its second column is the name of the method/class, the third column briefly describes the method/class output, i.e., reservoirRouting routes available water through a impounding facility, and the last column describes the main specifications of the methods/classes, i.e., ripple method computes the storage capacity based on SPA algorithm. To simulate an object from the class of createArea, users should mind adding time series in an appropriate temporal scale. As stipulated in the package user manual (https://cran.r-project.org/web/packages/WRSS/WRSS.pdf (accessed on 18 August 2021)), users can either coerce an optional time-series or leave (a) constant(s) to be cycled throughout the simulation time-scale.

2.4. Storage Design

According to [47], the minimum capacity of a reservoir is an amount of storage required to meet the specified water demand (s) without leading to water supply shortage, which is commonly computed by the ‘sequent-peak-algorithm’ method [55]. In addition, the reservoir capacity could be designed by the concepts of yield–storage relationships [56]. In this method, the capacity design process includes the calculation of reservoir-yield-based criteria for multiple pairs of capacity and design parameters. For capacity design, WRSS proposes the rippl function to handle Rippl’s method and the cap_design for yield–storage relationships.
To determine the size of the reservoirs in the yield-capacity method, since the capacity size is not only a function of dam site river flow but also depends on other project measures (e.g., water demand volume). So, combinations of a number of reservoir’s size candidates, i.e., C a p m a x = { C a p 1 , C a p 2 , , C a p m } and any project design parameters, e.g., developable agricultural area, D = { D 1 , D 2 , , D n } are used to measure any RRV (reliability-resiliency-vulnerability) metrics. For instance, if one design parameter denotes candidates of developable cropland areas,   C r o p = { A 1 , A 2 , , A o } , and the other one is C a p m a x , the payoffs would be three RRV values corresponding to any given cropland and capacity size. While each payoff may result in individual capacity/cropland size, Loucks (1997) [57] has proposed a multi-index technique to amalgamate all measures as below:
S I j i = r e l i a b i l i t y j i × r e s i l i e n c y j i × ( 1 v u l n e r a b i l i t y j i m a x { v u l n e r a b i l i t y j i } )
where i is the capacity index and j is the cropland area index. The resulting product, SI, ranges from 0, as the lowest and worst possible value, to 1, as the highest and best possible value. This SI applies to each criterion C for any constant level of probability p, further calculated for each alternative system or decision being considered [57]. If there are multiple targets (domestic, agriculture, etc.), a combined weighted relative SI (RSI) as recommended by Loucks (1997) will be utilized as shown below [57]:
R S I = i W i × S I i
where Wi is the relative weight ranging from 0 to 1 and summing 1, which can be defined to reflect the importance of each sustainability index. To determine Wi, either an optimization approach or a multi-criteria-decision-making (MCDM) method is recommended. In this study, Analytical Hierarchal Process (AHP) method is used to derive the weights. A detailed explanation about the AHP method could be found in Vaidya and Kumar (2006) [58].

2.5. Restrictions and Precautions

WRSS uses R version 3.0 or later, and it is dependent on built-in functions Hmisc, network, nloptr, ggplot2, and GGally packages. Furthermore, it imports graphics and stats packages, all available when the R core is installed. In addition, WRSS supports merely SOP without possessing the capability to incorporate user-defined operation rules or optimization approaches. The current version of WRSS supports daily, weekly, and monthly simulation time intervals, and consequently, other time scales are not implemented/integrated yet. Accordingly, precautions must be made by users to avoid invalidity of governing equations for simulation of systems of small units with fine temporal resolutions, i.e., daily, due to dominance of hydraulic processes over hydrological and mass balance equations.

3. Case Study

To test WRSS, the Zerrine-rud basin in Iran is selected for both operation and design purposes. In the first part, the Bukan dam capacity is estimated by different approaches, and in the second part, a large-scale system of 5 reservoirs and 11 water demands are simulated. Figure 4a,b present a topographic layout and schematic view of the main drainage network, respectively. As seen in Figure 4b, every feature is labeled with numbers from one to three, indicating higher to lower priorities, respectively, and return-flow links are shown by connected dashed lines. The reservoir system is composed of four parallel dams located upstream of the Bukan reservoir, constructed at the west of Iran, located in Kurdistan Province. The region area is about 4700 km2, receiving 510 mm/year rainfall with an annual average temperature of 9.2 °C.

Datasets

The datasets used for the reservoirs’ simulation include hydro-meteorological, demand time series, and reservoirs geometric specifications. All of the datasets are provided by the Iran Water Resources Management Company [59]. Table 3 shows the monthly averaged time series used for the system simulation. The most recent 10 years of monthly time series of hydrologic parameters were used as the representative time series for both dry and wet periods of hydrologic cycle. According to Table 3, about 89% of the basin’s surface water goes to the Bukan dam with a capacity about 670 × 106 m3. Regarding the demands, A1 and D1 are the largest demand nodes supplied by Bukan with an annual water demand about to 1250 × 106 m3. Generally, the agricultural sector is the main water user in the catchment, and its demands start from May and end in September, while other sectors’ water demands are fairly constant with less variation during the year. The evaporation is estimated to be higher as the site location is in higher latitude, and the basin average evaporation is about 1350 mm/year.

4. Results and Discussion

Figure 5 shows the different hypothetical layouts implemented in R using WRSS. The R code for each conceptual model, shown in Figure 5, is accessible via CRAN repositories or other online HTML resources (https://rdrr.io/cran/WRSS/man/addObjectToArea.html (accessed on 18 August 2021)). The following sub-sections represent the application of WRSS in both design and operation of the Zerrine-rud water resources system.

4.1. Capacity Design: Bukan Dam

For Bukan, the capacity redesigning rippl function is used to compute no-fail storage capacity using backward sequent-peak-algorithm for a given set of target and discharge flows. In the rippl method, a cumulative discharge time series ( Q t ) was subtracted from a cumulative target ( D t ) time series of ( S t = Q t D t ). Then, a backward search is conducted for every two subsequent peak and anti-peaks in St, and then they were compared and the largest (St − St−T) value was reported as the storage capacity required to meet the target time series. In Figure 6, after the computation of St, a backward search was performed to find the largest spike between every two subsequent peaks and anti-peaks. In the case of Bukan, in 10 years of monthly time series, the largest value was found between time steps 110 and 102.
For annually averaged 1472 × 106 m3 of inflow and 1645 × 106 m3 of the target, the rippl function computes the reservoir capacity as 1181.2 × 106 m3 and plots the results as shown in Figure 6.
In addition, a storage–yield relationship is analyzed by the functions and methods built into the package. To this end, let the yield–storage function be ϑ = ( C a p , α ) , where maps the capacity size, C a p and the other design parameter(s), α , such as the area of irrigable lands, to the RRV space, ϑ . As a simple approach, the design parameter(s) domain(s) were discretized for the construction of the yield–storage relationship by evaluating all possible combinations of arguments. Accordingly, let the capacity of a dam be C a p = { S 1 , S 2 , , S n } and the Crop area be C r o p = { A 1 , A 2 , , A m } , RRV matrices, could be established from all pairs of ( C a p i , C r o p j ) , where i n ,   j m . For the Bukan dam, let C a p = { 500 ,   600 ,   ,   2000 } × 106 m3 and C r o p = { 500 ,   600 ,   ,   2000 } × 104 m2, and a pseudo-code, as shown in the Algorithm 2, generates a pairwise evaluation of the parameters over the given-above domain of the design parameters:
Algorithm 2
Initialize “n” design parameter(s) and discrete them within the search space
 Make all possible combinations of design parameters, M
Loop
  For each combination of design parameter(s), operate water resources feature(s).
  Evaluate RRV measures for every target(s).
  Terminate the loop if the criterion (number of iterations > number of combinations in M) is met
 End Loop
Cap_design is an R implementation of the above-mentioned pseudo-code, which is able to plot the decision domain for each RRV measure. Figure 7a shows a graphical presentation of design variables with respect to risk-based indices. Based on the plots in Figure 7a, the domestic and industrial sectors function similarly with respect to design choices, however, the water requirement behaves differently, particularly for choices with higher capacities. In addition, a high dependency on the capacity size can be seen in all sectors for vulnerability and reliability indices. In contrast to the other sectors, the condition in the resiliency criterion is different, with multiple local optima and no general trend compared to the other measures. For domestic and agricultural sectors, the maximum resiliency corresponds to a capacity around 700 × 106 m3, where the decreasing gradient of vulnerability is becoming smoother along the capacity axis. However, to make the reservoir resilient to water supply requirements, the smallest capacity with the best resiliency is around 1200 × 106 m3 with 900 × 104 m2 of cropland area, which is 50% larger than the existing capacity size. Figure 7b presents SI and RSI measures calculated for the Bukan dam. Similar to Figure 7(a, b2, b3), domestic SI and agriculture SI, respectively, have similar trends, while Figure 7(b1) (water requirement SI) follows the water requirement resiliency surface in Figure 7a. To process SI aggregation, an AHP was conducted, and the weights of RSI were derived as 0.397, 0.332, and 0.270 for the environmental, domestic, and agricultural sectors, respectively. As a result, the RSI is calculated as presented in Figure 7(b4). Based on Figure 7(b4), the RSI maximum value is derived as 0.18, which corresponds to 1600 × 106 m3 capacity and 900 × 104 m2 cropland area. However, several local optima are suggesting smaller capacity values but with relatively lower RSIs. One appropriate candidate could be the 1200 × 106 m3 capacity and 1000 × 104 m2 cropland area with 0.13 RSI, which is quite close to the capacity size calculated by the ripple method (1181.2 × 106 m3). Another candidate design might be 600 × 106 m3 with a crop area between 800 × 104 m2 and 1200 × 104 m2. According to the river flow regimes in the past decade, if developers had designed the dam with 150 × 106 m3 smaller capacity, they would have supplied water requirement by almost the same rate of reliability as it does now. By contrast to the water requirement, Figure 7a signifies that the regulation of river flow for agricultural or domestic sectors requires a larger reservoir than the existing one. If the irrigation water and domestic water requirements are supplied by over 80% of reliability and the cropland area is the same as the current condition (1000 × 104 m2), a hypothetical reservoir size of 1000 × 106 m3 is required to feed the croplands, (~240 × 106 m3 larger than the existing one).

4.2. Large-Scale Simulation: Zerrine-Rud River Basin

Features existing in the Zerrine-rud layout (see Figure 4b) were constructed using the functions presented in Table 2. Then, the basin object was simulated using the ‘sim’ function on a computer with an Intel (R) Core (TM) i7-4790 CPU (4.00 GHz) CPU and 32 GB of installed memory (RAM). The simulation run time took 0.1218315 s on a 64-bit operating system, which is far faster than its rivals (e.g., WEAP with 5.73 s).
Figure 8 displays performance criteria derived by the risk method applied on the simulated basin object resulted from sim class. According to the chart, in parallel with the other studies reported in the literature [60,61], the computed reliability is significantly higher than resiliency based on SOP. For some targets, such as U1, U2, A1, and A2, an even larger difference can be viewed. Markhuz and Sarogh reservoirs outperformed with the highest reliability and resiliency and the least vulnerability. However, in addition to Sonata’s vulnerable performance in E3 and A4 with the vulnerability indices of about 23 and 20, respectively, it has relatively lower reliability and resiliency than the others. Cheragh-Veys and Bukan conditions are quite similar with relatively the same performance in vulnerability and resiliency for domestic sectors (U1 and U2), while the Bukan dam has exceeded Cheragh-Veys in reliability and resiliency in the agricultural sector.
Table 4 presents the performance criteria of the Bukan dam in supplying its target sites under single-unit and large-scale models. The table shows WRSS functionality in the enhancement of the operation of the Bukan dam by adding return-flow and spillage volumes from demand sites and reservoirs situated in its upstream. The annual average volumes contributing to the Zerrine River from upstream is 101.4 ×106 m3, which is just below 10 percent of the current natural regime of the river. Under large-scale simulation, Bukan dam is perfectly resilient in supplying E1, while the resiliency criterion for the same site under isolated unit simulation is just over 0.3. By contrast to E1, the reliability and resiliency of U1 and A1 under large-scale simulation compared to the single unit has not been enhanced significantly, whereas the vulnerability has dropped notably by around 3.5 and 6.8, respectively.
Supplied volumes are displayed in Figure 9. The figure displays the reservoirs’ monthly average releases throughout the simulation period superimposed by 95 percent release confidence and demand bar-chart. Excluding the Sarogh and Markhuz reservoirs, the performance of the other dams is not affected significantly by release quantities for the targets, specifically in the cropping season (May to October) when the demand for irrigation is high. In addition, the Sarogh and Markhuz dams have shown to be reliable in supplying both irrigation and domestic demands (Figure 9e). However, for the other reservoirs, despite saving water from non-cropping seasons, the reservoirs fail to cover the demands in the subsequent irrigation period. For the Sonata dam, this is even more apparent, where large quantities of demands (about 95%) are unsupplied, indicating a largely defined demand size for the Sonata reservoir and signifying the necessity for its justification.

5. Conclusions and Remark

The CRAN policies allow developers to upgrade and support packages, fix bugs, and extend software. Already, many capabilities have been added to the WRSS such as conjugate water resources operation, hydroelectric simulation, followed by fixing some bugs and errors.
Although there are many water resources simulation models, the WRSS implementation in R can be of a profound advantage to hydrologists and water resources engineers to address the impact of different hydro-climatic scenarios under different hard-work practices such as multiple structural works, e.g., dams, diversion, channels, etc. This is very important because the simulation of water system features in isolation does not take into account the impact of other components, consequently, not yielding precise and rational results.
The simulation of the Zerrine-rud basin reported the importance of object-oriented programming used in WRSS. Large-scale simulation of this basin supported the integration of basin components through the implemented hydrological mechanisms, adding up 9.66% to the Bukan inflow through a contribution of 0.76% charged by upstream seepages and 8.90% coming from upstream spillages. Although the seepage contribution is around 7.9% of the added volume, it has been constantly contributed throughout the whole simulation period and it was the main factor in reducing the vulnerability index for one of the environmental water requirement demands (E1). This is because the E1 time series has an almost uniform distribution and a uniformly distributed supply, e.g., seepage, can significantly affect its reliability-resiliency-vulnerability metrics enhancement. However, even if the spillage volumes coming from upstream may yield large values, they happen occasionally with the lower possibility of their regulation, which consequently leads to less contribution to the enhancement of RRV metrics.
Utilizing WRSS, engineers and water resource scientists are able to assess, design, and operate water resources systems within the R environment. It is shown that the WRSS can have diverse applications in hydrologic analysis and large-scale basin modelling. To this end, a number of main advantages of WRSS can be summarized as below:
  • WRSS is an object-oriented R package supporting the simulation of large-scale supply water resources systems with complex layouts. The particular coding system devised for WRSS makes it possible to construct as many features as possible and include them in the simulation process.
  • The WRSS package can detect supply and allocation priorities for both water resources objects and demand nodes which have not been introduced in other R packages as well as many other open-source tools. Prioritization can be applied to demand features using shared or individual resources with any arbitrary priority. Furthermore, this is applicable for resource nodes where there are preferences in operation priorities.
  • WRSS provides constructors of objects in the basin rather than reservoirs, e.g., diversions, aquifers, etc., with the capability of interacting through mechanisms such as leakage, seepage, etc., which have been not available in other R packages. Additionally, the results demonstrate the importance of these mechanisms. Unless these mechanisms contribute to a small portion of the flow of the drainage network, they have significant impacts on the performance criteria.
  • WRSS is freely available, and R users can have the advantages of using the R’s world of options. All of these possibilities could be used in the combination with WRSS objects to synergize its application in water resources modelling such as making coupled models under R platform.
Software Availability
Name of software: WRSS
Version: 3.0
Developers: Arabzadeh, R., et al.
Maintainer: Arabzadeh, R. <[email protected] >
Year first available: 2017
License: GPL-3
Available from: Comprehensive R Archive Network (CRAN)

Author Contributions

Conceptualization, R.A. and P.A.; methodology, R.A., S.N. and R.S.; software, R.A.; validation, S.H., M.H. and W.R.; formal analysis, R.A. and P.A.; investigation, R.S. and R.A.; resources, R.A.; data curation, R.A. and P.A.; writing—original draft preparation, R.A., P.A., S.H., M.H. and S.N.; writing—review and editing, W.R. and R.S.; visualization, R.A.; supervision, R.S., W.R. and S.N.; project administration, R.S. and R.A.; funding acquisition, R.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Some or all data, models, or code generated or used during the study are available in a repository online at: https://github.com/rarabzad/WRSS. (accessed on 18 October 2021).

Acknowledgments

The authors wish to appreciate anonymous reviewers, Aram Jalali-Bouraban, and Samaneh Seifollahi-Aghmiuni for their comments on the paper structure and the manuscript proof reading.

Conflicts of Interest

The authors declare no conflict of interest.

Annotations

i:j:kFeature index
Outflow (×106 m3)
Reservoir:
S t k Storage (×106 m3)
Q t , k i Inflow (×106 m3)
S p t k Spillage (×106 m3)
E V ¯ t k Average evaporation (×106 m3)
R e t , d k Release for the dth demand node (×106 m3)
S m i n k Dead storage (×106 m3)
S m a x k Capacity (×106 m3)
A t k Lake area (×104 m2)
E t k Evaporation depth (m)
S e t k Seepage (×106 m3)
ω k Seepage fraction [0,1]
Aifer:
V k Aquifer volume (×106 m3)
φ k Specific yield [0,1]
Dand:
D t k Demand (×106 m3)
δ t k Effective supplied water (×106 m3)
E x t k Excess supplied water (×106 m3)
R V t k Return flow (×106 m3)
R F k Return flow fraction [0,1]
Diversion:
D v t k Diverted water (×106 m3)
C a p k diversion capacity (m3/s)
Per plant:
P t Generated energy (Watt)
ρ Water density (~1000 Kg/m3)
g The gravity acceleration (~9.806 m/s2)
H t Gross head (m)
φ t Power plant efficiency [0,1]
h f t Total head losses (m)
H t ( 1 )   and   H t ( 2 ) Headwater between two subsequent time step
h t t a i l Head of tailwater (m)
T A E Turbine axis elevation (m)
h t t w Tailwater head in the river (m)
h f t T Turbine losses (m)
h f t P Penstock losses (m)
L , D   and   C Length, Diameter, and Hazen–Williams Coefficient [62]
Interpolator function of discharge-efficiency-table
P I n s t a l l e d Installed capacity (Watts)
D H and D Q Ranges of design head (m) and design flow rate (m3/s) of the turbine

References

  1. Rigon, R.; Bancheri, M.; Formetta, G.; de Lavenne, A. The geomorphological unit hydrograph from a historical-critical perspective: Geomorphological unit Hydrograph. Earth Surf. Process. 2016, 41, 27–37. [Google Scholar] [CrossRef]
  2. Crochemore, L.; Perrin, C.; Andréassian, V.; Ehret, U.; Seibert, S.P.; Grimaldi, S.; Gupta, H.; Paturel, J.-E. Comparing expert judgement and numerical criteria for hydrograph evaluation. Hydrol. Sci. J. 2015, 60, 402–423. [Google Scholar] [CrossRef]
  3. Gatti, L.V.; Gloor, M.; Miller, J.B.; Doughty, C.E.; Malhi, Y.; Domingues, L.G.; Basso, L.S.; Martinewski, A.; Correia, C.S.C.; Borges, V.F.; et al. Drought sensitivity of Amazonian carbon balance revealed by atmospheric measurements. Nature 2014, 506, 76–80. [Google Scholar] [CrossRef]
  4. Ouyang, S.; Zhou, J.; Qin, H.; Liao, X.; Wang, H. A novel multi-objective electromagnetism-like mechanism algorithm with applications in reservoir flood control operation. Water Sci. Technol. 2014, 69, 1181–1190. [Google Scholar] [CrossRef]
  5. van Dijk, A.I.J.M.; Beck, H.E.; Crosbie, R.S.; de Jeu, R.A.M.; Liu, Y.Y.; Podger, G.M.; Timbal, B.; Viney, N.R. The Millennium Drought in southeast Australia (2001–2009): Natural and human causes and implications for water resources, ecosystems, economy, and society: Causes and Impacts of Australia’s Record Drought. Water Resour. Res. 2013, 49, 1040–1057. [Google Scholar] [CrossRef]
  6. Klaus, J.; McDonnell, J.J. Hydrograph separation using stable isotopes: Review and evaluation. J. Hydrol. 2013, 505, 47–64. [Google Scholar] [CrossRef]
  7. Mundi, G.; Zytner, R.G.; Warriner, K.; Bonakdari, H.; Gharabaghi, B. Machine learning models for predicting water quality of treated fruit and vegetable wastewater. Water 2021, 13, 2485. [Google Scholar] [CrossRef]
  8. Kuo, J.T.; Hsu, N.S.; Chiu, S.K. Optimization and risk analyses for rule curves of reservoir operation: Application to Tien-Hua-Hu Reservoir in Taiwan. Water Sci. Technol. 2006, 53, 317–325. [Google Scholar] [CrossRef] [PubMed]
  9. Labadie, J.W.; Baldo, M.L.; Larson, R. MODSIM: Decision Support System for River Basin Management: Documentation and User Manual; Colorado State University and US Bureau of Reclamation: Ft Collins, CO, USA, 2000. [Google Scholar]
  10. Loucks, D.P.; van Beek, E.; Stedinger, J.R.; Dijkman, J.P.M.; Villars, M.T. Water Resources Systems Planning and Management. An Introduction to Methods, Models and Applications; UNNESCO Publishing: Paris, France, 2005. [Google Scholar]
  11. Sieber, J.; Purkey, D. Water Evaluation and Planning System User Guide for Weap21; US Center, Stockholm Environment Institute: York, UK, 2007. [Google Scholar]
  12. Hadihardaja, I.K. Decision support system for optimal reservoir operation modeling within sediment deposition control. Water Sci. Technol. 2009, 59, 479–489. [Google Scholar] [CrossRef]
  13. Beven, K. How to make advances in hydrological modelling. Hydrol. Res. 2019, 50, 1481–1494. [Google Scholar] [CrossRef] [Green Version]
  14. Bárdossy, A.; Anwar, F.; Seidel, J. Hydrological modelling in data sparse environment: Inverse modelling of a historical flood event. Water 2020, 12, 3242. [Google Scholar] [CrossRef]
  15. Loucks, D.P. Water resource systems models: Their role in planning. J. Water Resour. Plan. Manag. 1992, 118, 214–223. [Google Scholar] [CrossRef]
  16. Busetto, L.; Ranghetti, L. MODIStsp: An R package for automatic preprocessing of MODIS Land Products time series. Comput. Geosci. 2016, 97, 40–48. [Google Scholar] [CrossRef] [Green Version]
  17. Guo, D.; Westra, S.; Maier, H.R. An R package for modelling actual, potential and reference evapotranspiration. Environ. Model. Softw. 2016, 78, 216–224. [Google Scholar] [CrossRef]
  18. Metcalfe, P.; Beven, K.; Freer, J. Dynamic TOPMODEL: A new implementation in R and its sensitivity to time and space steps. Environ. Model. Softw. 2015, 72, 155–172. [Google Scholar] [CrossRef] [Green Version]
  19. Silva, A.R.; Lima, R.P. Soilphysics: An R package to determine soil preconsolidation pressure. Comput. Geosci. 2015, 84, 54–60. [Google Scholar] [CrossRef]
  20. Skøien, J.O.; Blöschl, G.; Laaha, G.; Pebesma, E.; Parajka, J.; Viglione, A. Rtop: An R package for interpolation of data with a variable spatial support, with an example from river networks. Comput. Geosci. 2014, 67, 180–190. [Google Scholar] [CrossRef]
  21. Zambrano-Bigiarini, M.; Rojas, R. A model-independent Particle Swarm Optimization software for model cali-bration. Environ. Model. Softw. 2013, 43, 5–25. [Google Scholar] [CrossRef]
  22. Cannon, A.J. GEVcdn: An R package for nonstationary extreme value analysis by generalized extreme value con-ditional density estimation network. Comput. Geosci. 2011, 37, 1532–1533. [Google Scholar] [CrossRef]
  23. Engineers, U.S.A.C. HEC-ResSim Reservoir System Simulation User’s Manual; Klipsch, J.D., Hurst, M.B., Eds.; US Army Corps of Engineers, Hydrologic Engineering Center: Davis, CA, USA, 2013. [Google Scholar]
  24. Guo, X.; Sun, X.; Ma, J. Prediction of daily crop reference evapotranspiration (ET0) values through a least-squares support vector machine model. Hydrol. Res. 2011, 42, 268–274. [Google Scholar] [CrossRef]
  25. Coron, L.; Thirel, G.; Delaigue, O.; Perrin, C.; Andréassian, V. The suite of lumped GR hydrological models in an R package. Environ. Model. Softw. 2017, 94, 166–171. [Google Scholar] [CrossRef]
  26. Parajka, J.; Rogger, M.; Kobler, U.; Salinas, J.; Nester, T.; Bloeschl, G. TUWmodel: An Educational Hydrologic Model in R; American Geophysical Union: Washington, DC, USA, 2013. [Google Scholar]
  27. Turner, S.W.D.; Galelli, S. Water supply sensitivity to climate change: An R package for implementing reser-voir storage analysis in global and regional impact studies. Environ. Model. Softw. 2016, 76, 13–19. [Google Scholar] [CrossRef]
  28. Kersting, A.; Brander, S.; Suckow, A. Modelling 85Kr datasets with python for ap-plications in tracer hydrology and to investigate atmospheric circulation. MethodsX 2021, 8, 101245. [Google Scholar] [CrossRef]
  29. Memari, S.S.; Clement, T.P. PySWR-A Python code for fitting soil water retention functions. Comput. Geosci. 2021, 156, 104897. [Google Scholar] [CrossRef]
  30. Dogan, M.S.; Fefer, M.A.; Herman, J.D.; Hart, Q.J.; Merz, J.R.; Medellín-Azuara, J.; Lund, J.R. An open-source Python implementation of California’s hydroeconomic optimiza-tion model. Environ. Model. Softw. 2018, 108, 8–13. [Google Scholar] [CrossRef]
  31. Wang, J.; Chen, M.; Lü, G.; Yue, S.; Wen, Y.; Lan, Z.; Zhang, S. A data sharing method in the open web environment: Data sharing in hydrology. J. Hydrol. 2020, 587, 124973. [Google Scholar] [CrossRef]
  32. Tomlinson, J.E.; Arnott, J.H.; Harou, J.J. A water resource simulator in Python. Environ. Model. Softw. 2020, 126, 104635. [Google Scholar] [CrossRef]
  33. Bonaccorsi, A.; Rossi, C. Why Open Source software can succeed. Res. Policy 2003, 32, 1243–1258. [Google Scholar] [CrossRef] [Green Version]
  34. Tilmant, A.; Kelman, R. A stochastic approach to analyze trade-offs and risks associated with large-scale water resources systems: Trade-offs and Risks in Large-Scale Water Resources Systems. Water Resour. Res. 2007, 43, 1–11. [Google Scholar] [CrossRef]
  35. Cervellera, C.; Chen, V.C.P.; Wen, A. Optimization of a large-scale water reservoir network by stochastic dynamic programming with efficient state space discretization. Eur. J. Oper. Res. 2006, 171, 1139–1151. [Google Scholar] [CrossRef]
  36. Giuliani, M.; Quinn, J.D.; Herman, J.D.; Castelletti, A.; Reed, P.M. Scalable multiobjective control for large-scale water resources systems under uncertainty. IEEE Trans. Control. Syst. Technol. 2018, 26, 1492–1499. [Google Scholar] [CrossRef]
  37. Moravej, M.; Hosseini-Moghari, S.-M. Large scale reservoirs system operation optimization: The interior search algorithm (ISA) approach. Water Resour. Manag. 2016, 30, 3389–3407. [Google Scholar] [CrossRef]
  38. Karamouz, M.; Szidarovszky, F.; Zahraie, B. Water Resources Systems Analysis; CRC Press: Boca Raton, FL, USA, 2003; ISBN 9781566706421. [Google Scholar]
  39. Andrews, F.T.; Croke, B.F.W.; Jakeman, A.J. An open software environment for hydrological model assessment and development. Environ. Model. Softw. 2011, 26, 1171–1185. [Google Scholar] [CrossRef]
  40. Zambrano-Bigiarini, M. Hydrotsm: Time series management, analysis and interpolation for hydrological model-ling. In R Package Version; CRAN; 2012; p. 3. Available online: https://www.rforge.net/hydroTSM/ (accessed on 25 October 2021).
  41. Carslaw, D.C.; Ropkins, K. Openair—An R package for air quality data analysis. Environ. Model. Softw. 2012, 27, 52–61. [Google Scholar] [CrossRef]
  42. Wu, Y.; Liu, S. Improvement of the R-SWAT-FME framework to support multiple variables and multi-objective functions. Sci. Total. Environ. 2014, 466–467, 455–466. [Google Scholar] [CrossRef] [PubMed]
  43. Fuka, D.R.; Walter, M.T.; MacAlister, C.; Steenhuis, T.S.; Easton, Z.M. SWATmodel: A Multi-Operating System, Multi-Platform SWAT Model Package in R. J. Am. Water Resour. Assoc. 2014, 50, 1349–1353. [Google Scholar] [CrossRef]
  44. Tippmann, S. Programming tools: Adventures with R. Nature 2015, 517, 109–110. [Google Scholar] [CrossRef]
  45. The Popularity of Data Science Software. Available online: http://r4stats.com/articles/popularity/ (accessed on 21 October 2021).
  46. Vance, A. Data analysts captivated by R’s power. New York Times, 21 January 2009; 1–4. [Google Scholar]
  47. Rippl, W. The capacity of storage-reservoirs for water supply. Minutes Proc. Inst. Civ. Eng 1883, 71, 270–278. [Google Scholar] [CrossRef]
  48. Loucks, D.P.; Cozad, F.D. Water Resource Systems Planning and Analysis; Prentice Hall: Hoboken, NJ, USA, 1981; ISBN 9780139459641. [Google Scholar]
  49. You, J.-Y.; Cai, X. Hedging rule for reservoir operations: 1. A theoretical analysis: Hedging Rule-1. A Theoretical Analysis. Water Resour. Res. 2008, 44, 1–9. [Google Scholar] [CrossRef]
  50. Hashimoto, T.; Stedinger, J.R.; Loucks, D.P. Reliability, resiliency, and vulnerability criteria for water resource system performance evaluation. Water Resour. Res. 1982, 18, 14–20. [Google Scholar] [CrossRef] [Green Version]
  51. Kumar, K.; Kasthurirengan, S. Generalized linear two-point hedging rule for water supply reservoir operation. J. Water Resour. Plan. Manag. 2018, 144, 04018051. [Google Scholar] [CrossRef]
  52. Neelakantan, T.R.; Pundarikanthan, N.V. Hedging rule optimisation for water supply reservoirs system. Water Resour. Manag. 1999, 13, 409–426. [Google Scholar] [CrossRef]
  53. Runarsson, T.P.; Yao, X. Stochastic ranking for constrained evolutionary optimization. IEEE Trans. Evol. Comput. 2000, 4, 284–294. [Google Scholar] [CrossRef] [Green Version]
  54. Turner, S.W.D.; Marlow, D.; Ekström, M.; Rhodes, B.G.; Kularathna, U.; Jeffrey, P.J. Linking climate projections to performance: A yield-based decision scaling assessment of a large urban water resources system. Water Resour. Res. 2014, 50, 3553–3567. [Google Scholar] [CrossRef]
  55. Potter, K.W. Sequent peak procedure: Minimum reservoir capacity subject to constraint on final storage. J. Am. Water Resour. Assoc. 1977, 13, 521–528. [Google Scholar] [CrossRef]
  56. McMahon, T.A. River and Reservoir Yield; Water Resources Publications: Littleton, CO, USA, 1986; ISBN 9780918334619. [Google Scholar]
  57. Loucks, D.P. Quantifying trends in system sustainability. Hydrol. Sci. J. 1997, 42, 513–530. [Google Scholar] [CrossRef]
  58. Vaidya, O.S.; Kumar, S. Analytic hierarchy process: An overview of applications. Eur. J. Oper. Res. 2006, 169, 1–29. [Google Scholar] [CrossRef]
  59. Saatsaz, M. A historical investigation on water resources management in Iran. Environ. Dev. Sustain. 2020, 22, 1749–1785. [Google Scholar] [CrossRef]
  60. Strycharczyk, J.B.; Stedinger, J.R. Evaluation of a “Reliability programming” reservoir model. Water Resour. Res. 1987, 23, 225–229. [Google Scholar] [CrossRef]
  61. Bolouri-Yazdeli, Y.; Bozorg Haddad, O.; Fallah-Mehdipour, E.; Mariño, M.A. Evaluation of real-time operation rules in reservoir systems operation. Water Resour. Manag. 2014, 28, 715–729. [Google Scholar] [CrossRef]
  62. Liou, C.P. Limitations and proper use of the Hazen-Williams equation. J. Hydraul. Eng. 1998, 124, 951–954. [Google Scholar] [CrossRef]
Figure 1. (a) The number of R packages released on CRAN in the past 14 years (source: R project website: https://cran.r-project.org/web/packages/available_packages_by_date.html (accessed on 18 October 2021)); (b) the number of R packages developed for hydro-science and engineering.
Figure 1. (a) The number of R packages released on CRAN in the past 14 years (source: R project website: https://cran.r-project.org/web/packages/available_packages_by_date.html (accessed on 18 October 2021)); (b) the number of R packages developed for hydro-science and engineering.
Water 13 03037 g001
Figure 2. (a) Standard operating policy for reservoir operation. (b) A common impounding facility of hydropower turbine.
Figure 2. (a) Standard operating policy for reservoir operation. (b) A common impounding facility of hydropower turbine.
Water 13 03037 g002
Figure 3. Representation of classes and methods built-in WRSS package through Unified Modelling Language (UML).
Figure 3. Representation of classes and methods built-in WRSS package through Unified Modelling Language (UML).
Water 13 03037 g003
Figure 4. (a) Locations of dams within the Zerrineh-rud sub-basin in Kurdistan, Iran. (b) Schematic model of the Zerrineh-rud features.
Figure 4. (a) Locations of dams within the Zerrineh-rud sub-basin in Kurdistan, Iran. (b) Schematic model of the Zerrineh-rud features.
Water 13 03037 g004
Figure 5. Conceptual water resources models implemented in R using WRSS. Object priorities are shown by values written over the objects (the smaller value the higher priority).
Figure 5. Conceptual water resources models implemented in R using WRSS. Object priorities are shown by values written over the objects (the smaller value the higher priority).
Water 13 03037 g005
Figure 6. Diagram of Rippl’s method for no-fail storage volume of the Bukan reservoir.
Figure 6. Diagram of Rippl’s method for no-fail storage volume of the Bukan reservoir.
Water 13 03037 g006
Figure 7. RRV and sustainability index-capacity-irrigated area relationships for Bukan reservoir. (a) RRV measures (b) 1 to 3 show sustainability indices (RS) for water requirement, domestic, and agricultural water use, respectivelym and 4 denotes the relative sustainability index (RSI).
Figure 7. RRV and sustainability index-capacity-irrigated area relationships for Bukan reservoir. (a) RRV measures (b) 1 to 3 show sustainability indices (RS) for water requirement, domestic, and agricultural water use, respectivelym and 4 denotes the relative sustainability index (RSI).
Water 13 03037 g007aWater 13 03037 g007b
Figure 8. Risk-based performance criteria computed for Zerrine-rud demand sites.
Figure 8. Risk-based performance criteria computed for Zerrine-rud demand sites.
Water 13 03037 g008
Figure 9. The results of monthly average simulation of the Zarrineh-Rud river basin.
Figure 9. The results of monthly average simulation of the Zarrineh-Rud river basin.
Water 13 03037 g009
Table 1. Comparison of water resources tools.
Table 1. Comparison of water resources tools.
Software or
Package
General CharacteristicsHydro-
Electric
Other
Capabilities
Open-SourceOptimization SupportOOPRainfall-Runoff ModuleLarge-ScaleScripting SupportHydroelectricMultiunit SimulationPenstock-Turbine SizingReservoirAquiferDiversionPrioritizationUser InterfaceExecution Time (Simulation)Execution Time (Optimization)Hydrologic Mechanisms
WRSS×××SF *×
WEAP×××M×
MODSIM××××××MM
RSSOP××××××××××SF××
HEC-ResSim×××××F×
reservoir×××××××××FF×
RIBASIM××××M×
* For a single unit reservoir: SF (Super-Fast ~ T), F (Fast ~10 T), M (Medium ~ 20 T), where T is the mean execution time of an SF model on a given computer setup.
Table 2. WRSS package functions.
Table 2. WRSS package functions.
CategoryClasses/MethodsObjectiveSpecification
objects manipulationConstructorscreateAreaCreates a basinRequires the number of time steps and intervals length of simulation
createJunctionCreates a junction objectCombines flows drained to the junction
createRiverCreates a river or channel objectRiver with possibility for allocation and seepage
createReservoirCreates a storage reservoir objectHandles reservoir geometry for accurate estimation of evaporation volume
createDiversionCreates a diversion objectA diversion work with a fix diversion rate
createAquiferCreates an aquifer objectConstructs an unconfined aquifer object with a given hydrodynamic parameter
createDemandSiteCreates a demand objectAccepts either demand time series or demand parameters
addObjectToAreaAdd objects inherited from the constructors to an object from class of createAreaManages objects inherited from the constructors and adds them to an object from class of createArea
SimulationsimOperates water resources system using standard operation policy on an object inherited from class of createAreaPerforms standard operation policy for connected reservoirs system
riverRoutingRoutes flow in a channel or riverAllocates resources to multiple demand sites with priorities
reservoirRoutingRoutes flow in a storage/hydropower reservoirAllocates resources to multiple demand sites with priorities
aquiferRoutingRoutes storage in an unconfined aquiferAllocates resources to multiple demand sites with priorities
diversionRoutingRoutes flow in diversion worksAllocates resources to multiple demand sites with priorities
rippleNo-fail storage size using Rippl’s methodUses reverse SPA
cap_designReservoir capacity designUses yield–storage relationships
Performance analysis and visualizationriskReservoir performance indicesReliability, resiliency, and vulnerability
plot.createAreaPlot function for object inherited from class of createAreaThe function uses network analysis to layouts features existing in the basin
plot.simPlot function for object inherited from class of simPlots releases, spills, and storages time series
Table 3. Monthly average time series used in multi-reservoir simulation.
Table 3. Monthly average time series used in multi-reservoir simulation.
Sep.Oct.Nov.Dec.Jan.Feb.Mar.Apr.May.Jun.Jul.Aug.
Inflow (×106 m3)Bukan16.4944.9771.8283.14113.39253.08463.12370.66108.8533.6419.4216.18
Cheragh-Veys0.942.383.044.255.688.6916.2510.963.431.320.980.91
Markhuz0.060.170.230.300.390.831.431.030.280.080.060.06
Sonate0.431.332.172.673.958.9416.6613.574.591.200.590.42
Sarogh2.343.473.243.864.517.1114.6915.616.663.262.342.12
Demand Sites (×106 m3) *A188.000.000.000.000.000.0022.00102.00229.00245.00226.00179.00
A21.510.330.000.000.000.000.002.007.309.877.604.10
A30.370.000.000.000.000.000.211.502.932.932.031.09
A41.5414.4836.9244.2319.563.176.220.400.000.000.090.22
A52.001.100.800.500.500.002.304.507.309.007.604.10
E11.474.637.848.9711.5075.83150.61117.8011.253.271.711.38
E20.310.310.310.310.310.300.320.320.320.320.320.32
E30.020.010.000.000.000.000.000.000.000.000.000.01
D114.2012.2012.7013.2713.0113.4111.1013.0113.4014.0314.5013.20
D23.613.413.202.782.993.163.683.854.154.294.413.93
D30.860.860.860.550.550.550.860.860.861.151.151.15
Evaporation (m)Bukan0.150.080.060.040.040.060.080.130.170.210.220.20
Cheragh-Veys0.140.070.030.030.030.050.090.140.200.280.280.26
Markhuz0.090.040.020.020.030.060.110.150.200.210.200.15
Sonata0.090.040.030.030.050.080.120.160.190.200.180.14
Sarogh0.110.060.020.020.020.030.060.110.160.180.180.15
* A: Agricultural demand. E: Environmental requirement. D: Domestic demand.
Table 4. Risk-based criteria for the Bukan dam without and under the effect of upstream.
Table 4. Risk-based criteria for the Bukan dam without and under the effect of upstream.
Operation TypeCriteriaE1U1A1
Single Unit OperationVulnerability10.75817.12226.837
Volumetric Reliability0.9000.8080.767
Time-based Reliability0.8990.8040.765
Resiliency0.3330.3040.250
Large-scale OperationVulnerability0.13713.87020.000
Volumetric Reliability0.9920.8500.833
Time-based Reliability0.9910.8450.830
Resiliency1.0000.3330.300
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Arabzadeh, R.; Aberi, P.; Hesarkazzazi, S.; Hajibabaei, M.; Rauch, W.; Nikmehr, S.; Sitzenfrei, R. WRSS: An Object-Oriented R Package for Large-Scale Water Resources Operation. Water 2021, 13, 3037. https://doi.org/10.3390/w13213037

AMA Style

Arabzadeh R, Aberi P, Hesarkazzazi S, Hajibabaei M, Rauch W, Nikmehr S, Sitzenfrei R. WRSS: An Object-Oriented R Package for Large-Scale Water Resources Operation. Water. 2021; 13(21):3037. https://doi.org/10.3390/w13213037

Chicago/Turabian Style

Arabzadeh, Rezgar, Parisa Aberi, Sina Hesarkazzazi, Mohsen Hajibabaei, Wolfgang Rauch, Saman Nikmehr, and Robert Sitzenfrei. 2021. "WRSS: An Object-Oriented R Package for Large-Scale Water Resources Operation" Water 13, no. 21: 3037. https://doi.org/10.3390/w13213037

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop