StEMORS: A Stochastic Eco-Hydrological Model for Optimal Reservoir Sizing

Dams design and their operation cause strong environmental alteration and therefore a long-term debate is ongoing for the scale of these projects. At the same time, the concept of Environmental Flow Assessment (EFA) is a crucial element of modified ecosystems featuring large infrastructure such as dams and reservoirs for mitigating potential environmental degradation while they operate. Nowadays, integrated scientific frameworks are required to quantify the risks caused by large infrastructure. Through the use of stochastic analysis, it is possible to quantify these uncertainties, and present a solution that incorporates long-term persistence and environmental sustainability into a balanced reservoir simulation model. In this work, an attempt is made to determine a benchmark reservoir size incorporating hydrological and ecological criteria though stochastic analysis. The primary goal is to ensure the best possible conditions for the ecosystem, and then secondarily to allow a steady supply of water for other uses. Using a synthetic timeseries based on historical inputs, it is possible to determine and preserve essential statistical characteristics of a river’s streamflow, and use these to detect the optimal reservoir capacity that maximizes environmental and local water demand reliability.

This study focuses on the Kingdom of Lesotho. It is a small country, with a primarily mountainous geomorphology, located entirely within South Africa. Its largest river, Senqu, in the east, is one of three major rivers that contain most of the country's surface water, the others being Mohokare in the west and Makhaleng in the central regions.
The climate in Lesotho is generally characterized by cool, dry winters and hot, humid summers. Precipitation ranges between 500 and 1200 mm on average, with almost 85% of the total precipitation occurring between October and April. Furthermore, it seems to be influenced mainly by elevation and orientation of rainfall. For the southeastern part of the country, the influence of topography on data has been documented in various studies (Arthington et al. 2006;Sene et al. 1998; Climate of Lesotho 2019). In general, there appear to be three distinct zones: one in the center of the Lesotho highlands containing parts of low rainfall rainshadow, one comprised of smaller areas around the former, and finally, a zone made up of areas along the country's southeastern border. Here, the slopes face primarily eastward and the altitude is predominantly high. A comprehensive map of mean total annual precipitation of various smaller catchment areas in the southeastern part of Lesotho is available in Figure 3 below. © Copyright owned by the authors unless otherwise noted.
OpenWaterJournal.org On the relationship between rainfall and flow, it is important to gather information on the annual values of each for a stochastic model. The geomorphology of the country helps promote a strong correlation between the two, as it is mostly comprised of thin soils and basaltic rock, leading to low permeability and high runoff coefficients. This factor, combined with frequent dry seasons, means very little water carries over between hydrological years.
It is these lengthy dry periods that spark the need for the LHWP. This encompasses the building of several dams in the region, allowing for water storage and export to South Africa, as well as generating electricity. When complete, this project could account for 20% of the country's total income (Lesotho Highlands Water Project 2019; Climate of Lesotho 2019). Environmental flow, downstream of existing and planned dams, is a key element for this project and most studies in the region so far have relied on various applications of the popular DRIFT framework, which uses hydraulic data as well as ecological information such as fish surveys (Arthington et al. 2003;King & Tharme 1994).
A total of 69 operational river flow monitoring stations are currently available across the three rivers mentioned above, but the data analyzed in the study is acquired from station SG3, Senqu River at Seaka Bridge. This measurement station returns the daily streamflow in cubic meters per second. After aggregating these inputs into monthly data, it is possible to create a timeseries starting from the hydrological year 1972-73 until 1993-94. This © Copyright owned by the authors unless otherwise noted.
OpenWaterJournal.org particular time period is selected as, after this point in time, the river's flow began to be impacted by human projects. As unregulated flow data is required for this research, only these historical values are retained as they are more likely to be accurate. By regulating more recent flows using a mathematical method, there is a risk of errors in later calculations (King et al. 1999;Tegos et al. 2017;King & Louw 1998;King & Tharme 1994). The aggregated timeseries is shown in Figure 3 below. Regarding the aggregation method, it is important to note that several of the months have missing daily data and have therefore been disregarded. In general, a month is excluded from the data if there are fewer than 25 daily measurements per month (corresponding to less than one missing day per week). For the remaining months, they are flagged as "missing" if they lack at least one daily measurement. In the data kept for further calculations, there is at least one missing day in only 18.94% of months and these are considered accurate enough based on similar studies in the same area. Also to note, for the selected data, the average monthly value is 116.56 m 3 /s, the standard deviation is 141.50 m 3 /s, and the skewness coefficient is 1.91.

Materials and Methods
For simulating the hydrosystem on a monthly time scale, a periodic autoregressive scheme of first order, PAR(1), was used, which is the most parsimonious among linear stochastic models. Readers can refer to  for the full mathematical presentation of the monthly stochastic model.
In this study, a simple reliability-based reservoir model test is proposed, similar to the concept described in a study by Koutsoyiannis, but now incorporating a dynamic environmental flow regime Koutsoyiannis 2019). This involves a simple water balance equation, formulated as where, St is water volume stored at time t, above the minimum level, Xt denotes inflow at time t, δt is total water demand for the time period of (t−1,t), and c is the reservoir storage volume assumed. Furthermore, to estimate the reliability a, the following formula is required: (2) where, U(x) is the Heaviside's unit step function, assuming U(x) = 1 for x ≥ 0 and U(x) = 0 for x < 0. The variable n represents the length of the timeseries. Then, storage is standardized as a non-dimensional net storage capacity K * , described as follows: where, c is the assumed storage, µ is the mean of annual net inflows Xt, and σ is their standard deviation. The aim here is to be able to compare the relationships governing reliability and storage between different case studies (Koutsoyiannis 2019). The reservoir model algorithm is described below: • Generate a series of inflows Xt at a monthly timescale using a stochastic algorithm.
• Assume a reservoir size c.
• Calculate a series of reservoir storages using equation (1).
• Estimate reliability for Environmental Flow and Demand by using equation (3).
• Repeat steps 3 and 4 for different reservoir sizes.
• Choose the optimum reservoir size by balancing reliability for both ecosystem and demand criteria.
To fulfill step 1, in this study, a 1,000-year synthetic monthly timeseries is created by implementing the PAR algorithm (Koutsoyiannis 2000;Koutsoyiannis 2019;Tsoukalas et al. 2018;Dimitriadis & Koutsoyiannis 2018). This can be done quickly by using the Castalia software package ). This algorithm is ideal for variables that exhibit periodicity and long-term persistence such as streamflow, and the algorithm preserves key statistics including mean value, standard deviation, and skewness in the generated synthetic timeseries. Next, from this initial output, the overall average is assumed to represent the maximum monthly demand for human needs. Usually, the monthly water requirements are a fraction of this assumed maximum per month. While existing research can justify a reasonably conservative water demand estimate, the ideal way of conducting this step would be to obtain exact demand values by conducting surveys and collecting historical data (Koutsoyiannis 2019;Tsoukalas et al. 2018;Zacharopoulou et al. 2019).
To gather information on the environmental flow requirement of the area, many applications of the DRIFT framework with a holistic approach would be suitable, as it has been tried and tested in Lesotho with verifiable accuracy (Arthington et al. 2003;Tharme 2003;King & Tharme 1994). In the hydrological component of a study conducted by Tegos et al. 2018, minimum, median, and maximum baseflows, as well as subsistence flows for the river Senqu, have been estimated using local data. More specifically, by using the minimum and mean monthly flows as boundaries, the seasonally varying target flows are as mentioned above. Subsistence flow was selected as the Q97 value (flows that are exceeded 97% of the time), whereas baseflows were set to Q60, Q75, and Q90 for minimum, median, and maximum baseflow, respectively. All of the above flows are naturalized, so if the reservoir model can accommodate them, the environmental criteria are considered as being met, with reasonable accuracy. Tables 1 and 2 below summarize these values per month.
© Copyright owned by the authors unless otherwise noted.
OpenWaterJournal.org Now, based on the available demand data, Step 3 of the reservoir model can be conducted. To achieve this, it is assumed that a normal random value between the minimum and maximum baseflow is drawn from the reservoir for any given month, together with a constant value of water demand for human needs. The latter is represented as a percentage of the assumed maximum and varies per month. Naturally, this demand is low in this area during traditionally wet months, yet reaches 100% in the peak of the dry season. The goal of calculating a combined demand profile in this way, is to stress test the reservoir model under the primary directive of sustaining a dynamic environmental flow scheme, as current EFA standards require. In this sense, as the priority is to maintain ecosystem balance, a rule is added to the model that environmental flow must be accommodated first, and then human needs. It is easy to quantify the efficiency of meeting both goals by measuring whether they were met or not as a percentage of all months. If a selected environmental flow cannot be accommodated for a given month, subsistence flow outflows as an alternative, and if even this is still not possible, whatever remains in the reservoir will outflow instead. Naturally, any excess inflows that are over the preselected dedicated storage c "spill" downstream and are not included into the following month's calculations.
© Copyright owned by the authors unless otherwise noted. OpenWaterJournal.org Moving on to the estimation of reliability a for environmental flow and human water demand, it is important to clarify what the model perceives as criteria of success for meeting its preset goals. In this model, even if subsistence flow successfully outflows from the reservoir for a given month, that month is calculated as successful for the model and fails only if this basic criterion is not met. On the other hand, if the constant monthly value for human water demand cannot be output from the reservoir, the model automatically fails with no backup value. It is relevant to note at this stage that these specific criteria have been selected due to the unique nature of the case study and model goals. As stated previously, the aim for this particular study is to maximize environmental flow reliability at all costs. At the same time, Lesotho is a characteristically dry country (Sene et al. 1998), therefore it can be assumed that any lengthy period of drought is an environmental "failure." This may not be accurate on a global scale, though; there are case studies around the world where long dry periods can actively benefit the ecosystem (Holmgren et al. 2012;Wilhite & Glantz 1985). If the study were to be undertaken in these locations with the same criteria, the model would display a failure in environmental flow reliability, which might then be wrongly mistaken as overall damage to the ecosystem. Therefore, it is important to understand the model's limitations and tweak it accordingly before applying it in a given location.

Results
With all of the necessary inputs collected, the reservoir model algorithm detailed above can be implemented for a thousand synthetic years. Figures 4 and 5 below compare standardized reservoir capacity K * with demand and environmental flow reliability.

Figure 4. Capacity-demand reliability curve, assuming maximum demand (mean annual inflow is the highest demand value).
© Copyright owned by the authors unless otherwise noted. OpenWaterJournal.org

Figure 5. Capacity-environmental flow reliability curve, assuming maximum demand (mean annual inflow is the highest demand value).
As expected, the model can meet environmental flow requirements much more easily than human demand. This is primarily due to the fact that the former are set as the prime directive and any water will cover those needs first. Even when setting a very low initial value for reservoir capacity c, environmental flow reliability is approximately 90%, while human water demand reliability is 44%. This indicates that even a small reservoir can assist an ecosystem in maintaining at least a basic subsistence flow to preserve the bare minimum environmental requirements, immediately offering more options to regulate the river and ensure ecosystem sustainability. When assuming a typical reservoir size K * = −0.5 (for the Lesotho example, corresponding to 1,261 hm 3 ), environmental flow reliability is now 92%, on average, whereas demand reliability is set to 51%, on average. Evidently, the presence of a small reservoir here has assisted in meeting both demand criteria, but by a rather insignificant amount. The months where reliability is not met here are likely to be due to extended periods of drought. Manmade reservoirs could prevent this and allow a steadier flow throughout the year even in unfavorable conditions (Montanari et al. 2013). This point is further illustrated when a larger reservoir K * = 0 is selected (for this area, corresponding to 3,516 hm 3 ) and these values rise to 93% and 60%, respectively. While within a theoretical model the storage value can be eventually raised until 100% reliability is reached overall, in practical terms the maximum possible size is limited. Based on Figures 4 and 5, the most cost-efficient volume for the reservoir appears to be for K * values of 1.5 to 2 (9,500 to 12,000 hm 3 storage for the Lesotho example). In any case, this indicates that large reservoirs, in general, perform better to facilitate human water needs as well as to output a dynamic ecofriendly flow regime. That said, it is also evident that reservoir sizes become impractically large to build quickly. Lesotho, as a case study, has the benefit of being mountainous, but in flatter areas a reservoir of this size may be entirely unfeasible (Shumilova et al. 2018;Tyralis et al. 2017;Fourniotis 2012;Koutsoyiannis 2011).
It is also appropriate to visualize the model's response to demand on a monthly basis for the entire simulation length. Figures 6 and 7 below compare overall reliability per month, assuming K * = 0.
© Copyright owned by the authors unless otherwise noted.
OpenWaterJournal.org  In the case of water demand for human needs, assuming a larger reservoir (K * = 0) and the worst-case scenario demand profile, decent performance is observed throughout traditionally wet months in a hydrological year (October through April), yet very poor results are given during the dry months of June, July, and August where reliability drops below 10%. This is a consequence of two things: naturally the demand is highest during these months, but also this particular inflow profile is marked by huge drought periods in a typical year, most often occurring during dry months, and lasting up to seven months with zero inflows. To meet demand under these extreme conditions, only a very large reservoir can achieve satisfactory results.
On the other hand, the environmental flow reliability is much more stable regardless of month. Assuming a larger reservoir (K * = 0), generally values above 90% are achieved, with a slight dip during August and September. This dip can be attributed to the naturally low inflow values and frequent dry spells during those months. © Copyright owned by the authors unless otherwise noted. OpenWaterJournal.org

Discussion
After running the model on the case study of Lesotho and studying its results, there are elements that promote further discussion, as well as aspects that require more research if it is to be applied in different locations and/or real case studies. These points are briefly outlined below.
This stochastic eco-hydrological model is meant to be a simple benchmark for desktop studies. Its aim is to present a parsimonious method to estimate the optimal reservoir size for a given river catchment with known streamflow and demand profiles. In order to truly assess its efficiency and accuracy, conduct an evaluation of the model in real world conditions must be conducted, preferably in an entirely different location. This would allow testing against all of the model's assumptions and constraints.
Naturally, the above is no simple task; while the framework presented in this study is easy to use, the inputs required can prove very difficult to obtain. Firstly, at least twenty years of monthly inflow data are required to implement a stochastic algorithm and generate a synthetic timeseries with scientifically reasonable levels of accuracy. Next, a full EFA must be conducted in the case study area. If a holistic methodology in line with current field standards is applied, this entails a network of at least two to three years of measurements. Depending on the site, this data may not be readily available or be substantially lacking in quality Zacharopoulou et al. 2019;.
Further to the above point, it is important to also conduct habitat retention analysis in the given study area that the framework is tested in. Not only is this a mandatory requirement for modern holistic EFAs, it also results in dynamic flow that often requires less water overall Tegos et al. 2018).
Once environmental flow data is available, a dynamic profile then needs to be set up in conjunction with the model proposed in this study. Currently, the framework simply assumes a normal random value between minimum and maximum baseflows. This leads to cases of unnaturally low environmental flow values during some traditionally wet months and vice versa. While this is a good enough approximation for determining a reservoir size given the number of factors involved, it would be better to implement a "smart" distribution of environmental flow demand using a secondary algorithm. For example, this could be a demand distribution that would adapt how close it is to the minimum or maximum baseflow values depending on how wet the last few months were. Furthermore, simulated droughts or floods could also be accommodated in this way, as is often requested by modern EFAs. Adding this parametric capability to environmental flow will allow researchers to further stress test their reservoirs against even stricter criteria for the ecosystem.
In a similar vein, the nature of human water demand may vary significantly across different parts of the globe. The demand profile from this study assumed that the mean annual inflow is the maximum monthly demand. While this conservative estimate is a good enough approximation for the needs of this study, in order to conduct a proper evaluation of the model in a real-world scenario, a historical timeseries of human water demand would also be necessary. Using actual data from a source such as a public water utility or local authority, one could generate a monthly schedule of water demand much closer to actual conditions. In its present state, the model's criteria for environmental flow categorize any month where demands were not met as a failure. While this is true for reliability as a definition, this does not necessarily directly correlate with a failure of protecting the ecosystem. While for the case study of Lesotho, which is a predominantly dry region in direct need of water, this analogy is likely to be apt, there are multiple catchments around the world where droughts can be beneficial. It is necessary, then, to be able to distinguish under which cases failure to meet environmental flow demands is detrimental to the ecosystem of a given area. If there are no significant links between the two, the concept of reliability may not be enough to adequately explain the nature of a catchment (Dotson 2019;Tharme 2003;Dimitriadis & Koutsoyiannis 2018).

Conclusions
© Copyright owned by the authors unless otherwise noted. OpenWaterJournal.org As with any engineering project, dam design is a science inherently linked with risk and uncertainty. The aspect of reservoir sizing is one that is often the center of debate between stakeholders, as it directly governs the scale of works and, thus, the subsequent environmental impacts. As the newer holistic EFA approaches suggest, there is usually more than one adequate solution to the problem of setting up an environmental flow scheme downstream of a dam. Which one ends up being chosen raises questions of trust between the operator and the public. Nowadays, presenting a sustainable design that prioritizes the ecosystem can serve as a way of bridging the gap between these groups with conflicting interests and this is where the stochastic eco-hydrological framework presented in this study can come into play.
In this study, it has been made clear that maintaining and prioritizing an eco-friendly flow regime for any given reservoir, without significant costs in meeting other needs, is a feasible goal, no matter the reservoir size. Expanding from this point, satisfying both environmental and human water demands appears to be more reliant on reservoir capacity than even the demand profiles themselves. This suits engineers from a design perspective as, by adopting this proposed framework, they may quantify exactly how cost-efficient their proposed reservoir will be by linking its size to reliability for both ecosystem and local demand.
The results of the stochastic eco-hydrological framework appear to indicate that the larger the reservoir, the more efficient it is, both for meeting local demand and maintaining a dynamic natural river flow downstream. However, large dam projects are often seen as extremely invasive and hazardous to the environment. It is imperative that the importance of large reservoirs from an engineering and hydrological perspective is recognized, but also that every design is linked to risk. This risk can never be eliminated, but it can be quantified and steps can be taken to mitigate potential losses. These losses are not only comprised of the initial landscaping works required to build a dam, their impact is an ongoing process that continues well beyond the structure's life expectancy. As such, it is a dam engineer's duty to ensure overall sustainability for their work. The model proposed in this study combines the concepts of engineering, stochastics, and environment into hydrology, with the aim of helping designers to achieve this goal. While it may not present a final solution, it can definitely highlight the importance and simplicity of preserving environmental flow in modern dam operation schemes.